ok. Problem is the token. I extracted the token from the cleaner before connecting to the app. Now I learned token will be changed when connecting to an app.
I also tried to exctract the token via ios app. The 96 char token i received lead to the log entry
Could not decrypt token xxxx
Using MiToolkit for extracting the token from android does not work for me, because MiToolkit is crashing. Is there another way for extracting the token from the backup.
@marcel_verpaalen Again thank you very much for your support and for developing the binding. I got it running now. It was a the wrong token.
I extracted the correct token from an android phone. Nevertheless the key extracted from iOS the binding has problems decrypting the token (something todo with iOS oder the app version??)
If you PM me your IOS token I’ll try if I can decrypt it.
To get your token: if you read through the thread, you see the ‘manual’ / screenshots way of extracting your token (unpacking your backup, opening the (right) database, open the table with the devices, read the token column)
Currently I don’t do any calculations, just give whatever the output from the device is.
Can you send me the request & response to the ‘get_prop’ command. See if somehow the value is getting wrongly interpreted.
the channel “filtermaxlive” should be “filtermaxlife”; however this is a static value of 3500 hours which is the initial lifetime of the filter and useless since it is static
other channels for “remaining life time” of the filter would be more interesting
the channel for the Power Switch is working; however also the MODE channel has a mode to set “idle” which is the same as OFF and therefore I just use the mode channel
Hi I think the xiaomi mi IO binding might conflict with my chromcasts units. I don’t know if it was the binding but my pi crashed yesterday night and I had alot of these in the log file:
2017-10-02 21:31:40.495 [WARN ] [l.discovery.MiIoDiscoveryParticipant] - mDNS Could not identify Type / Device Id from 'Chromecast-Audio-66c695bbdbd0a8cbcef903f1847a34db'
2017-10-02 21:31:40.503 [WARN ] [l.discovery.MiIoDiscoveryParticipant] - mDNS Could not identify Type / Device Id from 'Google-Cast-Group-0ad558bfbc7a4007ae4c83b42d896239-1'
==> /var/log/openhab2/events.log <==
2017-10-02 21:31:41.198 [ItemStateChangedEvent ] - CC_all_audioGroup_control changed from PAUSE to PLAY
==> /var/log/openhab2/openhab.log <==
2017-10-02 21:31:42.574 [WARN ] [l.discovery.MiIoDiscoveryParticipant] - mDNS Could not identify Type / Device Id from 'Chromecast-Audio-66c695bbdbd0a8cbcef903f1847a34db'
2017-10-02 21:31:42.597 [WARN ] [l.discovery.MiIoDiscoveryParticipant] - mDNS Could not identify Type / Device Id from 'Google-Cast-Group-0ad558bfbc7a4007ae4c83b42d896239-1'
2017-10-02 21:31:43.509 [WARN ] [l.discovery.MiIoDiscoveryParticipant] - mDNS Could not identify Type / Device Id from 'Chromecast-Audio-2f017b590f185ac3e223abd0f7fb2109'
2017-10-02 21:31:43.522 [WARN ] [l.discovery.MiIoDiscoveryParticipant] - mDNS Could not identify Type / Device Id from 'Chromecast-Audio-61b92aca71262914247b5acf4e2e2a40'
@marcel_verpaalen, I just received my vacuum cleaner and am eager to install your binding. But unfortunately I cannot find it in the bindings list. Do you have any idea, what I’m doing wrong?
@Andrew_Pawelski
When you enter a valid token, the model will be populated automatically. No need to manually put in anything. I assume the switch you currently see also does not function, correct? (If it does, and the model is not populating, pls send me a full log, from the start of the binding until approx 2min after)
From the lengthy key, am I correct to assume it is a key extracted from ios? If yes, please check if you see a ‘could not decrypt key’ in the log, as that would explain the issue
btw. For your plug, better post your questions in this thread.
Yes, I’ll need to develop the mechanism to do the calculations, but that is clear.
Can you tell me what are the exact strings you send for the various modes. I’m not sure I have them all
Can you pls indicate your exact model + fw, as I had the filter stuff in an earlier version, but than few did get null responses. (each version seems to have different subset of commands, maybe even firmware related)
Can you feedback the responses you get from the following commands get_prop["led_b","buzzer","child_lock","limit_hum","trans_level"] get_prop["battery","usb_state"]
here are more working properties. would be nice to add them:
21:03:57.094 [INFO ] [marthome.event.ItemStateChangedEvent] - XAIR_commandchannel changed from get_prop["battery","usb_state"] to get_prop["filter1_life"]
21:03:57.118 [DEBUG] [inding.miio.handler.MiIoBasicHandler] - Channel not found for filter1_life
21:03:57.133 [INFO ] [marthome.event.ItemStateChangedEvent] - XAIR_commandchannel changed from get_prop["filter1_life"] to {"result":[90],"id":14296}
21:12:48.404 [DEBUG] [nal.transport.MiIoAsyncCommunication] - Command added to Queue {"id":14335,"method":"get_prop","params":["favorite_level"]} -> 192.168.1.73 (Device: 035CAFE2 token: 92CB177775A1B10982EA2A71DC23F26D Queue: 1)
21:12:48.431 [DEBUG] [inding.miio.handler.MiIoBasicHandler] - Locating action for channel actions#commands:get_prop["favorite_level"]
21:12:48.442 [DEBUG] [inding.miio.handler.MiIoBasicHandler] - Channel Id actions#commands not in mapping. Available:
21:12:48.452 [DEBUG] [inding.miio.handler.MiIoBasicHandler] - entries: mode : org.openhab.binding.miio.internal.basic.MiIoDeviceAction@12c4e6c
21:12:48.463 [DEBUG] [inding.miio.handler.MiIoBasicHandler] - entries: buzzer : org.openhab.binding.miio.internal.basic.MiIoDeviceAction@113ce11
21:12:48.475 [DEBUG] [inding.miio.handler.MiIoBasicHandler] - entries: led : org.openhab.binding.miio.internal.basic.MiIoDeviceAction@114457
21:12:48.483 [DEBUG] [inding.miio.handler.MiIoBasicHandler] - entries: power : org.openhab.binding.miio.internal.basic.MiIoDeviceAction@272519
21:12:48.497 [DEBUG] [ing.miio.handler.MiIoAbstractHandler] - Received response for 035CAFE2 type: GET_PROPERTY, result: [10], fullresponse: {"result":[10],"id":14335}
21:12:48.523 [DEBUG] [inding.miio.handler.MiIoBasicHandler] - Channel not found for favorite_level
21:12:48.527 [INFO ] [marthome.event.ItemStateChangedEvent] - XAIR_commandchannel changed from get_prop["favorite_level"] to {"result":[10],"id":14335}
21:12:48.525 [INFO ] [marthome.event.ItemStateChangedEvent] - XAIR_commandchannel changed from {"result":[null],"id":14328} to get_prop["favorite_level"]
21:15:39.256 [DEBUG] [nal.transport.MiIoAsyncCommunication] - Command added to Queue {"id":14348,"method":"get_prop","params":["f1_hour_used","use_time","motor1_speed"]} -> 192.168.1.73 (Device: 035CAFE2 token: 92CB177775A1B10982EA2A71DC23F26D Queue: 1)
21:15:39.293 [DEBUG] [inding.miio.handler.MiIoBasicHandler] - Locating action for channel actions#commands:get_prop["f1_hour_used","use_time","motor1_speed"]
21:15:39.298 [DEBUG] [inding.miio.handler.MiIoBasicHandler] - Channel Id actions#commands not in mapping. Available:
21:15:39.302 [DEBUG] [inding.miio.handler.MiIoBasicHandler] - entries: mode : org.openhab.binding.miio.internal.basic.MiIoDeviceAction@12c4e6c
21:15:39.306 [DEBUG] [inding.miio.handler.MiIoBasicHandler] - entries: buzzer : org.openhab.binding.miio.internal.basic.MiIoDeviceAction@113ce11
21:15:39.311 [DEBUG] [inding.miio.handler.MiIoBasicHandler] - entries: led : org.openhab.binding.miio.internal.basic.MiIoDeviceAction@114457
21:15:39.315 [DEBUG] [inding.miio.handler.MiIoBasicHandler] - entries: power : org.openhab.binding.miio.internal.basic.MiIoDeviceAction@272519
21:15:39.344 [DEBUG] [ing.miio.handler.MiIoAbstractHandler] - Received response for 035CAFE2 type: GET_PROPERTY, result: [327,1179900,349], fullresponse: {"result":[327,1179900,349],"id":14348}
to explain them a little I checked vs the app:
filter1_life -> remaining life time of the filter PERCENT -> in my case 90%
favorite_level -> is a user defined value ; most possibly between 1-11 (is same as in the app); after setting this value the command “favorite” in mode channel sets the purifier to this
f1_hour_used -> return value is hours of usage time of the filter
use_time -> divided by 3600 equals the return value of f1_hour_used; however maybe this value keeps counting after f1_hour_used was reset when replacing filters --> not sure --> but value divided by 3600 should be considered for the binding… seconds are hard to read
motor_speed -> not sure whats the unit there … probably RPM ?
I have the AIR PURIFIER 2. The PRO Version has different channels.
here you can see the difference: