Hi, I just upgraded to 0.61.1 and encountered the following error when trying to start up homeassistant again.
Does anyone know how to solve this?
Thank you!
2018-01-18 11:53:28 ERROR (MainThread) [homeassistant.components.light] Error while setting up platform xiaomi_miio
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.4/site-packages/homeassistant/helpers/entity_component.py", line 171, in _async_setup_platform
SLOW_SETUP_MAX_WAIT, loop=self.hass.loop)
File "/usr/lib/python3.4/asyncio/tasks.py", line 372, in wait_for
return fut.result()
File "/usr/lib/python3.4/asyncio/futures.py", line 277, in result
raise self._exception
File "/usr/lib/python3.4/asyncio/tasks.py", line 237, in _step
result = next(coro)
File "/usr/lib/python3.4/asyncio/coroutines.py", line 141, in coro
res = func(*args, **kw)
File "/srv/homeassistant/lib/python3.4/site-packages/homeassistant/components/light/xiaomi_miio.py", line 45, in async_setup_platform
from miio import Device, DeviceException
File "/srv/homeassistant/lib/python3.4/site-packages/miio/__init__.py", line 2, in <module>
from miio.protocol import Message, Utils
File "/srv/homeassistant/lib/python3.4/site-packages/miio/protocol.py", line 179, in <module>
Const(Int16ub, 0x2131),
File "/srv/homeassistant/lib/python3.4/site-packages/construct/core.py", line 1277, in __init__
super(Const, self).__init__(subcon)
File "/srv/homeassistant/lib/python3.4/site-packages/construct/core.py", line 287, in __init__
raise TypeError("subcon should be a Construct field")
TypeError: subcon should be a Construct field
File “/home/homeassistant/.local/lib/python3.5/site-packages/homeassistant/components/vacuum/xiaomi_miio.py”, line 92, in async_setup_platform
from miio import Vacuum
File “/home/homeassistant/.homeassistant/deps/lib/python3.5/site-packages/miio/init.py”, line 2, in
from miio.protocol import Message, Utils
File “/home/homeassistant/.homeassistant/deps/lib/python3.5/site-packages/miio/protocol.py”, line 190, in
2018-01-18 19:08:04 INFO (MainThread) [homeassistant.components.light] Setting up light.xiaomi_miio
2018-01-18 19:08:04 ERROR (MainThread) [homeassistant.components.light] Error while setting up platform xiaomi_miio
File “/home/homeassistant/.local/lib/python3.5/site-packages/homeassistant/components/light/xiaomi_miio.py”, line 45, in async_setup_platform
from miio import Device, DeviceException
File “/home/homeassistant/.homeassistant/deps/lib/python3.5/site-packages/miio/init.py”, line 2, in
from miio.protocol import Message, Utils
File “/home/homeassistant/.homeassistant/deps/lib/python3.5/site-packages/miio/protocol.py”, line 190, in
This looks like an issue with construct or python-miio. After downgrading construct to v2.8.21, functionality returned. Mirobo crashes too so I don’t think this is a HomeAssistant issue.
Error while setting up platform xiaomi_miio
Traceback (most recent call last):
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_component.py”, line 171, in _async_setup_platform
SLOW_SETUP_MAX_WAIT, loop=self.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/asyncio/tasks.py”, line 239, in _step
result = coro.send(None)
File “/usr/lib/python3.5/asyncio/coroutines.py”, line 210, in coro
res = func(*args, **kw)
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/switch/xiaomi_miio.py”, line 41, in async_setup_platform
from miio import Device, DeviceException
File “/srv/homeassistant/lib/python3.5/site-packages/miio/init.py”, line 2, in
from miio.protocol import Message, Utils
File “/srv/homeassistant/lib/python3.5/site-packages/miio/protocol.py”, line 179, in
Const(Int16ub, 0x2131),
File “/srv/homeassistant/lib/python3.5/site-packages/construct/core.py”, line 1277, in init
super(Const, self).init(subcon)
File “/srv/homeassistant/lib/python3.5/site-packages/construct/core.py”, line 287, in init
raise TypeError(“subcon should be a Construct field”)
Traceback (most recent call last):
File "/usr/local/bin/mirobo", line 7, in <module>
from miio.vacuum_cli import cli
File "/usr/local/lib/python3.6/site-packages/miio/__init__.py", line 2, in <module>
from miio.protocol import Message, Utils
File "/usr/local/lib/python3.6/site-packages/miio/protocol.py", line 179, in <module>
Const(Int16ub, 0x2131),
File "/usr/local/lib/python3.6/site-packages/construct/core.py", line 1277, in __init__
super(Const, self).__init__(subcon)
File "/usr/local/lib/python3.6/site-packages/construct/core.py", line 287, in __init__
raise TypeError("subcon should be a Construct field")
TypeError: subcon should be a Construct field
I downgraded construct by running this: pip3 install construct==2.8.21
For me both methods resulted in the errors darks0ul posted.
So, same behaviour if I downgrade Construct to 2.8.21 and if I change the order of the arguments in protocol.py when using construct==2.8.22.
Edit: python_miio==0.3.0
according to release notes, nothing concerning xiaomi has been fixed. But how mentioned above. this should have been fixed in latest hass release 0.62.0 alredy… for me it works… which setup / install method areu using?