Iād like to add my vote to this. Iām trying to migrate my devices from Homebridge to Homeassistant, and this is one of the things blocking me.
I added support for a few of my devices to Homebridge, so Iām hoping that Iāll have enough transferrable skills to make a stab at this. Iāll need to understand the device/entity structure that Homeassistant uses figure out how the Homekit component handles composite devices, brush up on my Python, and figure out how to deploy a test version to my Homeassistant box. How hard can it be?
I made some adjustments to the Homekit component that treat any fan device with an associated PM2.5 sensor as an air purifier. You can see it here: GitHub - ak6i/core at homekit_air_purifier
If you want to use this in your Home Assistant configuration, you can copy the homeassistant/components/homekit directory into your config/custom_components directory (easiest is to add the SMB add-on), and add a line to the manifest.json like: "version" : "0.99.0",
Restart and the changes will appear. You may need to remove and re-add your Homekit bridge from the Home app on your Apple device to make things work completely.
Thatās the plan. Iāve got a PR open but itāll need some work for me to get it into good enough shape (Pythonās not my first language, new codebase, and other excuses).
In the meantime, do feel free to try it out and let me know any feedback you have!
I canāt guarantee that this code will work with all air purifiers because I have a limited set to test with. This should theoretically work with any device that exposes both a fan and a PM2.5 sensor to Home Assistant. You may also have to do the happy dance of removing and re-adding your Home Assistant to HomeKit, removing and re-adding your air purifier from Home Assistant, or some similar action.
I really want this too. Iām trying to migrate my Dyson fans from Homebridge to Home Assistant and the lack of Air Purifier support means I canāt group the fan and the thermostat together.
@ak6i I found your PR, but it looks like itās been closed for inactivity. Do you have any plans to pick up the PR again?
@ak6i it would be really great if you could pick this up again. This is the last device class I need and I can remove the Tradfri gateway. All of my Zigbee devices will be migrated to Sky Connect. I just canāt do it without the air purifiers importing correctly into HomeKit.
I donāt have much time on my hands right now, but you can copy the homekit directory from core/homeassistant/components at homekit_air_purifier Ā· ak6i/core Ā· GitHub into your custom_components directory and then youāll get the changes. There arenāt many updates to the homekit component so you should be fairly safe.
The only reason the PR didnāt make it in is due to a lack of unit tests. If anyone wants to contribute them before I get the time to write them, youād be very welcome to do so