Closed pticavorobey closed 2 years ago
After reboot:
Platform error fan.xiaomi_miio_airpurifier - No module named 'miio.integrations.airpurifier'
Platform error fan.xiaomi_miio_airpurifier - No module named 'miio.integrations.airpurifier'
Platform error fan.xiaomi_miio_airpurifier - No module named 'miio.integrations.airpurifier
Rolling back to 2022.4 helped. However, only after removing the component completely.
If you update again to version 2022.8 via HAСS, the same error occurs.
Could you check the errors carefully? Please provide the log again. I assume it's a new/another error.
I have an idea: Could you provide a list of all custom components you are using?
ls -l config/custom_components
And if you have access to the folder please provide the output of:
grep -r 'python-miio' * | grep manifest
I assume there is another custom component which downgrades python-miio
on startup. It's important all custom components requiring python-miio must require python-miio>=0.5.12
.
Could you check the errors carefully? Please provide the log again. I assume it's a new/another error.
No problem. I did a clean install of the component via HACS. I add a description of my devices to my configuration.yaml. I have two humidifiers and one air purifier. I go to check the configuration and get the following message:
Platform error fan.xiaomi_miio_airpurifier - cannot import name 'DeviceInfo' from 'miio' (/usr/local/lib/python3.10/site-packages/miio/__init__.py)
Platform error fan.xiaomi_miio_airpurifier - cannot import name 'DeviceInfo' from 'miio' (/usr/local/lib/python3.10/site-packages/miio/__init__.py)
Platform error fan.xiaomi_miio_airpurifier - cannot import name 'DeviceInfo' from 'miio' (/usr/local/lib/python3.10/site-packages/miio/__init__.py)
I assume there is another custom component which downgrades
python-miio
on startup. It's important all custom components requiring python-miio must requirepython-miio>=0.5.12
.
Command output:
bash-5.1# ls -l /config/custom_components
total 44
drwxr-xr-x 3 root root 4096 Aug 5 18:55 composite
-rwxrwxrwx 1 root root 567 May 19 2021 decorators.py
drwxr-xr-x 3 root root 4096 Aug 9 08:51 floureon
drwxr-xr-x 9 root root 4096 Jul 14 15:58 hacs
drwxr-xr-x 5 root root 4096 Jun 27 23:00 localtuya
drwxr-xr-x 3 root root 4096 Aug 5 18:55 miio2
drwxr-xr-x 4 root root 4096 Jul 21 22:10 ready4sky
drwxr-xr-x 5 root root 4096 Jul 7 14:32 sonoff
drwxrwxrwx 6 root root 4096 May 13 16:20 xiaomi_gateway3
drwxr-xr-x 3 root root 4096 Aug 9 11:09 xiaomi_miio_airpurifier
drwxr-xr-x 4 root root 4096 Jul 5 22:10 yandex_smart_home
bash-5.1# grep -r 'python-miio' * | grep manifest
custom_components/xiaomi_miio_airpurifier/manifest.json: "python-miio>=0.5.12"
custom_components/miio2/manifest.json: "python-miio==0.5.11"
I seem to understand what you mean. I have another component that also uses the miio library, which is loaded instead of your authored component. However, there can be only one such for a system. It seems to me that I can contact the author of another component and ask to update the miio version to the one that suits everyone.
Or can you suggest me something else?
@KrzysztofHajdamowicz, look at it.
@KrzysztofHajdamowicz, look at it.
Sorry, my Python skills end here. STYJ02YM integration is abandoned for a few days and new maintainer will be welcomed!
Correct. If you start Home Assistant all manifest.json
files are parsed and requirements are collected. Home Assistant uses pip install
to install these requirements. It's not possible to install multiple versions of one library at the same time. At the moment python-miio==0.5.11
of miio2
wins the race and xiaomi_miio_airpurifier
is unable to start because important packages of the 0.5.12
release are missing.
@KrzysztofHajdamowicz Do you still accept pull requests?
@KrzysztofHajdamowicz Do you still accept pull requests?
Sure!
@pticavorobey I would provide some instructions how to manually edit/change the miio2
component to be python-miio==0.5.12
compatible. In best case the number of changes is pretty small. Are you able to edit the files of miio2 manually? As soon we know the required changes you or I can prepare a pull request.
Preparation:
custom_components/miio2/manifest.json
to python-miio==0.5.12
Please provide all errors the miio2 throws now.
miio2
Oh sure. I guess I can just replace the miio library requirements in the miio2 component.
I made changes to the manifest. Restarted assistant. The configuration has been accepted, the devices of these two components are available and working! Ready to do PR.
This was easy. I would be happy if you could do the PR. If you don't know how to do it I can take over.
@syssi @KrzysztofHajdamowicz Hope I did the right thing https://github.com/nqkdev/home-assistant-vacuum-styj02ym/pull/58
Do you use / did you fix the nqkdev
version or the KrzysztofHajdamowicz
fork?
If you see deprecation warnings at your log you could apply these changes (locally) too:
https://github.com/nqkdev/home-assistant-vacuum-styj02ym/pull/56/files
Do you use / did you fix the
nqkdev
version or theKrzysztofHajdamowicz
fork?
Ouch! My mistake. I have withdrawn my nqkdev version change request. Here is the correct PR https://github.com/KrzysztofHajdamowicz/home-assistant-vacuum-styj02ym/pull/40
Now it remains to wait for my local HACS to see this update. Thanks friends!
Stable system after a scheduled reboot gives an error on all my humidifiers and air purifiers
Platform error fan.xiaomi_miio_airpurifier - cannot import name 'DeviceInfo' from 'miio' (/usr/local/lib/python3.10/site-packages/miio/__init__.py)
Reinstalling the component does not help
Home Assistant 2022.8.2 Supervisor 2022.07.0 Frontend 20220802.0 - latest