Philips Hue Tap Dial Switch - Zigbee2MQTT

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?

I’d like to add to that. How would you implement the following: With the 4 buttons you select the devices (e.g. lights) and with the dial you set the brightness / volume etc.?

Haven’t finalized the automations yet, but my approach is as follows:

  1. With a long press in each of the four buttons, I toggle the respective light on/off.
  2. A short press on each button simply ‘selects’ the light I want to dim by storing the number between 1 and 4 in a number helper - same light as for the toggle functionality of that button, of course.
  3. Based on the value of the helper number set in 2 a set of 4 automations triggers the correct light to dim when I turn the wheel (the other three automations that are based on the same trigger simply stop at the condition for the correct helper number). This could probably be set up with one automation and some if then selections in the automation, but as long as there’s no else if it gets all a little busy with multiple layers of if thens.

I tried to switch the short/long press functionalit for selection/toggling but figure out that a long press always seems to invoke the action for a short press at the same time.

1 Like

Did anyone found a solution yet, how to increase or decrease the volume of a media_player entity through the Dial?

Here’s the yaml code from the blueprint I use:

    remote_dial_rotate_left_step:
      - service: script.turn_on
        data: {}
        target:
          entity_id: script.allhome_volume_down
    remote_dial_rotate_left_slow:
      - repeat:
          count: 2
          sequence:
            - service: script.turn_on
              data: {}
              target:
                entity_id: script.allhome_volume_down
    remote_dial_rotate_left_fast:
      - repeat:
          count: 3
          sequence:
            - service: script.turn_on
              data: {}
              target:
                entity_id: script.allhome_volume_down
    remote_dial_rotate_right_step:
      - service: script.turn_on
        data: {}
        target:
          entity_id: script.allhome_volume_up
    remote_dial_rotate_right_slow:
      - repeat:
          count: 2
          sequence:
            - service: script.turn_on
              data: {}
              target:
                entity_id: script.allhome_volume_up
    remote_dial_rotate_right_fast:
      - repeat:
          count: 3
          sequence:
            - service: script.turn_on
              data: {}
              target:
                entity_id: script.allhome_volume_up
      - service: script.toggle_dr_high_bar
        data: {}

And here are the scripts that the actions are calling:

  1. For turning the volume down:
alias: AllHome Volume Down
sequence:
  - service: media_player.volume_set
    target:
      entity_id: media_player.allhome
    data_template:
      volume_level: "{{ state_attr('media_player.allhome', 'volume_level') - 0.02 }}"
mode: queued
icon: mdi:volume-minus
max: 5

and for turning the volume up:

sequence:
  - service: media_player.volume_set
    target:
      entity_id: media_player.allhome
    data_template:
      volume_level: "{{ state_attr('media_player.allhome', 'volume_level') + 0.04 }}"
mode: queued
alias: AllHome Volume Up
icon: mdi:volume-plus
max: 5

I use scripts because I have a few other automations that I use to turn the volume up or down.

By pressing one of the four buttons just before I turn the dial I can also invoke other actions, e.g. change the brightness of a smart light bulb.

Can you share this part with the helper and stuff?

Thanks for all the other parts you have shared.

1 Like

I copied this together from the blueprint and some scripts - hope you can make sense of it.

The helper called input_number.hue_tapdialswitch_02_selection holds the value which button has just been pushed.

Here is the part of the blueprint that toggles the entity or selects it for the volume/brightness to be adjusted:

alias: Hue TapDialSwitch 02 - Actions
description: ""
use_blueprint:
  path: freakshock88/philips_hue_tap_dial_switch_zigbee2mqtt_actions_blueprint.yaml
  input:
    button_sensor: sensor.hue_tapdialswitch_02_action
    remote_button_1_single_press:
      - service: input_number.set_value
        data:
          value: 1
        target:
          entity_id: input_number.hue_tapdialswitch_02_selection
        enabled: true
    remote_button_2_single_press:
      - service: input_number.set_value
        data:
          value: 2
        target:
          entity_id: input_number.hue_tapdialswitch_02_selection
        enabled: true
    remote_button_1_hold_release:
      - service: light.toggle
        data: {}
        target:
          entity_id:
            - light.patio_lights
    remote_button_2_hold_release:
      - service: media_player.toggle
        data: {}
        target:
          entity_id:
            - media_player.allhome

And this is the same piece as in my previous post, just for TapDialSwitch_02 instead of _01 - note the repeat (or lack thereof) for the ‘direction_step’, ‘direction_slow’ vs. ‘direction_fast’:

    remote_dial_rotate_right_step:
      - service: script.turn_on
        data: {}
        target:
          entity_id:
            - script.tapdialswitch_02_turn_up
    remote_dial_rotate_right_slow:
      - repeat:
          count: "2"
          sequence:
            - service: script.turn_on
              data: {}
              target:
                entity_id: script.tapdialswitch_02_turn_up
    remote_dial_rotate_right_fast:
      - repeat:
          count: "3"
          sequence:
            - service: script.turn_on
              data: {}
              target:
                entity_id: script.tapdialswitch_02_turn_up
    remote_dial_rotate_left_step:
      - service: script.turn_on
        data: {}
        target:
          entity_id:
            - script.tapdialswitch_02_turn_down
    remote_dial_rotate_left_slow:
      - repeat:
          count: "2"
          sequence:
            - service: script.turn_on
              data: {}
              target:
                entity_id: script.tapdialswitch_02_turn_down
    remote_dial_rotate_left_fast:
      - repeat:
          count: "3"
          sequence:
            - service: script.turn_on
              data: {}
              target:
                entity_id: script.tapdialswitch_02_turn_down

Here are the scripts that adjust either brightness or volume, depending on the helper value.

Increase brightness/volume:

alias: TapDialSwitch 02 - Turn Up
sequence:
  - if:
      - condition: state
        entity_id: input_number.hue_tapdialswitch_02_selection
        state: "1.0"
    then:
      - service: script.turn_on
        data: {}
        target:
          entity_id: script.patio_lights_brightness_up
    else:
      - service: script.turn_on
        data: {}
        target:
          entity_id: script.allhome_volume_up
mode: queued
max: 5

Decrease brightness/volume:

alias: TapDialSwitch 02 - Turn Down
sequence:
  - if:
      - condition: state
        entity_id: input_number.hue_tapdialswitch_02_selection
        state: "1.0"
    then:
      - service: script.turn_on
        data: {}
        target:
          entity_id:
            - script.patio_lights_brightness_down
    else:
      - service: script.turn_on
        data: {}
        target:
          entity_id:
            - script.allhome_volume_down
mode: queued
max: 5

I only have the need for switching/adjusting two entities, the light on button 1 for brightness and the allhome media player for on button 2 volume - I understand that this section would get much more complicated (with nested if-then-else code) if I needed more than two entities, i.e. wanted to use more than 2 buttons on the TapDialSwitch to invoke turning items up or down.

The scripts for the volume adjustment are in a previous post, the ones for brightness are below:

alias: Patio Lights Brightness Up
sequence:
  - service: light.turn_on
    data:
      brightness_step: 10
    target:
      entity_id:
        - light.patio_lights
mode: queued
icon: mdi:lightbulb-on-30
max: 5

alias: Patio Lights Brightness Down
sequence:
  - service: light.turn_on
    data:
      brightness_step: -10
    target:
      entity_id:
        - light.patio_lights
mode: queued
icon: mdi:lightbulb-on-30
max: 5

I’m sure there is massive room for improvement, but I’m happy that I got it to this point :wink:
Hope that helps.

Thanks for the guide. I think I can figure it out from here.