home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.53k stars 29.91k forks source link

Xiaomi (chuangmi) remote stopped working with xiaomi_miio after latest hassio update #49037

Closed misterkoko closed 3 years ago

misterkoko commented 3 years ago

The problem

The xiaomi_miio integration broke after the latest core / supervisor update so I'm unable to use the Xiaomi (chuangmi) ir remote. If I leave the yaml snippet in the configuration, it won't let me restart since it throws errors.

What is version of Home Assistant Core has the issue?

core-2021.4.3

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

xiaomi_miio

Link to integration documentation on our website

https://www.home-assistant.io/integrations/xiaomi_miio/

Example YAML snippet

remote:
  - platform: xiaomi_miio
    host: 192.168.0.21
    token: gl25ahqdkugufez8gmqokaxo6fwz5d1m

Anything in the logs that might be useful for us?

https://pastebin.com/1uH6ELq4

It's a longer log, so I pasted the text to pastebin.
syssi commented 3 years ago

Please check your custom_components folder. Do you use additional custom components interfacing miio devices? It looks like your python-miio version was downgraded because of the manifest.json of an outdated custom component. Please check the manifest.json of all custom component about this requirements section:

  "requirements": [
    "construct==2.10.56",
    "python-miio==0.5.4"
  ],

Change the python-miio requirement if it's not 0.5.5:

  "requirements": [
    "construct==2.10.56",
    "python-miio==0.5.5"
  ],
misterkoko commented 3 years ago

I use the miio2 custom component for my Viomi vacuum. I changed it's manifest since both the construct and python-miio were outdated (construct was 2.9.45 and python-miio was 0.5.3). I restarted my HA and after I uncommented the remote yaml it worked! I didn't know the miio2 custom component and the xiaomi_miio have any corelation since the vacuum was working properly. Thank you for your help and for the quick fix. Sorry about posting it didn't work, I had to restart the instance before uncommenting the remote section. Thank you again for your help!

syssi commented 3 years ago

Could you provide the full error message? Could you remove miio2 (just for testing) from your custom_components folder and restart Home Assistant? I'm pretty sure the error message is gone as soon miio2 doesn't access outdated classes anymore.

syssi commented 3 years ago

Perfect!