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
NotImplementedError when trying to get status from Xiaomi Air Purifier 4 Lite (zhimi.airp.rma3) #1892
Comments
P.S.: If I run any other "device" command (descriptors, sensors, settings), I get this message:
|
I've tried adding it to airpurifier_miot.py: "zhimi.airp.rma3": _MAPPING_RMB1, # airpurifier 4 lite The result is the same unfortunately. |
Did you try the command shown in the info? Try The warning about missing descriptors is unrelated, it's more aimed for other commands than For the airpurifier_miot.py, the command is |
I've made some progress. Yes running the suggested command works, I have to say this is very confusing as a user. You run a command which outputs the correct command to run. I was also able to control the device using "miiocli airpurifiermiot", status gives an empty output though. Calling status on genericmiot only gives me read only properties like temperature and humidity, nothing to control the device. I can control the device though by specifying siid and piid manually like this: miiocli genericmiot --ip 192.168.8.232 --token set_property_by 2 1 1 bool Thanks so far, next I'll try to access the API directly using a python script. Would you still classify this as a bug, since the original NotImplementedError is still valid? Otherwise I'd close this issue. |
Ohh, I didn't realize You can try
Let's keep this issue open, as it's indeed confusing that calling |
To add to your API question, it really depends on what you want to do. The easiest way is to use a repl like ipython to explore the API (besides checking out https://github.com/rytilahti/python-miio/#api-usage), as you can use a tab for autocompletion. Here are some examples (using a simulated rma3):
Also, if you don't need anything fancy, you can also use the Alas, proper documentation for API usage is missing at the moment, but let me know what you need and I'll try to help. |
Thanks, control using the set command works. Good input for exploring the API, will do tomorrow, it's already late here. If all works out I have the idea to add an MQTT client to my code so I can control via iobroker (which runs on nodejs. There's some javascript code available but it hasn't been updated in years unfortunately). |
Sure thing! I think the simplest way to explore would be using a graphical debugger (e.g., pycharm) as it can be overwhelming with all the dynamically constructed data. |
pycharm is already up and running :). Thanks again. |
Great! Let me know if you find something odd or if you have some ideas what should be included in the docs regarding the API use. |
Sure will do |
I made some progress: I can read the status and publish it to MQTT. Accessing setting and controlling the device works (e. g. turn on/off with on.setter(False)). What I couldn't figure out though, is there a way to get the current value of a setting. It says read/write, so it should be possible to read and not only to write. |
I've figured out how to do it, although it's rather complicated as I did it. Is there an easier way to get the settings current value? You can check my script at: https://github.com/technyon/mqmiio/ I've kept it very general, so best case this works for more than just my air purifier. Also, should we create a seperate issue for this discussion? |
Describe the bug
I want to control my Xiaomi Air Purifier 4 Lite, it is a model for chinese mainland. It took some work to get it to work outside of china with the smartphone app, and I can connect using miiocli now:
If I try however to run the status command, I get a NotImplementedError in device.py:
Version information (please complete the following information):
miiocli --version
orpip show python-miio
]I've installed the latest version directly from github:
Device information:
If the issue is specific to a device [Use
miiocli device --ip <ip address> --token <token> info
]:To Reproduce
Steps to reproduce the behavior:
Expected behavior
The output of the status command is printed.
Console output
See above.
The text was updated successfully, but these errors were encountered: