Philips Hue Dimmer Switch v2 (Zigbee2MQTT)

Wow, does just what I want, thanks :grinning:

thanks for the Blueprint and explanation about the helper.
Currently, the helper correctly recognizes all the state changes/button presses, however the automation itself doesn’t seem to ever get past the condition section, result for this is always false:

condition: template value_template: '{{ trigger.event.data.new_state.state not in ("", "None") }}'

And so none of the configured actions take place. Any ideas?

Do you use the supported switch via z2m integration? It looks like events are not delivered correctly for some reason.

I’m new to HA and zmqtt and stuff. I understand how to create basic automation and use with blueprint, but here I’m a bit lost. It doesn’t work bc I didn’t do the text helper stuff, can someone help me with that ? I absolutely don’t know what it is, and how to use it.

Thanks in advance, and thanks a lot for the blueprint.

I just found the helpers in HA, I read too fast, my bad, but I’m still not sure what to put into it (since imgur image no longer exists).

The link was broken, I edited that comment and added the image.

1 Like

Hi, thanks a lot, it seems to work now. I have a question though, is it possible to have toggle for scene with Hue Button like in the original one ?

I want to be able to just click Hue Button and it switch to next scene. And if I have for instance 4 scenes, when I’m at the fourth scene, when tapping the Hue Button it will switch to first scene.

I’m not sure how to do this, or if it’s possible.

Thanks for your time.

You might want to google for the solution, for example, check this thread.

1 Like
My setup:
Raspberry Pi 4B+ 4GB
Core: 2024.1.2
Supervisor: 2023.12.0
Operating System: 11.3
Frontend: 20240104.0
Zigbee2MQTT: 1.35.1-1
Mosquitto Brocker: 6.4.0
ITead Sonoff Zigbee 3.0 Dongle-P: Firmware 20230507
Philips Hue Dimmer Switch Modell: RWL022
Philips Hue Dimmer Switch Firmeware: 2.45.2_hF4400CA

Dear Serge

I do have a problem with setting up your blueprint.
I followed your description but in the trace screen of the automation I get only this error message.

Error: UndefinedError: 'dict object' has no attribute 'event'

And the step config says:

variables:
  helper_last_controller_event: input_text.philips_hue_dial_switch_last_pressed
  command: '{{ trigger.event.data.new_state.state }}'
  prev_command: '{{ states(helper_last_controller_event) }}'

As possible “sensors” I can only choose from thoese:

sensor.philips_hue_dimmer_switch_zigbee2matt_battery
sensor.philips_hue_dimmer_switch_linkquality
sensor.philips_hue_dial_switch_zigbee2mqtt_action_time

My config looks like this:

mode: restart
max_exceeded: silent
trigger:
  - platform: event
    event_type: state_changed
    event_data:
      entity_id: sensor.philips_hue_dial_switch_zigbee2mqtt_action_time
condition:
  - condition: template
    value_template: '{{ trigger.event.data.new_state.state not in ("", "None") }}'
action:
  - variables:
      helper_last_controller_event: input_text.philips_hue_dial_switch_last_pressed
      command: '{{ trigger.event.data.new_state.state }}'
      prev_command: '{{ states(helper_last_controller_event) }}'
  - service: input_text.set_value
    data:
      entity_id: input_text.philips_hue_dial_switch_last_pressed
      value: '{{ command }}'
  - choose:
      - conditions:
          - '{{ command == "on_press" }}'
        sequence:
          - service: scene.turn_on
            metadata: {}
            target:
              entity_id: scene.kueche_licht_ein
      - conditions:
          - '{{ command == "on_press_release" }}'
        sequence: []
      - conditions:
          - '{{ command == "on_hold" }}'
        sequence: []
      - conditions:
          - '{{ command == "on_hold_release" }}'
        sequence: []
      - conditions:
          - '{{ command == "up_press" }}'
        sequence: []
      - conditions:
          - '{{ command == "up_press_release" }}'
        sequence: []
      - conditions:
          - '{{ command == "up_hold" }}'
        sequence: []
      - conditions:
          - '{{ command == "up_hold_release" }}'
        sequence: []
      - conditions:
          - '{{ command == "down_press" }}'
        sequence: []
      - conditions:
          - '{{ command == "down_press_release" }}'
        sequence: []
      - conditions:
          - '{{ command == "down_hold" }}'
        sequence: []
      - conditions:
          - '{{ command == "down_hold_release" }}'
        sequence: []
      - conditions:
          - '{{ command == "off_press" }}'
        sequence: []
      - conditions:
          - '{{ command == "off_press_release" }}'
        sequence: []
      - conditions:
          - '{{ command == "off_hold" }}'
        sequence: []
      - conditions:
          - '{{ command == "off_hold_release" }}'
        sequence: []
  - choose:
      - conditions:
          - '{{ command == "on_hold" and prev_command == "on_press" }}'
        sequence:
          - service: scene.turn_on
            metadata: {}
            target:
              entity_id: scene.kueche_licht_aus
      - conditions:
          - '{{ command == "up_hold" and prev_command == "up_press" }}'
        sequence: []
      - conditions:
          - '{{ command == "down_hold" and prev_command == "down_press" }}'
        sequence: []
      - conditions:
          - '{{ command == "off_hold" and prev_command == "off_press" }}'
        sequence: []
id: '1704654875271'
alias: Philips Hue Dimmer switch v2 (Zigbee2MQTT)
description: ''

Thank you for your feedback.
Kind regards
Thomas

That is weird that your devices do not expose the _action entity.

All my dimmers have those, for example:

sensor.bedroom_hue_dimmer_action

@thotha - Looks like your dimmer switch is not exactly the “Philips Hue Dimmer Switch v2” as indicated in the subject of this thread. Your’s dimmer got a dial, so that’s a different model.

As you can see, it‘s the model of this conversation.

Ok, so where should I search fir a solution?
In/for Zigbee2MQTT, MQTT, Mosqitto Brocker, Home Assistant Core, Hassio, Sonoff Stick?

After search the internet with this search one of the first results is this one and close to the bottom I did find the solution to this problem.
I do not know with which update within the last few days this happened but suddenly the mentioned setting legacy triggers was disabled.
Maybe you could mention somewhere that if a user as problems with your blueprint, he should check that setting within Zigbee2MQTT.

Sorry for this trouble.

1 Like

Bit confused, does this reprogram the buttons just like Switch Manager, and can it also support RWL021?

It’s a blueprint so that you can create an automation and specify different actions for different buttons and press types.

It may work with RWL021 as the action names look compatible, but I didn’t test it.

This blueprint is perfect for my needs! :grinning:

Recently, I added a new automation to the blueprint and selected my light group. However, I have noticed a slight delay of around 1 second when I toggle the light and it turns on. But when I toggle it again and the light turns off, there is no delay. I wonder if anyone knows how I can change the delay only when the light turns off, so it matches the same delay as when the light goes on.

Thank you.

Thanks for this blueprint - works perfectly within areas or specific lights.
But I don’t understand why the dimming is not supported.
I tried to use “UP Button hold” to let the lights go up in 10% steps.
Tried to change the brightness_pct which didn’t work.

But changing it via yaml editor did not work:

service: light.toggle
metadata: {}
data:
  brightness_step_pct: 10
  transition: 1
target:
  area_id: kuche

Why is that not supported and how can I achieve this?

THX!

You probably need to use light.turn_on service instead of the toggle.

I’m trying to hunt down a hue dimmer switch v1 blueprint, if anyone has one?