Error setting up xiaomi_miio platform in 0.61.1

Thank you. It worked. Sorry, but I’m not an linux expert, Thank You for your help.

1 Like

Tried that, not fixing the issue. Got the error
" Ignoring typing: markers ‘python_version < “3.5”’ don’t match your environment"

I am running hass on mac mini.

1 Like

Thanks! Finally got the V2 machine working. V1 was working fine before. Odd.

I’ve been struggling with this error since upgrading to 0.62, thanks for the details on how to fix it.

Still not working here.

Running hass on an archlinux vm. Running latest builds as described here, have also tried various other combos of construct and miio but no joy. Perhaps I need to downgrade hass to 62.0?

[root@home ~]# pip3 show homeassistant | grep Version:
Version: 0.62.1
[root@home ~]# pip3 show construct | grep Version:
Version: 2.9.27
[root@home ~]# pip3 show python-miio | grep Version:
Version: 0.3.5
[root@home ~]# python3 --version
Python 3.6.4


Error while setting up platform xiaomi_miio
Traceback (most recent call last):
File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity_component.py", line 189, in _async_setup_platform
SLOW_SETUP_MAX_WAIT, loop=self.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 243, 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 212, in coro
res = func(*args, **kw)
File "/usr/lib/python3.6/site-packages/homeassistant/components/switch/xiaomi_miio.py", line 52, in async_setup_platform
device_info = plug.info()
File "/root/.homeassistant/deps/lib/python3.6/site-packages/miio/device.py", line 271, in info
return DeviceInfo(self.send("miIO.info", []))
File "/root/.homeassistant/deps/lib/python3.6/site-packages/miio/device.py", line 216, in send
m = Message.build(msg, ctx)
TypeError: build() takes 2 positional arguments but 3 were given

Ok, so tried downgrade to homeassistant 0.62.0 … still no joy

[root@home ~]# pip3 show homeassistant | grep Version:
Version: 0.62.0
[root@home ~]# pip3 show python-miio | grep Version:
Version: 0.3.4
[root@home ~]# pip3 show construct | grep Version:
Version: 2.8.22

According to this thread, the combo above should work, but it doesn’t :frowning:

( although that thread does describe a slightly different error).

Updated to hass dev, with latest construct and python-miio - still broken.

Wondering if it’s a python 3.6 problem?

Nope. You are mixing things up! You’ve installed python-miio & construct multiple times. If you use “pip show” as root the path “/usr/lib/python3.6/site-packages/” is used. As you can see in your error message:

File "/root/.homeassistant/deps/lib/python3.6/site-packages/miio/device.py", line 271, in info
return DeviceInfo(self.send("miIO.info", []))
File "/root/.homeassistant/deps/lib/python3.6/site-packages/miio/device.py", line 216, in send
m = Message.build(msg, ctx)

python-miio is used from “/root/.homeassistant/deps/lib/python3.6/site-packages”. Just try to check the version of python-miio directly:

cat /root/.homeassistant/deps/lib/python3.6/site-packages/miio/version.py

It return “0.3.4”, right? The dev branch of homeassistant is fixed now. Just update homeassistant. It will pull all required components automatically now.

Thanks for the help @syssi

You are correct in that i have been installing construct and python_miio multiple times. I have been using the commands

 pip3 install https://github.com/rytilahti/python-miio/archive/master.zip
 pip3 install construct==x.xx.x 

etc
Each time these commands seem to uninstall the current version of the component, and install the requested one.
Are these commands not installing into the location that homeassistant is using? If not, how do I make them install to the correct location for homeassistant ? (sorry, still learning linux)

As per your request, I’ve checked the version inside the .homeassistant folder:

[root@home ~]# cat /root/.homeassistant/deps/lib/python3.6/site-packages/miio/version.py
# flake8: noqa
__version__ = "0.3.4"

I then upgraded homeassistant:

 pip3 install --upgrade git+git://github.com/home-assistant/home-assistant.git@dev

However, cat /root/.homeassistant/deps/lib/python3.6/site-packages/miio/version.py still shows:

__version__ = "0.3.4"

Current pip3 show outputs:

[root@home ~]# pip3 show construct | grep Version:
Version: 2.9.27
[root@home ~]# pip3 show python-miio | grep Version:
Version: 0.3.5
[root@home ~]# pip3 show homeassistant | grep Version:
Version: 0.63.0.dev0

same problem on hassio 0.63

Yes for me too, still the same problem on 0.63 :frowning:

@Alessandro_Morrone @2xdehelft Do you use hassio?

https://github.com/home-assistant/hassio/issues/356
https://github.com/home-assistant/home-assistant/issues/12298
https://github.com/home-assistant/home-assistant/issues/12028

it’s a neverending story…

The root cause was identified. The story will end soon! :stuck_out_tongue:

1 Like

I have the problem on 0.63.1

Looking forward to a fix as I only added the platform and got the yeelight and air purifier after the bug.

yes obviously

is it solved in 0.63.3?

So they say… I’m waiting for the Hassio upgrade to be available to see.

OK I just upgraded to 0.63.3
The Nightmare is over!

glad to hear. now you can see thee vacuum again?