Philips Hue Tap Dial Switch - Zigbee2MQTT

Github Gist: philips_hue_tap_dial_switch_zigbee2mqtt_actions_blueprint · GitHub

Importing

Click the badge to import this Blueprint: (needs Home Assistant Core 2021.3 or higher)

Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

Or import this Blueprint by using the Gist URL.

Main features

Use one of the 4 buttons on the dial switch, or the rotating dial to run self-defined actions.
The blueprint supports all the events that Zigbee2MQTT detects.
For instance:

  • Single press, press release, hold and hold release for all 4 buttons.
  • Dial rotations for both directions, either a small step, a slow turn or a fast turn.

Since the actions are fully self configurable, you could control any amount of entities you like in any way you like.

Prerequisites

You need to use Zigbee2MQTT for this blueprint.

Example automation YAML for controlling a light and its brightness:

(This example only uses one of the 4 buttons)

automation:
  - id: 'hue_tap_dial_switch_bedroom_bed_actions'
    alias: Hue tap dial switch bedroom bed actions
    use_blueprint:
      path: freakshock88/philips_hue_tap_dial_switch_zigbee2mqtt_actions_blueprint.yaml
      input:
        button_sensor: sensor.bedroom_bed_tap_dial_switch_action
        remote_button_1_single_press:
        - type: toggle
          device_id: 864040e72b901146e5a8abf57a5fd3d8
          entity_id: light.bedroom_ceiling_lights
          domain: light
        remote_dial_rotate_left_step:
          - service: light.turn_on
            data:
              entity_id: light.bedroom_ceiling_lights
              brightness_step_pct: -5
        remote_dial_rotate_left_slow:
          - service: light.turn_on
            data:
              entity_id: light.bedroom_ceiling_lights
              brightness_step_pct: -10
        remote_dial_rotate_left_fast:
          - service: light.turn_on
            data:
              entity_id: light.bedroom_ceiling_lights
              brightness_step_pct: -20
        remote_dial_rotate_right_step:
          - service: light.turn_on
            data:
              entity_id: light.bedroom_ceiling_lights
              brightness_step_pct: 5
        remote_dial_rotate_right_slow:
          - service: light.turn_on
            data:
              entity_id: light.bedroom_ceiling_lights
              brightness_step_pct: 10
        remote_dial_rotate_right_fast:
          - service: light.turn_on
            data:
              entity_id: light.bedroom_ceiling_lights
              brightness_step_pct: 20

Changelog

  • 2022-09-16: Initial version

I have not tested this blueprint extensively yet, but I have confirmed all actions work.
If you have any issues or questions, please let me know :slight_smile:

13 Likes

Hi i downloaded you blueprint. And it works so far. i was wondering if you know how to adress the dial to a lightblub witch has on/off dimming and Temperature?

Thanx so far for you work.

In my example code you see an action which changes the brightness percent of a light by turning the dial. I guess you could do the same for temperature. Of of the button could switch between ‘toggle brightness mode’ and ‘toggle temperature mode’ This mode could be stored in an input_select for instance.

Hello, I downloaded your great blueprint and played a bit around. Sadly i could not achieve the result I was looking for. I would so happy if someone could help me. I am new to the home assistant world and therefore i don´t know so much about yaml code…

Aim:

  1. Toggle 4 different light groups with the 4 buttons (works)
  2. dimming all 4 lightgroops with the dail if light are turned on (doesn´t wotk)

I managed to implement the dimming function through this code:


parallel:
  - if:
      - condition: state
        entity_id: light.light_bedroom_ceiling
        state: "on"
    then:
      - device_id: ea370f7f32e7c8865d33844a235efb00
        domain: light
        entity_id: light.light_bedroom_ceiling
        type: brightness_decrease
  - if:
      - condition: state
        entity_id: light.light_bedroom_officedesk
        state: "on"
    then:
      - device_id: ea370f7f32e7c8865d33844a235efb00
        domain: light
        entity_id: light.light_bedroom_officedesk
        type: brightness_decrease
  - if:
      - condition: state
        entity_id: light.light_livingroom_ceiling
        state: "on"
    then:
      - device_id: ea370f7f32e7c8865d33844a235efb00
        domain: light
        entity_id: light.light_livingroom_ceiling
        type: brightness_decrease
  - if:
      - condition: state
        entity_id: light.light_kitchen
        state: "on"
    then:
      - device_id: ea370f7f32e7c8865d33844a235efb00
        domain: light
        entity_id: light.light_kitchen
        type: brightness_decrease


Sadly i can´t controll the dimming steps and therefore dimmingtransistion isn´t smooth. Also i would like to use a different yamlcode, which only dimms the last lightgroup that was turned on, when the dial is turned (but this ist not so important).

Thanks for your help!

1 Like

What you want is quite advanced and beyond the scope of this blueprint but…

Have you tried to use the service calls in my example?
So e.g. something like this:

parallel:
  - if:
      - condition: state
        entity_id: light.light_bedroom_ceiling
        state: "on"
    then:
       - service: light.turn_on
         data:
           entity_id: light.light_bedroom_ceiling
           brightness_step_pct: -20

Hi. Many thanks for your blueprint! Is it possible to set a minimum brightness? I’m dimming my kitchen lights with a Sunricher Phasecut-Dimmer and have set a minimum brightness through the dimmer (which works with the push switches) but the Hue Tap Dial reduces brightness to 0.

“light.turn.on” in the automation offers a “brightness” value but has no impact on dimming down to 0. Thanks for your help!

Sure that’s possible, but you have to write the logic for that yourself.
The scope of this blueprint is purely to make it easy to have a certain button press to an action.
You could for instance define a script that runs based on turning the dial left.
The script then only dials down the brightness until a minimum is reached.
So you can perform any action you want with this blueprint, but you have to implement the logic for it yourself. It is thus a very ‘shallow’ and generic blueprint.

Thank you, that solved the problem with the dimming. I didn´t think this would work, becouse normaly this turns the lightbulb on, if the dail is turned (what i dont want). But with the If condition that the bulb has to be on so that this works ^^. I also found the solution for the dimming only one lamp.

parallel:
  - if:
      - condition: state
        entity_id: light.light_bedroom_ceiling
        state: "on"
      - condition: state
        entity_id: timer.timer_light_bedroom
        state: active
    then:
      - service: light.turn_on
        data:
          entity_id: light.light_bedroom_ceiling
          brightness_step_pct: -5

Just set a timer helper of 10s and it starts if one button is clicked. in this 10 sec you can adjust the light of one light group. Afterwards you can turn on another lightgroup + dimm it and the first lightgroups stays at the same brightness. Feel free to use it, if you want to :slight_smile:

Many thanks freakshock. I’m not used with scripts and automations in home assistant but I found the following solution via automation directly. Works for me as I don’t need/require to specify the dim speed for slow/fast rotating and don’t won’t to turn on light with the dial.

remote_dial_rotate_left_step:
      - if:
          - condition: numeric_state
            entity_id: light.licht_kuche_2
            attribute: brightness
            above: 20
        then:
          - device_id: 3bc2e563107fc86ed3d26c123f5a3476
            domain: light
            entity_id: light.licht_kuche_2
            type: brightness_decrease
        else:
          - stop: ""

How did you get the widget added to Zigbee2MQTT?

When I trie to add it to my Zigbee network I ge these error messages:

Debug Received Zigbee message from '0x001788010d12d123a', type 'commandQueryNextImageRequest', cluster 'genOta', data '{"fieldControl":0,"fileVersion":33569555,"imageType":289,"manufacturerCode":4107}' from endpoint 1 with groupID 0
Warning Received message from unsupported device with Zigbee model 'RDM002' and manufacturer name 'Signify Netherlands B.V.'

Any hints or maybe even a step-by-step-guide?

Press the small reset button under the battery cover and Z2M automatically recognizes the tap dial when joining is allowed. Mine was always displayed as “offline” - changing the name helped to get in “online”. Pairing with 100% functionality (battery level recognized, action (press on buttons) recognized) and the orange flashing when the reset button is pressed was only possible with the latest FW 2.59.25 (mine had 2.59.19 - I did an OTA update through Z2M in the OTA-tab. Took about 20 minutes. Remove the tap dial and pair again). I had to remove/pair again several times after FW upgrade to get it working properly - a hard reset with mine (pressing reset button for about 10-12 seconds until a green/red light appears) helped in my case. As soon as Z2M recognizes action (press button shows a string as action) the blueprint works like a charm. Hope this helps

Thanks @Robi07 - I’m still getting the same messages, even after doing a hard reset as you described.
What are your other Zigbee settings - these are mine:

pan_id: 6754
channel: 20

It reports as model ‘RDM002’ - hope it’s not a new version.

And it looks like without the dial being properly paired, I cannot do an OTA firmware update either :frowning:

I just realized that my Zigbee2MQTT add-on wasn’t up to date - I never got prompted to update beyond V1.18.1.
Following the instructions here got me updated to V1.28.2 and it’s all working fine now.

Thanks for the blueprint @freakshock

Thanks for posting your experience and tips @Robi07

I have managed to pair my device and upgrade the firmware to 2.59.25. But I cannot get the device to post any actions. Ant the battery level is showing just ?. I have availability disabled since I have a large number of devices. Not sure if that affects the functionality.

I have removed and repaired the device numerous times and restored it to factory settings multiple times.

Do you have any suggestions on what to do? Is your device still functioning correctly?

I have paired the same device with a separate Philips Hue installation and hub, and it works flawlessly.

It looks like I have faulty devices. Here is my situation with 3 devices:

#1 cannot pair at al. I did a full reset by pressing the setup button for 10 seconds, as I did with other devices. But this device still cannot pair. When I briefly press the reset button to initiate pairing, it quickly cycles through the LED indicator’s green, red, and orange colors.

#2 paired and upgraded firmware successfully but does not display battery level, and it is not publishing actions.

#3 works fine after upgrading and pairing.

I’ve only one device and it is still working flawlessly. But it took a lot time and nerves to get it run. My device started to work after the firmware upgrade and subsequent reset. Therefore unfortunately no more tips. However, the most stubborn part so far in my whole Z2M installation.

Some of these issues seem weird, indeed.
I have two of the TapDialSwitches and only one of them actually upgraded to the latest firmware version, the other one keeps checking without upgrading in Z2M :frowning:
This is the same for my 2 IKEA buttons btw - I put it down to the battery level; but I’m not replacing a battery that’s at 70% or more just to get a firmware update that didn’t seem to make a difference.

First off i want to thank you for providing the blueprint for the Tap Dial.
The Button configuration work perfectly and i have no problems whatsoever.
Unfortunately i am not able to get the hang of the dial movement in combination in increasing/decreasing the volume of a media_player device.
I use the Tap dial for remotely controlling a bath music speaker and have different spotify playlists on the single and long tap buttons. The dial just invites the user to turn up the volume, but here is my main problem.
As far as i can see it, Zigbee2MQTT receives the slow-rotate movement from the Tap Dial as an event following an " "-Action (i guess it’s a sign, that the dial movement has stopped).

Currently i am trying my luck with the following YAML-Konfiguration for the rotation:

      remote_dial_rotate_right_slow:
      - service: media_player.volume_set
        target:
          entity_id: media_player.spotify_xxxx
        data:
          volume_level: “{{ state_attr(‘media_player.spotify_xxxx’, ‘volume_level’) +0.02
            }}”
      - repeat:
          until:
          - condition: state
            entity_id: sensor.sw_bad_musik_action
            state: ''

First off, i’ll get a Log-Error: “template value should be a string for dictionary value @ data[‘action’][1][‘choose’][20][‘sequence’][0][‘data’]. Got None”, which is not there, when i comment only this button-configuration action out. So i guess there is something wrong here (even though i’ve configured this part through the Automation-UI.
When i’m rotating the Dial nothing happens (which i guess is expected).
Did i do something wrong, or were anyone able to get this working (with volumes, brightnesses, et cetera)?
Any help is greatly appreciated.
Thanks in advance!

Thanks for a great blueprint!

Requesting tip for implementing the scene rotation (for a Hue Zone) for each button click, just as in the Hue App. I have a idea on how to implement this with use of helpers in HA, but maybe there are some easier ways of solving it. For instance, I see that the Hue Zone is represented as light entity in HA, and it got attribute hue_scenes with all available scenes. But I can’t find what scene is currently active, so I can activate the next scene in the list when the button is pressed. Any tip on how this could be solved?