rgavril / homebridge-xiaomi-air-purifier3

Homebridge plugin for controlling Xiaomi Air Purifier 3/3H
46 stars 7 forks source link

are you able to make this work with the Mi Air Purifier Pro model? #13

Open github9984 opened 4 years ago

github9984 commented 4 years ago

I can't seem to find dictionary values for Pro models.

Does anyone know if the previous models support siid, piid values?

rgavril commented 4 years ago

I don't have access to one, but can you run this command and share the output:

miio discover

I want to know the 'Model info' so I can check out what are the differences.

github9984 commented 4 years ago

the model info is "unknown" I have other plugins that work with the Pro model, but not coded as elegant as your copy. I am also a dev, but don't really understand why the airpurifier3 device uses Siid & Piid, but older model Pro use Miio calls instead.

rgavril commented 4 years ago

MiOT it's a new protocol that actually shares a lot with the old one (MIIO). Newly released devices, like Air Purifier 3, are using MIOT.

Basically instead of using something like this with the old protocol

get_prop <property_name>
set_prop <property_name> <value>

Now you need to use something like

get_properties <siid> <piid>
set_properties <siid> <piid> <value>

Where siid and piid are some numeric value (service id, property id) representing the property that you want to read or write. This numeric values (siid, piid) can be looked up in a json file specific to each model (example). That's why I asked for your model number.

TL;DR New devices use an updated miio protocol that is not compatible with the old one.

github9984 commented 4 years ago

do you know if there’s a spec file for zhimi.airpurifier.v7

I got this model info from the token backups

rgavril commented 4 years ago

All the instances are listed in this json but I couldn't find a reference to zhimi.airpurifier.v7

I also look over the net and your model was released some years ago and works with the old miio protocol.

Implementing the support for previous api calls in this plugin shouldn't be hard for someone with some JS knowledge.

Unfortunately I don't have access to an older device and don't feel like blindly working on this. If anyone wants to take on this task I'm open to give advice and merge it in the project.

github9984 commented 4 years ago

Thanks for sharing the info. I will have a go at implementing it for the old protocol.

rgavril commented 4 years ago

You'll need to switch the MIoTAirPurifier with a newly created class that implements the MIIO protocol.

IslandSandMan commented 3 years ago

Any word for being able to bring support to the newer Xiaomi Air Purifier Pro H model? @rgavril I am a huge fan of your efforts, the 3H is running like a dream thanks to your plug in, in Hoobs. I have brought in my new Xiaomi Air Purifier Pro H with the same requirements as you have set for the 3H and it is working in HomeKit but my OCD would love the model name to show that it is the Pro H in HomeKit instead of 3H when you go into device info , as well as the ability to adjust the fan speed precisely like with the 3H... for now it works but if there is a way you can release a seperate version for the Pro H that works exactly like how you have done it for the 3H, I may just have to make a donation for your efforts :). I am at a very basic level and use Hoobs but love how well its working for the 3H! Many thanks!