Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unsupported device Xiaomi Smart Air Purifier 4 (zhimi.airp.mb5) #1352

Closed
sobolkz opened this issue Mar 10, 2022 · 7 comments · Fixed by #1357
Closed

Unsupported device Xiaomi Smart Air Purifier 4 (zhimi.airp.mb5) #1352

sobolkz opened this issue Mar 10, 2022 · 7 comments · Fixed by #1357

Comments

@sobolkz
Copy link

sobolkz commented Mar 10, 2022

Device information:

Use miiocli device --ip <ip address> --token <token>.

Model: zhimi.airp.mb5
Hardware version: esp32
Firmware version: 2.2.1

Could not be used due to error:
Found an unsupported model 'zhimi.airp.mb5' for class 'AirPurifier'

@sobolkz sobolkz changed the title Unsupported device Xiaomi Smart Air Purifier 4 Unsupported device Xiaomi Smart Air Purifier 4 (zhimi.airp.mb5) Mar 10, 2022
@rytilahti
Copy link
Owner

Is it working or not? If it is not working, that's likely the wrong implementation class. There exist a couple of models in AirpurifierMiot with the same zhimi.airp.* prefix (https://github.com/rytilahti/python-miio/blob/master/miio/airpurifier_miot.py#L111-L112), so your device is likely also a miot device and will require mapping like those two.

@sobolkz
Copy link
Author

sobolkz commented Mar 12, 2022

Nope, device is working, "zhimi.airp.mb5": _MAPPING_VA2, # smart airpurifier 4 was added in airpurifier_miot.py and no result:
$ ping 192.168.3.7
PING 192.168.3.7 (192.168.3.7) 56(84) bytes of data.
64 bytes from 192.168.3.7: icmp_seq=1 ttl=255 time=26.4 ms
64 bytes from 192.168.3.7: icmp_seq=2 ttl=255 time=49.1 ms
64 bytes from 192.168.3.7: icmp_seq=3 ttl=255 time=3.59 ms
64 bytes from 192.168.3.7: icmp_seq=4 ttl=255 time=1.66 ms
64 bytes from 192.168.3.7: icmp_seq=5 ttl=255 time=13.5 ms
64 bytes from 192.168.3.7: icmp_seq=6 ttl=255 time=35.6 ms
^C
--- 192.168.3.7 ping statistics ---
6 packets transmitted, 6 received, 0% packet loss, time 5008ms
rtt min/avg/max/mdev = 1.659/21.647/49.103/17.142 ms

$ miiocli airpurifiermiot --ip 192.167.3.7 --token XXXXXXXXX info
Error: Unable to discover the device 192.167.3.7

@sobolkz
Copy link
Author

sobolkz commented Mar 12, 2022

By the way, it's working now.
miiocli airpurifiermiot --ip 192.168.3.7 --token XXXXX info
Model: zhimi.airp.mb5
Hardware version: esp32
Firmware version: 2.2.1
miiocli airpurifiermiot --ip 192.168.3.7 --token XXXXX status
Power: off
Anion: True
AQI: 8 μg/m³
Average AQI: 9 μg/m³
Humidity: 37 %
Temperature: 24.3 °C
Fan Level: 1
Mode: OperationMode.Auto
LED: None
LED brightness: LedBrightness.Dim
LED brightness level: None
Buzzer: False
Buzzer vol.: None
Child lock: False
Favorite level: 11
Filter life remaining: 100 %
Filter hours used: 45
Filter left time: 289 days
Use time: None s
Purify volume: 3203 m³
Motor speed: 0 rpm
Filter RFID product id: 0:0:32:36
Filter RFID tag: XXXXX
Filter type: FilterType.Regular
It's look like all was done after server was rebooted.

@sobolkz sobolkz closed this as completed Mar 12, 2022
@sobolkz
Copy link
Author

sobolkz commented Mar 12, 2022

Fixed.

@rytilahti
Copy link
Owner

So it's using the same mapping as VA2, or is it working with the fallback _MAPPING? We can add it to the list of supported devices that it can be autodetected and work directly in the upcoming release.

@sobolkz
Copy link
Author

sobolkz commented Mar 14, 2022

So it's using the same mapping as VA2, or is it working with the fallback _MAPPING? We can add it to the list of supported devices that it can be autodetected and work directly in the upcoming release.

Nope, it's working by manually added fallback `_MAPPING
"zhimi.airp.mb5": _MAPPING_VA2, # airpurifier smart 4
As I understand for native support it should be added in separate section like _MAPPING_MB5?

@rytilahti
Copy link
Owner

rytilahti commented Mar 14, 2022

If it works with the mapping of VA2, it is enough to add a new line to https://github.com/rytilahti/python-miio/blob/master/miio/airpurifier_miot.py#L112 just like you did :-) edit: oh, there's already a PR to just do exactly that! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants