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

 找回密码
 立即注册
楼主: iciness

[基础教程] 小米净水机接入HA-----作者:xingkui wang

  [复制链接]

13

主题

185

帖子

586

积分

高级会员

Rank: 4

积分
586
金钱
400
HASS币
0
发表于 2018-10-9 13:03:14 | 显示全部楼层
本帖最后由 jerrykkk 于 2018-10-9 13:05 编辑
bit3725 发表于 2017-12-21 16:07
我自己升级到 homeassistant 0.60 之后发现了一个问题,https://github.com/bit3725/homeassistant-mi-wate ...
HA 版本
0.77.3

按最新的py接入后,HA“状态”无法看到相关实体,以下是报错信息
2018-10-09 04:48:46 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up platform mi_water_purifier
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/miio/device.py", line 258, in send
    m = Message.parse(data, token=self.token)
  File "/usr/local/lib/python3.6/site-packages/construct/core.py", line 288, in parse
    return self.parse_stream(io.BytesIO(data), **contextkw)
  File "/usr/local/lib/python3.6/site-packages/construct/core.py", line 298, in parse_stream
    return self._parsereport(stream, context, "(parsing)")
  File "/usr/local/lib/python3.6/site-packages/construct/core.py", line 310, in _parsereport
    obj = self._parse(stream, context, path)
  File "/usr/local/lib/python3.6/site-packages/construct/core.py", line 2064, in _parse
    subobj = sc._parsereport(stream, context, path)
  File "/usr/local/lib/python3.6/site-packages/construct/core.py", line 310, in _parsereport
    obj = self._parse(stream, context, path)
  File "/usr/local/lib/python3.6/site-packages/construct/core.py", line 2554, in _parse
    return self.subcon._parsereport(stream, context, path)
  File "/usr/local/lib/python3.6/site-packages/construct/core.py", line 310, in _parsereport
    obj = self._parse(stream, context, path)
  File "/usr/local/lib/python3.6/site-packages/construct/core.py", line 3682, in _parse
    return sc._parsereport(stream, context, path)
  File "/usr/local/lib/python3.6/site-packages/construct/core.py", line 310, in _parsereport
    obj = self._parse(stream, context, path)
  File "/usr/local/lib/python3.6/site-packages/construct/core.py", line 4998, in _parse
    hash2 if not isinstance(hash2,bytestringtype) else binascii.hexlify(hash2), ))
construct.core.ChecksumError: wrong checksum, read b'ffffffffffffffffffffffffffffffff', computed b'3aa44fce79f7ff5d2ee7fb2efc45c626'
The above exception was the direct cause of the following exception:
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 279, in send
    "Please check your token!") from ex
miio.exceptions.DeviceException: Got checksum error which indicates use of an invalid token. Please check your token!
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

回复

使用道具 举报

2

主题

169

帖子

1441

积分

论坛积极会员

积分
1441
金钱
1272
HASS币
0
发表于 2018-10-9 13:50:16 | 显示全部楼层
正要入手呢  正需要的东西
回复

使用道具 举报

13

主题

185

帖子

586

积分

高级会员

Rank: 4

积分
586
金钱
400
HASS币
0
发表于 2018-10-9 14:43:49 | 显示全部楼层
bit3725 发表于 2017-12-21 16:07
我自己升级到 homeassistant 0.60 之后发现了一个问题,https://github.com/bit3725/homeassistant-mi-wate ...

遇到问题了,求指点,谢谢

https://bbs.hassbian.com/forum.p ... mp;extra=#pid139856
回复

使用道具 举报

0

主题

47

帖子

389

积分

中级会员

Rank: 3Rank: 3

积分
389
金钱
342
HASS币
0
发表于 2018-10-9 16:25:05 | 显示全部楼层
厨上厨下都可以吗?
回复

使用道具 举报

1

主题

18

帖子

146

积分

论坛积极会员

积分
146
金钱
128
HASS币
0
发表于 2018-10-11 15:32:47 | 显示全部楼层
感谢分享!
回复

使用道具 举报

13

主题

150

帖子

960

积分

论坛积极会员

积分
960
金钱
810
HASS币
0
发表于 2018-10-17 13:34:34 | 显示全部楼层
学习一下
回复

使用道具 举报

7

主题

155

帖子

657

积分

高级会员

Rank: 4

积分
657
金钱
501
HASS币
0
发表于 2018-10-17 22:04:34 | 显示全部楼层
看看,学习下载
回复

使用道具 举报

3

主题

90

帖子

209

积分

中级会员

Rank: 3Rank: 3

积分
209
金钱
119
HASS币
0
发表于 2018-10-17 22:09:17 | 显示全部楼层
谢谢分享~
回复

使用道具 举报

4

主题

59

帖子

164

积分

论坛积极会员

积分
164
金钱
105
HASS币
0
发表于 2018-10-22 21:51:32 | 显示全部楼层
感谢分享
回复

使用道具 举报

0

主题

20

帖子

102

积分

注册会员

Rank: 2

积分
102
金钱
82
HASS币
0
发表于 2018-10-22 23:22:19 | 显示全部楼层
厉害了 终于可以脱离了
回复

使用道具 举报

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

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-11-23 07:19 , Processed in 0.155779 second(s), 30 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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