Unfortunately, it is still broken for 0.63
https://github.com/home-assistant/home-assistant/issues/12298
This applies for certain docker images.
I confirm, it is still broken for me too for 0.63…
I have same problem … it is still broken for 0.63 version
I don’t understand why it cannot been fixed yet on hassio version…
I do have the same issue, did the update from 0.61.1 to 0.63. Also to 0.62 there was the same issue.
Thanks in advance for fixing.
Here is the code error code in case someone needs it:
2018-02-11 17:24:54 ERROR (MainThread) [homeassistant.components.vacuum] Error while setting up platform xiaomi_miio
Traceback (most recent call last):
File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py", line 84, in async_setup
SLOW_SETUP_MAX_WAIT, loop=hass.loop)
File "/usr/lib/python3.6/asyncio/tasks.py", line 358, in wait_for
return fut.result()
File "/usr/lib/python3.6/asyncio/futures.py", line 245, in result
raise self._exception
File "/usr/lib/python3.6/asyncio/tasks.py", line 180, in _step
result = coro.send(None)
File "/usr/lib/python3.6/asyncio/coroutines.py", line 210, in coro
res = func(*args, **kw)
File "/usr/lib/python3.6/site-packages/homeassistant/components/vacuum/xiaomi_miio.py", line 90, in async_setup_platform
from miio import Vacuum
File "/usr/lib/python3.6/site-packages/miio/__init__.py", line 2, in <module>
from miio.protocol import Message, Utils
File "/usr/lib/python3.6/site-packages/miio/protocol.py", line 179, in <module>
Const(0x2131, Int16ub),
File "/usr/lib/python3.6/site-packages/construct/core.py", line 1894, in __init__
super(Const, self).__init__(subcon)
File "/usr/lib/python3.6/site-packages/construct/core.py", line 291, in __init__
raise TypeError("subcon should be a Construct field")
TypeError: subcon should be a Construct field
We found a fix for docker users: Just remove the “miio” and “construct” directory (+ content) from /config/deps/ if present. cp. https://github.com/home-assistant/home-assistant/issues/12305
I have /config/deps/ but it is empty.and it’s still not working for me under 0.63
In addition to this, I have configured my Yeelights but they are now being detected as well. Previously, if they were not in the config yaml file they would show up with generic names but if I had them configured properly with ‘friendly’ names they would not be duplicated.
The Meals Area Light and the Fan Light are the ones with the duplicate names. (Yee Lights at the bottom) and the Switch showing is my Wemo Switch - the Xiaomi ones are still missing.
This is the log for the switches:
Mon Feb 12 2018 08:27:38 GMT+1100 (Local Daylight Time)
Error while setting up platform xiaomi_miio
Traceback (most recent call last):
File “/usr/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py”, line 84, in async_setup
SLOW_SETUP_MAX_WAIT, loop=hass.loop)
File “/usr/lib/python3.6/asyncio/tasks.py”, line 358, in wait_for
return fut.result()
File “/usr/lib/python3.6/asyncio/futures.py”, line 245, in result
raise self._exception
File “/usr/lib/python3.6/asyncio/tasks.py”, line 180, in _step
result = coro.send(None)
File “/usr/lib/python3.6/asyncio/coroutines.py”, line 210, in coro
res = func(*args, **kw)
File “/usr/lib/python3.6/site-packages/homeassistant/components/switch/xiaomi_miio.py”, line 41, in async_setup_platform
from miio import Device, DeviceException
File “/usr/lib/python3.6/site-packages/miio/init.py”, line 2, in
from miio.protocol import Message, Utils
File “/usr/lib/python3.6/site-packages/miio/protocol.py”, line 179, in
Const(0x2131, Int16ub),
File “/usr/lib/python3.6/site-packages/construct/core.py”, line 1894, in init
super(Const, self).init(subcon)
File “/usr/lib/python3.6/site-packages/construct/core.py”, line 291, in init
raise TypeError(“subcon should be a Construct field”)
TypeError: subcon should be a Construct field
Had the same Problem, this helps:
Actually for Hassio, I found you need to SSH into the Docket (need to copy an authorized_keys file to the root of the SD card) Then executing:
docker exec homeassistant pip3 install construct==2.9.29
This is not persistent - if you reboot the Pi it’s lost but restarting HA is OK.
See here:https://github.com/home-assistant/home-assistant/issues/12028#issuecomment-364816108
and https://home-assistant.io/developers/hassio/debugging/
I’ve upgraded to 0.63, Miio still not working. And Yeelights are double in the config… once discovered and once configured manualy…
Yeah I reported the same exact thing this morning. Ended up hiding the extra ones in customise and fixed as per above.
@DavidFW1960 Could you do me a favor? Please break you installation again by rebooting your raspberry pi. The exception should show up in the logs again. SSH to your Raspberry Pi (with your public key). Instead of installing “construct” you execute these commands first:
# Login to your homeassistant container
$ docker exec -it homeassistant /bin/bash
# Check which miio version is installed
$ cat /usr/local/lib/python3.6/site-packages/miio/version.py
# flake8: noqa
__version__ = "0.3.5"
# Check which construct version is installed
$ cat /usr/local/lib/python3.6/site-packages/construct/version.py
version = (2,9,28)
version_string = "2.9.28"
release_date = "2018.02.08"
# Check the number of construct installs:
$ find / -name construct
/usr/local/lib/python3.6/site-packages/construct
# Check the number of python-miio installs:
$ find / -name miio
/usr/local/lib/python3.6/site-packages/miio
# Install a new construct version
$ pip3 install -U construct
Could you provide the output of the commands? The “$” is just the linux prompt. I want to identify the state of your docker container before manually fixing the issue.
cat /usr/local/lib/python3.6/site-packages/miio/version.py
returns:
bash-4.4# cat /usr/local/lib/python3.6/site-packages/miio/version.py
cat: can’t open ‘/usr/local/lib/python3.6/site-packages/miio/version.py’: No such file or directory
changed down to the site-packages folder one by one. The only file in site-packages is cv2.cpython-36m-arm-linux-gnueabihf.so
bash-4.4# pip3 install -U construct
Collecting construct
Downloading construct-2.9.29.tar.gz (67kB)
100% |████████████████████████████████| 71kB 194kB/s
Installing collected packages: construct
Found existing installation: construct 2.8.10
Uninstalling construct-2.8.10:
Successfully uninstalled construct-2.8.10
Running setup.py install for construct … done
Successfully installed construct-2.9.29
that doesn’t bring the switches back up either.
I have the exact same thing!
My how to wasn’t accurate. This should be the proper hassio paths/commands:
docker exec -it homeassistant /bin/bash
cat /usr/lib/python3.6/site-packages/miio/version.py
cat /usr/lib/python3.6/site-packages/construct/version.py
find / -name construct
find / -name miio
pip3 install -U construct
The “find” commands are also important and please copy&paste the complete output. I want to make sure you enter the docker container properly (first command). The prompt will change here.
The root cause for the issue is found. We are close to a proper solution!