Z2M - Philips Hue Dimmer Switch - Ultimate Controller (Device Triggers + Double Clicks

:electric_plug: Z2M - Philips Hue Dimmer Switch - Ultimate Controller (Device Triggers + Double Clicks)

This blueprint is a modern, “Frustration-Free” controller for the Philips Hue Dimmer Switch (both Gen 1 and Gen 2) running via Zigbee2MQTT.

Unlike older blueprints that require you to manually type MQTT topics or enable hidden legacy sensors, this blueprint uses Device Triggers. You simply select your remote from a dropdown list, and it just works.

Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint URL.

:sparkles: Features

  • :high_voltage: Zero Configuration: No need to find “Action Entities” or type MQTT topics. Just pick your device.
  • :computer_mouse: Synthetic Double Click: Adds Double Click support to all 4 buttons (a feature the hardware doesn’t normally support!).
  • :stopwatch: Configurable Delay: You can adjust the double-click speed (ms) to match your preference.
  • :prohibited: No “Ghost Clicks”: Uses mode: single to ensure a Double Click doesn’t accidentally trigger the Single Click action too.
  • :person_in_lotus_position: Frustration-Free: Intelligently handles the “Hold” vs “Press” conflict. Single clicks only fire on release, ensuring they don’t misfire when you mean to hold the button.
  • :label: Visual Labels: The inputs are organized with section headers and use emojis matching the physical buttons (I/O for Gen 1, Power/Hue for Gen 2).

:video_game: Supported Actions

For every button (Top, Up, Down, Bottom), you can assign:

  1. Single Click
  2. Double Click
  3. Hold

:memo: Prerequisites

  • Home Assistant (2024.x or newer recommended)
  • Zigbee2MQTT
  • A Philips Hue Dimmer Switch paired via Z2M.

:gear: The Blueprint

blueprint:
  name: Ultimate Hue Remote Controller via Z2M
  description: >
    Configure Hue Remote buttons via Zigbee2MQTT with Device Triggers.
    
    **Features:**
    - Synthetic Double Click
    - Organized settings by button
    - Visual Section Headers
    
    **Compatible with:**
    - Gen 1 (Labels: "I", "O")
    - Gen 2 (Labels: "Power", "Hue")
  domain: automation

  input:
    remote:
      name: Philips Hue Remote
      description: Select your remote device.
      selector:
        device:
          integration: mqtt
          manufacturer: Philips
          model: Hue dimmer switch
    
    double_click_delay:
      name: Double Click Delay (ms)
      description: >
        Time to wait for a second click. 
        Lower = Lights turn on faster (less lag).
        Higher = Easier to perform a double click.
        Recommended: 400ms - 600ms.
      default: 500
      selector:
        number:
          min: 100
          max: 2000
          unit_of_measurement: ms
          mode: box

    # ----------------------------------------------------------------
    # TOP BUTTON
    # ----------------------------------------------------------------
    on_single_press:
      name: 🟢 Top Button - Single Click
      description: 'Symbol: "I" or "Power"'
      default: []
      selector: { action: {} }
    on_double_press:
      name: 🟢 Top Button - Double Click
      description: 'Symbol: "I" or "Power"'
      default: []
      selector: { action: {} }
    on_hold:
      name: 🟢 Top Button - Hold
      description: 'Symbol: "I" or "Power"'
      default: []
      selector: { action: {} }

    # ----------------------------------------------------------------
    # UP BUTTON
    # ----------------------------------------------------------------
    up_single_press:
      name: 🔆 Up Button - Single Click
      description: 'Symbol: Large Sun (Brighten)'
      default: []
      selector: { action: {} }
    up_double_press:
      name: 🔆 Up Button - Double Click
      description: 'Symbol: Large Sun (Brighten)'
      default: []
      selector: { action: {} }
    up_hold:
      name: 🔆 Up Button - Hold
      description: 'Symbol: Large Sun (Brighten)'
      default: []
      selector: { action: {} }

    # ----------------------------------------------------------------
    # DOWN BUTTON
    # ----------------------------------------------------------------
    down_single_press:
      name: 🔅 Down Button - Single Click
      description: 'Symbol: Small Sun (Dim)'
      default: []
      selector: { action: {} }
    down_double_press:
      name: 🔅 Down Button - Double Click
      description: 'Symbol: Small Sun (Dim)'
      default: []
      selector: { action: {} }
    down_hold:
      name: 🔅 Down Button - Hold
      description: 'Symbol: Small Sun (Dim)'
      default: []
      selector: { action: {} }

    # ----------------------------------------------------------------
    # BOTTOM BUTTON
    # ----------------------------------------------------------------
    off_single_press:
      name: 🔴 Bottom Button - Single Click
      description: 'Symbol: "O" or "Hue" Logo'
      default: []
      selector: { action: {} }
    off_double_press:
      name: 🔴 Bottom Button - Double Click
      description: 'Symbol: "O" or "Hue" Logo'
      default: []
      selector: { action: {} }
    off_hold:
      name: 🔴 Bottom Button - Hold
      description: 'Symbol: "O" or "Hue" Logo'
      default: []
      selector: { action: {} }

# Mode Single is required to prevent "Ghost Clicks" during double click detection
mode: single
max_exceeded: silent

trigger:
  # Triggers for Press (Release) and Hold
  - platform: device
    domain: mqtt
    device_id: !input remote
    type: action
    subtype: on_press_release
    id: on_press
  - platform: device
    domain: mqtt
    device_id: !input remote
    type: action
    subtype: on_hold
    id: on_hold

  - platform: device
    domain: mqtt
    device_id: !input remote
    type: action
    subtype: up_press_release
    id: up_press
  - platform: device
    domain: mqtt
    device_id: !input remote
    type: action
    subtype: up_hold
    id: up_hold

  - platform: device
    domain: mqtt
    device_id: !input remote
    type: action
    subtype: down_press_release
    id: down_press
  - platform: device
    domain: mqtt
    device_id: !input remote
    type: action
    subtype: down_hold
    id: down_hold

  - platform: device
    domain: mqtt
    device_id: !input remote
    type: action
    subtype: off_press_release
    id: off_press
  - platform: device
    domain: mqtt
    device_id: !input remote
    type: action
    subtype: off_hold
    id: off_hold

action:
  - choose:
      # --- TOP BUTTON LOGIC ---
      - conditions: "{{ trigger.id == 'on_press' }}"
        sequence:
          - wait_for_trigger:
              - platform: device
                domain: mqtt
                device_id: !input remote
                type: action
                subtype: on_press_release
            timeout: 
              milliseconds: !input double_click_delay
            continue_on_timeout: true
          - choose:
              - conditions: "{{ wait.trigger != none }}"
                sequence: !input on_double_press
              - conditions: "{{ wait.trigger == none }}"
                sequence: !input on_single_press
      - conditions: "{{ trigger.id == 'on_hold' }}"
        sequence: !input on_hold

      # --- UP BUTTON LOGIC ---
      - conditions: "{{ trigger.id == 'up_press' }}"
        sequence:
          - wait_for_trigger:
              - platform: device
                domain: mqtt
                device_id: !input remote
                type: action
                subtype: up_press_release
            timeout: 
              milliseconds: !input double_click_delay
            continue_on_timeout: true
          - choose:
              - conditions: "{{ wait.trigger != none }}"
                sequence: !input up_double_press
              - conditions: "{{ wait.trigger == none }}"
                sequence: !input up_single_press
      - conditions: "{{ trigger.id == 'up_hold' }}"
        sequence: !input up_hold

      # --- DOWN BUTTON LOGIC ---
      - conditions: "{{ trigger.id == 'down_press' }}"
        sequence:
          - wait_for_trigger:
              - platform: device
                domain: mqtt
                device_id: !input remote
                type: action
                subtype: down_press_release
            timeout: 
              milliseconds: !input double_click_delay
            continue_on_timeout: true
          - choose:
              - conditions: "{{ wait.trigger != none }}"
                sequence: !input down_double_press
              - conditions: "{{ wait.trigger == none }}"
                sequence: !input down_single_press
      - conditions: "{{ trigger.id == 'down_hold' }}"
        sequence: !input down_hold

      # --- BOTTOM BUTTON LOGIC ---
      - conditions: "{{ trigger.id == 'off_press' }}"
        sequence:
          - wait_for_trigger:
              - platform: device
                domain: mqtt
                device_id: !input remote
                type: action
                subtype: off_press_release
            timeout: 
              milliseconds: !input double_click_delay
            continue_on_timeout: true
          - choose:
              - conditions: "{{ wait.trigger != none }}"
                sequence: !input off_double_press
              - conditions: "{{ wait.trigger == none }}"
                sequence: !input off_single_press
      - conditions: "{{ trigger.id == 'off_hold' }}"
        sequence: !input off_hold

:light_bulb: How to use

  1. Import the blueprint or copy the code to blueprints/automation/your_file.yaml.
  2. Reload Automations.
  3. Create a new automation and select Ultimate Hue Controller.
  4. Pick your Device (Philips Hue Remote) from the dropdown.
  5. Assign your actions!

:wrench: Pro-Tip for Smooth Dimming

If you want smooth dimming when holding the Up/Down buttons, don’t just use light.turn_on. Instead, map the Hold action to brightness_step_pct.

  • Up - Hold: brightness_step_pct: 20
  • Down - Hold: brightness_step_pct: -20

This allows you to press and hold to step the brightness up or down significantly.


Enjoy! Let me know if you run into any issues with Double Clicks or Z2M versions.

2 Likes

Thanks for this blueprint!

I’m not really sure how you can setup the dimming from the pro-tip. Can you show an example or screenshot?

In case you didn’t figure it out, or for anyone else. You do still use light.turn_on, but instead of enabling the colour or temperature or brightness like normal, leave those all disabled and enable only brightness step and give it some value like 10 or -10.

2 Likes

Thank you, this blueprint is pretty convenient, i hope this holds long.
just another question - is there a way to set the light temperature also via the upper button? this cannot be chosen in the blueprint. i’ve tried with the help of gemini to create the code, but then the bulbs (ikea tradfri) are crashing …
thanks,

It appears using the UI you can’t increment temperature. Would have to find another way to obtain the current temp, increment it, then call the light on and pass the new temp.

Hello, really enjoying this blueprint for my main remote, just tried to setup a second z2m remote with it though and I’m having some issues.

The remote for my bedroom doesnt show as an option. It is connected via zigbee and working fine.

My working remote is exactly the same model and firmware as the bedroom hue remote, However the bedroom hue remote doesnt appear to as an option in the blueprint when I try to amend the existing automation, or when I start a new automation.

Working automation:

New automation:

I can see the device trigger events being captured, and can create manual automations for the triggers.

Both devices do show up in the MQTT integration

Any help would be appreciated, I did this in the middle of an evening before going to bed… a big song and dance trying to turn off my lamps without any button! :slight_smile:

Further update, something strange happening.

This is my existing blueprint, if I remove this device… I can no longer re-add it.

I havent saved, and the blueprint automation continues to work.

Is there a way I can get the remote ID?

I’m not sure if anybody else is experiencing this, but today this blueprint seems to stop recognising a single press on the Philips Hue Dimmer Switch, instead registering the single button presses as double presses. Has anybody else experienced this?

EDIT: @1mvdb it seems that updating Mosquitto broker from 6.5.2 to 7.0.0 causes this behaviour as that was the only thing I updated since yesterday. Rolling back to 6.5.2 fixed my automations using this blueprint, so something in 7.0.0 seems to be breaking this.

I had a similar issue, none of my remotes appeared in the list of devices when creating the automation. The issue is that the blueprint uses a strict model filter. I fixed it by editing the selector in the blueprint yaml. The original yaml file uses Hue dimmer switch as model, but the model definition in HA’s devices for my remotes is Hue dimmer switch gen 2. So I changed the selector in the yaml file like this and now it works:

      selector:
        device:
          integration: mqtt
          manufacturer: Philips
          model: Hue dimmer switch gen 2
          multiple: false
1 Like

Seems to work fine here. I’m using z2m 2.9.2 and Mosquito broker 7.0.1.

Same issue here since Mosquitto 7.0.0. Persists on 7.1.0. Every interaction with the Hue dimmer switch gen 1 is registered as a double-press. I adjusted the blueprint’s device selector to enable support for these models, which worked until version 6.5.2. Since @dasku11 reports that Gen 2 is working correctly, this may be an issue specific to the Gen 1 model.

@raspberrycoulis Which model are your switches?

Sorry for the delay, didn’t get a notification. My dimmers are gen 1 I think. Button presses don’t seem to be differentiating the button presses correctly - often sees them as double presses as pressing the button once, triggers the scene I had configured for the double press.

I have similar issue. I've tried to set model to Hue dimmer switch gen 1 but it doesn't work.
Mosquitto broker : 7.1.0
Z2M : 2.10.1