#Philips Hue Dimmer Switch dim up/down logic is non deterministic

1 messages · Page 1 of 1 (latest)

sacred nexus
#

I am new to HA and trying to get my Philips Hue Dimmer Switch to control an Ikea Tradfri bulb, Cync LED Strip, and Switchbot floor lamp. I have created a helper called "Living Room Ambient Lights" to control all 3 of these lights together.

In my automation I have 4 triggers (short/long press up/down) with conditional based on which trigger was selected. This is the logic for dim_up_short_press, which is the TriggerID I gave to '"Dim up" pressed'

If I'm understanding the trace log correctly I gave the same input twice but 1 time executed as expected and the other didn't.

As I've been writing this up I've been messing around more and did notice my Trace timeline gave this message.
Stopped because only a single execution is allowed at December 17, 2025 at 10:55:38 PM (runtime: 0.00 seconds)
I don't have any other automations outside of using this remote so not sure what other execution might've happened. Any ideas as to why it seems to be non deterministic?

choose:
  - conditions:
      - condition: trigger
        id:
          - dim_up_short_press
    sequence:
      - condition: numeric_state
        entity_id: light.living_room_ambient_lights
        attribute: brightness
        below: 255
      - target:
          entity_id: light.living_room_ambient_lights
        data:
          brightness_step_pct: 10
        action: light.turn_on
turbid swift
#

Is your automation in single mode? How is your Dimmer integrated into HA? Via Hub or with Z2M/ZHA?

sacred nexus
sacred nexus
#

I tried swapping to use queue mode but noticed it seems like random triggers get stuck running.

I’m not sure if these warnings came before or after swapping modes but would rather give too much info than not enough.

Logger: homeassistant.components.automation.living_room_hue_switch_dimmer_up
Source: helpers/script.py:2064
integration: Automation (documentation, issues)
First occurred: December 17, 2025 at 10:06:23 PM (173 occurrences)
Last logged: 10:48:52 AM

Living Room Hue Switch Dimmer up: Already running
Living Room Hue Switch Dimmer up: Maximum number of runs exceeded

#

I’ve also noticed my LED strip seems to be a little “laggy” so maybe it’s having trouble communicating with the LED strip, which causes the event to hang like this?

I’ve been thinking about replacing the Cync connector with an ESP32 controller but not sure if that’ll improve performance.

turbid swift
#

I see a lot of repeats in your autoamtion - can you share with us the YAML code?

sacred nexus
turbid swift
#

Why do you have repeat loops?

sacred nexus
# turbid swift Why do you have repeat loops?

I have them repeating so if I long press my dim down I could go from 100% brightness to 20% brightness gradually vs all at once. Is there a simpler way to do this?

From a programming perspective I was thinking something like this.

While (button is pressed and brightness > 20%){
Dim 10% over the next .3 seconds
}

buoyant prawn
sacred nexus
#

I basically want it to continue getting brighter until it reaches max or I release the button

turbid swift
#

No not the same. You are now blocking the execution. Setting longer transition only means that you send the comand once to light and then has to manage transition on its own

sacred nexus
#

Maybe I’m not understanding how the long press trigger works. Is it sent once and the assumption is that it’s being held down until it is released or does it keep sending the same long press over and over again?

#

Example 1:
0 sec: Dim up continuous press
1 sec: nothing
2 sec: nothing
3 sec: nothing
4 sec: Dim up released after long press

Example 2:

0 sec: Dim up continuous press
1 sec: Dim up continuous press
2 sec: Dim up continuous press
3 sec: Dim up continuous press
4 sec: Dim up released after long press

Is it like example 1 or 2?

solid cobalt
#

Pressing and releasing a button should create two separate events. Set the mode of the automation to restart, have it loop through the brightness levels when pressing the dim buttons, have it abort the automation when receiving the release event.

sacred nexus
#

The person before said I shouldn’t be using a loop at all

solid cobalt
#

I don't know how you would want to dim with holding a button without a loop. If you'd do single presses per iteration you don't need a loop, if you want to press and hold while the brightness changes you need a loop

#

It is not what you posted as your mode is set to queued. You want to start an infinite loop on the dim event and abort that loop by restarting the automation on the release event

#

Look at the brightness section and substitute {{states('input_select.testdropdown')}}" with your entity_id. Important to note is that the mode is set to restart