『瀚思彼岸』» 智能家居技术论坛

 找回密码
 立即注册
查看: 3931|回复: 2

[求助] 小米净水器加入homebridge和HASS出问题,请大神指点。

[复制链接]

164

主题

617

帖子

3639

积分

论坛元老

Rank: 8Rank: 8

积分
3639
金钱
3017
HASS币
0
发表于 2018-12-2 16:14:17 | 显示全部楼层 |阅读模式
本帖最后由 ptlzx 于 2018-12-2 16:50 编辑

环境:群晖docker上homebridge、HASS 0.83.2

HASS 0.83.2方式 参考【https://github.com/bit3725/homeassistant-mi-water-purifier
拷贝mi_water_purifier.py到custom_components/sensor目录下,按上面参考帖编辑configuration.yaml文件内容,但启动HASS状态里找不到净水器,错误信息:

群晖docker下的hass里怎么安装python-miio,不知道是不是这个原因?

Sun Dec 02 2018 16:10:20 GMT+0800 (CST)

Error while setting up platform mi_water_purifier
Traceback (most recent call last):
  File "/config/custom_components/sensor/mi_water_purifier.py", line 159, in parse_data
    status = self._device.send('get_prop', [])
  File "/usr/local/lib/python3.6/site-packages/miio/device.py", line 263, in send
    self.__id = m.data.value["id"]
TypeError: 'NoneType' object is not subscriptable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/app/homeassistant/helpers/entity_platform.py", line 128, in _async_setup_platform
    SLOW_SETUP_MAX_WAIT, loop=hass.loop)
  File "/usr/local/lib/python3.6/asyncio/tasks.py", line 358, in wait_for
    return fut.result()
  File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/sensor/mi_water_purifier.py", line 34, in setup_platform
    waterPurifier = XiaomiWaterPurifier(device, name)
  File "/config/custom_components/sensor/mi_water_purifier.py", line 116, in __init__
    self.parse_data()
  File "/config/custom_components/sensor/mi_water_purifier.py", line 177, in parse_data
    except DeviceException:
NameError: name 'DeviceException' is not defined




Sun Dec 02 2018 16:10:20 GMT+0800 (CST)

unable to parse json '{"result":[net],"id":1}': Expecting value: line 1 column 12 (char 11)





直接加入homebridge方式 https://www.npmjs.com/package/homebridge-mi-water-purifier

运行一半出错停止


install.sh
#!/bin/bash
apt-get install libavahi-compat-libdnssd-dev
npm install -g homebridge-mi-aqara
npm install -g homebridge-yeelight
npm install -g homebridge-synology
npm install -g miio
npm install -g homebridge-mqtt-switch-tasmota
npm install -g miio homebridge-mi-ir-remote
npm install -g homebridge-mi-acpartner
npm install -g miio homebridge-mi-water-purifier


config.json
"platforms": [{
    "platform": "MiWaterPurifierPlatform",
    "deviceCfgs": [{
        "type": "MiWaterPurifier",
        "ip": "192.168.31.x",
        "token": "xxxxxxxxxxxxxxxxxxx",
        "Name": "Water TDS"
    }]
}]




回复

使用道具 举报

11

主题

324

帖子

1332

积分

金牌会员

Rank: 6Rank: 6

积分
1332
金钱
1008
HASS币
0
发表于 2019-2-15 11:58:22 | 显示全部楼层
楼主 解决问题了吗?请教一下你。
回复

使用道具 举报

164

主题

617

帖子

3639

积分

论坛元老

Rank: 8Rank: 8

积分
3639
金钱
3017
HASS币
0
 楼主| 发表于 2019-2-18 11:48:07 | 显示全部楼层
wangyiyuan 发表于 2019-2-15 11:58
楼主 解决问题了吗?请教一下你。

不支持1A好像,要6个过滤棒的才行。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-4-25 18:06 , Processed in 0.117880 second(s), 24 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表