Hue Dimmer Switch - impossible to automate in HA due to delay and missing events

Dear Philips Hue users:

I’m been a happy user of Philips Hue ecosystem since many year ago, and all my lights and wall switches are Hue products. Since I started HA journey I slowly migrate automation from HomeKit and Hue to HA, which all work flawlessly except for automations based on user events. Those events are short click and long click of Hue wireless switches (I have mostly Hue Dimmer Switches). In sort of works but also gives some problems:

  1. As I understand due to the limitation of Hue api, for the same device HA can only get event once per second. This gives significant delay for short_release and long_release events.
  2. For short_release my current workaround is to listen to initial_press, however HA sometimes miss the event so user has to press the switch 2nd time to make it work.
    Those issues are not there if I configure in Hue native app, also not there with HomeKit or OpenHAB.
    So my question to everybody who use Hue wireless switch: what do you do to configure the actions in HA? Any suggestion is appreciated!

I don’t use the Hue app anymore. Connected all zigbee lights to HA using Zigbee2MQTT and a Sonoff Zigbee dongle.

You can select any action from the Hue dimmer switch:

1 Like

Same. Works perfectly.

The issue is often that people use the entity of the buttons and dimmers, but states of an entity do not change of the value is not changed.

The right and the original way is to use events instead.
On the event bus you can see each button press even if it the same as the previous one.

The entity might show a long press, but the event bus shows button press, button hold, button hold, button hold, button release.

As I have the devices connected through Z2M, ii use an mqtt trigger which gives me payloads of on_hold up_hold down_hold off_hold on_press_release etc etc

  triggers:
    - trigger: mqtt
      topic: "zigbee2mqtt/Study dimmer/action"
  actions:
    - choose:
        - conditions: "{{ trigger.payload == 'on_hold' }}"
          sequence:
...

Is that not a good way to do it?

That is the same that goes on the event bus, so it is also a good way to do it.

1 Like

I tried both event and event.XXX entity. So for a simple button press they match, both signal initial_press and short_release. For whatever reason event.XXX state changes come before events. In both cases the short_release is significantly delayed, and initial_press sometime missing. So it is not usable if I have to automate it in HA.

The event bus is in HA and if it is not on the event bus, then it is nowhere in HA.

Likewise if it is not in the MQTT broker, then it is not on the HA event bus, unless it is somehow connected in other ways to HA.

I think I understand what you’re saying - however the problem is not missing events, but delay of events - there is a clear 1 second delay on event bus for initial_press and short_release, hence making automation for short_release impossible.

Not sure what is the cause, but it is a chain.

Device → Zigbee coordinator (Z2M) → MQTTBroker → HA event bus → HA entity

Look at each step and the one that adds the delay is the one you need to dig into.

The cause is the HA integration to Hue Bridge - I understand there is 1 update per second limitation. Not sure why but HomeKit and OpenHAB were not restricted by this.
Due to the limitation it makes Hue Bridge with wireless switch not working very well with HA.