jghaanstra / com.xiaomi-miio

Homey app to control Mi Home devices that implement the miIO protocol and Xiaomi gateway child devices
GNU General Public License v3.0
455 stars 84 forks source link

Would it be possible to declare Humidifier (and maybe Air Purifiers) as device class fan, or switch? #73

Closed Moskvitch closed 5 years ago

Moskvitch commented 5 years ago

No expert here, but could you take a look at this, please

https://github.com/swttt/com.swttt.homekit/issues/140

robertklep commented 5 years ago

Or possibly use a virtual class "fan", that's something that we could probably work with for Homeykit.

jghaanstra commented 5 years ago

@robertklep That does not sound to hard but I have no idea how I can set a virtual class. Do you have a link to the documentation or an example?

robertklep commented 5 years ago

It's not documented :( There's a reference to the virtualClass property in the Web API documentation; the only reason I know about it is that we received a PR for Homeykit a while back where devices with class socket had a virtual class light.

I have no idea how to set it, but I assume it works by adding a virtualClass property to the pairing data.

jghaanstra commented 5 years ago

I believe the virtual class is only available for devices with the socket class. It can be set using the 'choose slave' template when pairing the device. See the documentation here.

Changing the purifier or humidifier to a socket device class does not seem like a smart plan. Any other way to achieve integration with the Homekit app?

robertklep commented 5 years ago

I agree that you shouldn't use socket as a class.

I'll try and see if I can get sensor devices with an onoff capability working properly. In that case, you don't have to change anything.

jghaanstra commented 5 years ago

Ok, if needed post back here. I'm closing this for now.

robertklep commented 5 years ago

I think I can make it work inside of Homeykit 👍🏻

Moskvitch commented 5 years ago

Do I understand correctly that it can be done by fine-tuning Homeykit without any changes to the Mi Home app needed?

jghaanstra commented 5 years ago

Yes, is correct.