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

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

[求助] HomeAssistant 连接 小米风扇 求助

[复制链接]

2

主题

32

帖子

193

积分

论坛积极会员

积分
193
金钱
161
HASS币
0
发表于 2018-2-28 12:17:37 | 显示全部楼层 |阅读模式
通过HA连接小米风扇,使用了Smart Mi fan插件,插件地址 https://github.com/homeassistantchina/custom_components 。但无法使用,已经折腾了三天,望大神指点。附log:
2018-02-28 11:11:17 ERROR (MainThread) [homeassistant.components.fan] Error while setting up platform smart_mi_fanTraceback (most recent call last):
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py", line 84, in async_setup
    SLOW_SETUP_MAX_WAIT, loop=hass.loop)
  File "/usr/lib/python3.5/asyncio/tasks.py", line 400, in wait_for
    return fut.result()
  File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result
    raise self._exception
  File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/home/homeassistant/.homeassistant/custom_components/fan/smart_mi_fan.py", line 76, in setup_platform
    SmartMiFan(hass, name, host, token),
  File "/home/homeassistant/.homeassistant/custom_components/fan/smart_mi_fan.py", line 145, in __init__
    self._state_attrs = self.fan_get_prop()
  File "/home/homeassistant/.homeassistant/custom_components/fan/smart_mi_fan.py", line 379, in fan_get_prop
    prop = self.fan.send("get_prop", ["temp_dec","humidity","angle","speed","poweroff_time","power","ac_power","battery","angle_enable","speed_level","natural_level","child_lock","buzzer","led_b"])
  File "/home/homeassistant/.homeassistant/custom_components/fan/smart_mi_fan.py", line 247, in fan
    import miio
  File "/srv/homeassistant/lib/python3.5/site-packages/miio/__init__.py", line 2, in <module>
    from miio.protocol import Message, Utils
  File "/srv/homeassistant/lib/python3.5/site-packages/miio/protocol.py", line 155, in <module>
    Const(Int16ub, 0x2131),
  File "/srv/homeassistant/lib/python3.5/site-packages/construct/core.py", line 2461, in __init__
    super(Const, self).__init__(subcon)
  File "/srv/homeassistant/lib/python3.5/site-packages/construct/core.py", line 562, in __init__
    raise TypeError("subcon should be a Construct field")
TypeError: subcon should be a Construct field
2018-02-28 11:11:21 WARNING (MainThread) [homeassistant.components.sensor.template] Could not render template current_smart_mi_fan_shake_head_angle, the state is unknown.
2018-02-28 11:11:21 WARNING (MainThread) [homeassistant.components.sensor.template] Could not render template current_smart_mi_fan_speed, the state is unknown.



回复

使用道具 举报

25

主题

687

帖子

3630

积分

论坛元老

Rank: 8Rank: 8

积分
3630
金钱
2937
HASS币
219

活跃会员

发表于 2018-2-28 14:41:54 | 显示全部楼层
记得是miio版本升级了,需要手动替换miio文件到原来的版本才行,电风扇等天气热了估计就有大神来解决了
回复

使用道具 举报

2

主题

32

帖子

193

积分

论坛积极会员

积分
193
金钱
161
HASS币
0
 楼主| 发表于 2018-2-28 18:22:03 | 显示全部楼层
aktifin 发表于 2018-2-28 14:41
记得是miio版本升级了,需要手动替换miio文件到原来的版本才行,电风扇等天气热了估计就有大神来解决了 ...

嗯,估计到夏天就有大神来解决了。
回复

使用道具 举报

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

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-12-23 21:36 , Processed in 0.325813 second(s), 25 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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