First off, I’m a Python newbie and only started learning on my own to help implement some features to the Abode component and now this. I recently paired a GE Z-Wave Plus Fan control switch to a ceiling fan and noticed there’s no speed control in HomeKit, so I’m attempting to implement it. Here are the things I’ve observed:
- HomeKit allows for controlling a fan from 0 to 100% in the iOS Home app with a definable minStep value as low as 1%.
- Home Assistant implements fan speed control with four speeds: off, low, medium and high (typical for most generic ceiling fans).
- Some ceiling fans have more speed settings.
With this in mind, I’d imagine we would want to expand Home Assistant’s fan speed supported features options to support the various different speed settings fans can have. It appears the majority (at least in the United States) of generic ceiling fans just support off/low/medium/high but I’ve seen other users post about fans with an additional speed. How to implement this is beyond me but just something of note.
That being said, I’ve still attempted to add fan speed control to the HomeKit component which you can find here:
I’ve tested this on my Hassio setup and everything works. Currently it’s setup with a
minStep: 25 so when you slide the speed control in the iOS Home app, it increases/decreases in 25% increments. The issue here is this obviously results in five speed settings, 0%, 25%, 50%, 75% and 100%. Right now 75% and 100% both just command a fan speed of high. I suppose the other option would be to set
minStep: 33 so you essentially get just four speeds.
One other minor issue is if I toggle the fan on from an off state, the fan turns on to the last speed setting but the iOS Home app always shows 100%. I’m sure it’s because I’m screwing something up in the
update_state method which I don’t entirely understand.
Anyways, if anyone that actually understands python better than I can help review the code and provide inputs/additions/edits, any help would be greatly appreciated.