Zigbee2mqtt automation help

I have a philips Hue dimmer switch and 4 tradfri bulbs connected to zigbee2mqtt.

I’m using the Hue dimmer switch to control the lights (on/off and brightness)

Here are my automation:

  • id: ‘1525140123423’
    alias: telecommande Hue Salon → On
    initial_state: ‘on’
    trigger:
    platform: mqtt
    topic: ‘zigbee2mqtt/remote-hue-salon’
    condition:
    condition: template
    value_template: “{{ ‘on’ == trigger.payload_json.action }}”
    action:
    • entity_id:
      • light.salon
        service: light.turn_on
  • id: ‘1525140123424’
    alias: telecommande Hue Salon → Off
    initial_state: ‘on’
    trigger:
    platform: mqtt
    topic: ‘zigbee2mqtt/remote-hue-salon’
    condition:
    condition: template
    value_template: “{{ ‘off’ == trigger.payload_json.action }}”
    action:
    • entity_id:
      • light.salon
        service: light.turn_off
  • id: ‘1525140123424’
    alias: telecommande Hue Salon → brightness
    initial_state: ‘on’
    trigger:
    platform: mqtt
    topic: ‘zigbee2mqtt/remote-hue-salon’
    condition:
    condition: or
    conditions:
    - condition: template
    value_template: “{{ ‘down-press’ == trigger.payload_json.action }}”
    - condition: template
    value_template: “{{ ‘up-press’ == trigger.payload_json.action }}”
    action:
    • service: light.turn_on
      data_template:
      entity_id: light.salon
      brightness: ‘{{ trigger.payload_json.brightness }}’

It works fine, but is quite slow. Every lights turn on or off with between 0.5 et 3 seconds delay, sometimes some lights don’t change state.

Any suggestions on what I can do to make this more reliable and faster?

1 Like

I’m having the same problem… I guess that is due to the mqtt delays… In my case, I’m using a dimmer that send multiple messages with the same brightness… HA will generate multiple mqtt messages… very slow… still investigating if there is a better way