|
通过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.
|
|