[homekit] Homekit sending ON and 100 Command

Hi Simon,

i checked MQTTTHING but could not find any special logic for Dimmer. the only logic i saw was “if brightness =100 and state=OFF then state =ON” and the similar for brightness=0. basically switch dimmer on/off depending on brightness. but this is not the issue here. home app sends anyway ON/OFF always.

probably i need to dig deeper in homebridge and nodeRed to understand how it works end-to-end.

on your points:

  1. “first 100%, then 50% as soon as the actuator updates its state”
    im afraid i cannot do much here. it is openhab core logic: if dimmer state = ON then set brightness=100.

(State)target.cast(this == ON ? PercentType.HUNDRED : PercentType.ZERO);

we could try to filter brightness=100 update out and dont send it to home app. but it would require pretty complex logic to find which one needs to filtered and which not.
the proper solution would be to fix it in openhab core.

  1. “hardly possible now to dim to 100%”
    i think i have solution for this. the idea - if dimmer is already on and we get brightness=100 then we should update brightness. if dimmer is off and we get brightness=100 then we just sends “ON”.
    the PR for this is already in place
    https://github.com/openhab/openhab-addons/pull/7932

i would like to ask you to test it again, once it is merged.

PS: i should buy a dimmer device to test it myself with the physical device.

It works! Great thanks.

1 Like

I still seem to be seeing the original issue, i.e. even when I have the filterBrightness100 selected I still see both the ON event and the filterBrightness100 events fired when I turn on a dimmer from homekit.

hm. make sure you have the recent homekit binding version (not sure anymore in which version the filter was introduce).
what is in your openhab event log? do you see the events you get from homekit there?

make sure you have the recent homekit binding version

Is it included in the most recent stable (I think 2.5.9) or do I need to switch to snapshot?

what is in your openhab event log? do you see the events you get from homekit there?

I see two events being fired when I turn the dimmer from off to on through homekit:

  • Status changed from OFF to ON
  • Brightness changed from 0 to 100

By the way, thanks for all the work on homekit recently - I have been waiting almost three years for garage door support.

strange. it should filter it out.
can you share your config for that item and the events log? do you have any rules which could set brightness to 100? maybe the device itself doing it.

Okay so it seems to work now, the switch defaults to the previous value when turned on but in HomeKit the item presents as 100% initially then is updated to the correct value after a few seconds.

All of my rules are defined in HomeKit so I don’t think that was causing the issue.

maybe

 autoupdate="false"}

will solve this issue, e.g.

{homekit="Lighting, Lighting.Brightness" [dimmerMode="filterBrightness100"],  autoupdate="false"}

Continuing the discussion from [homekit] Homekit sending ON and 100 Command:

While facing the same issue, I tried your suggestion and added autoupdate statement

{homekit="Lighting, Lighting.Brightness" [dimmermode="filterOnExceptBrightness100"], autoupdate="false"}

Observation is that an ON command is fired before the new brightness level is set.

Not working In OpenHAB 3 :–
value: Lighting,Lighting.Brightness
[dimmerMode=“filterBrightness100”], autoupdate=“false”
config: {}

also tried :–
value: Lighting,Lighting.OnState,Lighting.Brightness
config:
dimmerMode: filterOn, filterBrightness100
autoupdate: false

and tried :–
value: Lighting,Lighting.Brightness
config:
dimmerMode: filterOn
autoupdate: false

what exactly is not working? do you see it in home app and can control but nothing changes on device?

Looks good on the Home App but the Lighting.Brightness not functioning at all. I can change the dimming of the brightness in the Home App but it doesn’t change the dimming of the lightbulb.

value: Lighting,Lighting.OnState,Lighting.Brightness
config:
dimmerMode: filterOn
autoupdate: false

You are setting the group as having all three metadata options which it does not. The Lighting.Brightness and Lighting.OnState attributes need to be applied to the group members directly not to the group.

2 Likes

Thanks Ethan.

value: Lighting.OnState
config:
dimmerMode: filterOn, filterBrightness100

You can mark my post as a solution that way people know that this has been solved.

Good morning, I‘m new to this community and OpenHAB so please be patient with me …
I‘m struggling with the same issue.
I actually need help where in OH3 I need to specify the dimmerMode attributes and its syntax.
Was trying in specify them directly in metadata code. I can save the code but when re-enter the code it disappeared.

Hi @Roc and welcome,

you do it already at correct place, in metadata code. but the code editor is pretty strict on syntax and is not perfect on syntax error communication yet.
try to put 2 spaces before the dimmer line, e.g.

Thank you very much for you quick response. Now I can modify the code and safe it. Thanks again!

What I don’t understand though is the logic behind filterOn to avoid forcing 100% brightness when switching on.

My KNX actor is configured with 70% brightness when switching On only. HomeKit sends both, On and Brightness=100% which kind of overrules the 70% actor value. I thought it’s the filterBrightness100 that avoids sending 100% brightness when switching On. And it seems function ….
Do I miss something?

homekit sends always “ON” and Brightness = 100% (it is not aware of your KNX settings).

  • filterOn: ignores the “ON” command and sends only “Brightness = 100%” to KNX
  • filterBrightness100: ignores the “Brightness = 100%” command and sends only ON to KNX

so, in your case you need filterBrightness100

Thank you, glad it matches what I thought.
Great help - thanks again.