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.93k stars 30.15k forks source link

Xiaomi_miio.fan broken in 2022.3.5 #68256

Closed bkupidura closed 2 years ago

bkupidura commented 2 years ago

The problem

After upgrade to 2022.3.5 my Xiaomi fan (zhimi.airpurifier.m1) is broken. All sensors from fan are available (buzzer switch, light switch, humidity sensor, ...), but fan.<name> is missing.

What version of Home Assistant Core has the issue?

2022.3.5

What was the last working version of Home Assistant Core?

2022.2.9

What type of installation are you running?

Home Assistant Container

Integration causing the issue

Xiaomi_miio.fan

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

2022-03-16 19:08:02 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform xiaomi_miio.fan: Platform not found (No module named 'miio.integrations.fan').

Additional information

/config # pip freeze |grep miio
python-miio==0.5.11
/config # python
Python 3.9.9 (main, Feb  8 2022, 09:16:53)
[GCC 10.3.1 20210424] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import miio.integrations.fan
>>>
probot-home-assistant[bot] commented 2 years ago

Hey there @rytilahti, @syssi, @starkillerog, @bieniu, mind taking a look at this issue as it has been labeled with an integration (xiaomi_miio) you are listed as a code owner for? Thanks! (message by CodeOwnersMention)


xiaomi_miio documentation xiaomi_miio source (message by IssueLinks)

bkupidura commented 2 years ago

@rytilahti @syssi @starkillerOG @bieniu sorry to ping you directly ;) Is there anything more i can provide to help with that one?

rytilahti commented 2 years ago

It looks like that your shell and the environment you are running homeassistant are not the same.. Looking at fan implementation, this is the only import that could cause that:

from miio.integrations.fan.zhimi.zhimi_miot import (
    OperationModeFanZA5 as FanZA5OperationMode,
)

Could you try that in repl to see if it works? Also, do you happen to have some custom components that might depend on earlier python-miio versions (which could explain this)?

bkupidura commented 2 years ago

@rytilahti this import i checked previously and it was working. Indeed im using custom component for xiaomi vacuum (https://github.com/KrzysztofHajdamowicz/home-assistant-vacuum-styj02ym), but it depending on latest python-miio (5.11).

But looks like i had old python-miio in deps directory, after removing it and restarting HA container my fan is back ;)

Thanks for poiting me into right direction!