-
-
Notifications
You must be signed in to change notification settings - Fork 570
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
Xiaomi Purifier 4 Compact #1550
Comments
Hi! I also have a Purifier 4 Compact. When trying to use latest master miiocli with poetry run miiocli -d airpurifier --model zhimi.airp.cpa4 --ip 192.168.178.176 --token mytoken info I only receive DEBUG:miio.miioprotocol:Got a response: Container: During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): The above exception was the direct cause of the following exception: Traceback (most recent call last): I understand that this is a new device to miiocli. |
@mkohns this is the base command i am using "miiocli -o json airpurifiermiot --model zhimi.airp.mb5 --ip --token". Note the device type is "airpurifiermiot" not "airpurifier" Pretty much everything is working if you use properties from https://home.miot-spec.com/spec?type=urn%3Amiot-spec-v2%3Adevice%3Aair-purifier%3A0000A007%3Azhimi-cpa4%3A1 To get device status do something like - base_command_from_above raw_command get_properties '[{"siid":2,"piid":1}, {"siid":3,"piid":4}, {"siid":9,"piid":11}, {"siid":2,"piid":4}]' /power, pm2, fav_level, mode/ |
@messyjoes1 Thanks a lot for the help an insights! This is working now for me.
This was quite impressing.
This is my output now poetry run miiocli -o json -d airpurifiermiot --ip 192.168.178.176 --token mytoken --model zhimi.airp.mb5 raw_command get_properties '[{"siid":2,"piid":1}, {"siid":3,"piid":4}, {"siid":9,"piid":11}, {"siid":2,"piid":4}]' DEBUG:miio.miioprotocol:Got a response: Container: |
@messyjoes1: one more question. Would it be the right approach to edit file miio/integrations/airpurifier/zhimi/airpurifier_miot.py
What do you think? Do I miss something? |
Okay, I tested what I described above. You can find the small changes in fork: https://github.com/mkohns/python-miio The reason why command "status" made the device crash (and beep) was in max_properties setting. I have never implemented anything in python. I am a golang developer. |
Could you try the request with fewer, but more than 1, properties to see if that works? If yes, the limitation comes from the UDP datagram size and not from the device. Btw, you can also obtain the tokens in git master version using |
Hi @rytilahti! Nice to meet you. |
Hi @mkohns, thanks for testing! It's good to know about that limitation so I can make it somehow configurable in the future. I'm currently working on a generic implementation for all miot devices to avoid the need to manually create implementations for specific devices. |
Am I right that this fix has not been released as part of the package yet? I'm thinking that this might be related to the issue I just created at Home Assistant (home-assistant/core#104169), as they are using the latest available package |
Hello. I have the same problem was it solved? |
+1 |
Device information:
Name(s) of the device: Xiaomi Purifier 4 Compact
Link: https://www.mi.com/global/product/xiaomi-smart-air-purifier-4-compact/
Model: zhimi.airp.cpa4
Hardware version: esp32
Firmware version: 2.2.1
Additional context
'on/off/set_mode/set_led_brightness(reversed)' works with _MAPPING_VA2
'set_fan_level/favorite_level/favorite_rpm' didn't work with any that i tried
'status' doesn't work with any - when sending status command, the device beeps > wifi icon flashes several times > Error: Unable to discover the device 192.168.x.x
also this model has 'PM2.5 IR sensor' not laser like other ones, and does not provide exact pm2.5 value even in the official app
https://home.miot-spec.com/spec?type=urn%3Amiot-spec-v2%3Adevice%3Aair-purifier%3A0000A007%3Azhimi-cpa4%3A1
tested and working:
read pm2 value - get_property_by 3 4
set favorite level - raw_command set_properties '[{"value":1,"siid":9,"piid":11}]'
The text was updated successfully, but these errors were encountered: