I’ve been using OH for many year but recently decided to start using homekit. I have an issue with live sliders overwhelming my dimmers with too many changes to the dim level. In the openhab app, I’ve been able to turn these off, but I can’t seem to find a way to do the same in the Homekit app.
Does anyone know if this is possible? If not, is there anyway to deal with this on the OH side?
What exactly do you want to disable?
The dim slider function in Homekit so that you can only turn the light on/off?
Live sliders send many dim level commands while you are moving the slider. Normal sliders send one dim level command when you release the slider. This behavior is selectable in the openHAB mainUI and basicUI (in different ways). Since the many commands being sent from live sliders overwhelm my devices I’ve turned those off in MainUI and BasicUI. This live slider behavior however is the default in the Apple Homekit app. I was hoping someone knew of a way to either:
- Change live sliders to normal sliders in the Apple Homekit app preferences OR
- Somehow configure my homekit tags to tell the Apple Homekit app to use normal sliders OR
- Somehow configure openHAB to filter out or limit the many dim level commands send by the Apple Homekit app live sliders.
You can try it this way:
1.Item setup (homekit_dimmers.items)
For each light, define two items: one that receives commands from HomeKit, and one that controls the actual device.
Example:
Group gHomeKitDimmers
Dimmer Light_LivingRoom_Raw “Living Room (HomeKit)” (gHomeKitDimmers) { homekit=“Lighting” }
Dimmer Light_LivingRoom “Living Room” { channel=“zigbee:device:bridge:1234:brightness” }Dimmer Light_DiningRoom_Raw “Dining Room (HomeKit)” (gHomeKitDimmers) { homekit=“Lighting” }
Dimmer Light_DiningRoom “Dining Room” { channel=“zigbee:device:bridge:5678:brightness” }
The “_Raw” item is the one connected to HomeKit. The corresponding item without “_Raw” is the one used for real control.
2.Rule setup (homekit_filter.rules)
var HashMap<String, Timer> dimTimers = newHashMap
rule “Filter HomeKit Dimmer Updates”
when
Member of gHomeKitDimmers received command
then
val itemName = triggeringItem.name
val newValue = receivedCommand as Numberif (dimTimers.containsKey(itemName)) { dimTimers.get(itemName).cancel } dimTimers.put(itemName, createTimer(now.plusMillis(500)) [| val targetName = itemName.replace("_Raw", "") val targetItem = ScriptServiceUtil.getItemRegistry.getItem(targetName) logInfo("HomeKitFilter", "Applying final value for " + targetItem.name + ": " + newValue) targetItem.sendCommand(newValue) dimTimers.remove(itemName) ])end
3. Explanation
When a HomeKit command is sent to any “_Raw” dimmer item, the rule is triggered.
A timer is started (or restarted) for that specific dimmer. If another command arrives within 500 milliseconds, the previous timer is cancelled and restarted.
Only when no more updates arrive within 500 milliseconds, the timer runs and sends the final value to the corresponding real dimmer item.
This means that only the last value from HomeKit is applied, preventing flicker and unnecessary commands.
Hi @dirkdirk ,
Appreciate you taking the time to put this together. I was considering doing this same approach but wasn’t sure if there was some simple setting somewhere that I could change.