Philips Hue Tap Dial Switch - ZHA

Is there someone who can explain me how to change this blueprint to function with Z2M integration?

I’ve only tested with lights and switches. If scenes respond to the home_assistant.turn_on and home_assistant.turn_off services then turning on and off should work. But I doubt the diming would work as the light service specifically is called for that.

@victorhooi has a few posts in here working on Z2M with this.

Hi there.

I just got this tap dial switch and it works with switching lights on off.
However i would like to use the dial for controlling the volume level.
Is that possible? I don’t know how to edit the blueprint so i can use the switches for lights and controlling the volume level. Just a noob. Did some one already made such thing working?
Just controlling my volume with the dial seems impossible for me.

You would want to change the part that handles the dial spin which would be this part

      - conditions:
          - "{{ command == 'step_with_on_off' }}"
          - "{{ step_mode == 'StepMode.Up' }}"
        sequence:
          - choose:
              - conditions: "{{ current_light != none }}"
                sequence:
                  - service: light.turn_on
                    target: "{{ lights[states(current_light)] }}"
                    data:
                      brightness_step_pct: "{{ step_size * dim_scale }}"
                      transition: 1
            default:
              - service: light.turn_on
                target: !input "first_light"
                data:
                  brightness_step_pct: "{{ step_size * dim_scale }}"
                  transition: 1
      - conditions:
          - "{{ command == 'step_with_on_off' }}"
          - "{{ step_mode == 'StepMode.Down' }}"
        sequence:
          - choose:
              - conditions: "{{ current_light != none }}"
                sequence:
                  - service: light.turn_on
                    target: "{{ lights[states(current_light)] }}"
                    data:
                      brightness_step_pct: "{{ -step_size * dim_scale }}"
                      transition: 1
            default:
              - service: light.turn_on
                target: !input "first_light"
                data:
                  brightness_step_pct: "{{ -step_size * dim_scale }}"
                  transition: 1

Instead of calling the light service you would want to call the media’s volume service.

Thnx. but cant get it to work.
The blueprint seems fine in file editor but when i make an automation it says not al valid value for dictionary value.

I also tried to delete all the lights in the blueprint and only put in the dial program.
4 hours later and no succes.

What i did get to work is making a zha_events trigger and control the volume.
It does work with all zigbee events so i do need to get te conditions right.
Does anyone knows how to filter out ZHA_events by its parameters and conditions?

UPDATE:

Thank you for inspiring me to make my first and own blueprint!
Never got it working without your blueprint.

Philips HUE Dial Switch - Control actions and volume of your media player - Blueprints Exchange - Home Assistant Community (home-assistant.io)

hi all.
would anybody be able to help - i would like to use this blueprint but to control only one light with each button linked to one colour.
in other words, i would like first button to turn a light blue, second button the same light but green, etc.
I would also like the “Current Light” to adjust the brightness of the chosen colour.

any idea how i could accomplish that?

You wouldn’t be able to do that with this blueprint as it is. But you could modify the blueprint to take actions instead of just lights. Then you could setup those actions to be turning on the light with a colour.

Thanks @apollo1220
could you point me in the right direction how to modify the blueprint? I know how to access the blueprint but what should I modify?

You would need to replace the light selectors with action selectors, something like

    press_action:
      name: Press Action
      description: Action to perform on Press.
      default: []
      selector:
        action: {}

Then to use the actions, something like this

- choose:
  - conditions:
    - condition: template
      value_template: '{{ trigger.event.data.command == "single" }}'
    sequence: !input 'press_action'

Those examples are copied out of one of my other blueprints, so don’t expect them to directly relate to this blueprint

Thanks @apollo1220
I unfortunately couldn’t get this to work.
Any chance I could ask you to help me with this in exchange for some coffees or a donation of some kind?

You’d want to do something like this

blueprint:
  name: Philips Tap Dial Switch - Actions
  description: ''
  domain: automation
  input:
    remote:
      name: Philips Hue Tap Switch
      selector:
        device:
          integration: zha
          manufacturer: Signify Netherlands B.V.
          model: RDM002
    first_action:
      name: First Button
      description: Action to perform on Press.
      default: []
      selector:
        action: {}
    second_action:
      name: (OPTIONAL) Second Button
      description: Action to perform on Press.
      default: []
      selector:
        action: {}
    third_action:
      name: (OPTIONAL) Third Button
      description: Action to perform on Press.
      default: []
      selector:
        action: {}
    forth_action:
      name: (OPTIONAL) Forth Button
      description: Action to perform on Press.
      default: []
      selector:
        action: {}
    dimming_light:
      name: (OPTIONAL) Dimming Light
      description: Light to be dimmed by turning dial.
      default:
      selector:
        entity:
          domain: light
    dim_scale:
      name: Diming Scale
      description: Scale factor for the dimming. This value will be multiplied by the value given from the dial. So lower number, more gradual dimming. Larger number, faster dimming.
      default: 1.0
      selector:
        number:
          min: 0.0
          max: 5.0
          step: 0.01
mode: restart
max_exceeded: silent
variables:
  first_action: !input "first_action"
  second_action: !input "second_action"
  third_action: !input "third_action"
  forth_action: !input "forth_action"
  dimming_light: !input "dimming_light"
  dim_scale: !input "dim_scale"
trigger:
  - platform: event
    event_type: zha_event
    event_data:
      device_id: !input "remote"
action:
  - variables:
      command: "{{ trigger.event.data.command }}"
      args: "{{ trigger.event.data.args }}"
      params: "{{ trigger.event.data.params }}"
      scene: "{{ trigger.event.data.params.scene_id }}"
      step_mode: "{{ trigger.event.data.params.step_mode }}"
      step_size: "{{ trigger.event.data.params.step_size }}"
  - choose:
      - conditions:
          - "{{ command == 'recall' }}"
          - "{{ scene == 1 }}"
        sequence: !input 'first_action'
      - conditions:
          - "{{ command == 'recall' }}"
          - "{{ second_action != none }}"
          - "{{ scene == 0 }}"
        sequence: !input 'second_action'
      - conditions:
          - "{{ command == 'recall' }}"
          - "{{ third_action != none }}"
          - "{{ scene == 5 }}"
        sequence: !input 'third_action'
      - conditions:
          - "{{ command == 'recall' }}"
          - "{{ forth_action != none }}"
          - "{{ scene == 4 }}"
        sequence: !input 'forth_action'
      - conditions:
          - "{{ command == 'step_with_on_off' }}"
          - "{{ step_mode == 'StepMode.Up' }}"
          - "{{ dimming_light != none }}"
        sequence:
          - service: light.turn_on
            target:
              entity_id: !input 'dimming_light'
            data:
              brightness_step_pct: "{{ step_size * dim_scale }}"
              transition: 1
      - conditions:
          - "{{ command == 'step_with_on_off' }}"
          - "{{ step_mode == 'StepMode.Down' }}"
          - "{{ dimming_light != none }}"
        sequence:
          - service: light.turn_on
            target:
              entity_id: !input 'dimming_light'
            data:
              brightness_step_pct: "{{ -step_size * dim_scale }}"
              transition: 1

@apollo1220 Thank you very very much! this looks like it will work perfectly (im not home this weekend but will try when home).

Do you have a buy me a coffee account or something for a small token of thanks?

No I don’t. Don’t worry about it

@apollo1220 thanks a lot for this blueprint! I slightly adjusted it to suit my situation, only the first 3 buttons turn on a light, while the fourth button turns off the light selected previously. I removed the toggle option. I couldn’t achieve this without your blueprint. Thanks!

I am still struggling with one thing, hope you can help. I don’t want to turn off the selected light when dimming. If it reaches 1% it should be the final position. Should this be more of a condition? Maybe adding - '{{ state_attr('current_light, 'brightness') => 1) ?

I am not experienced with coding and try to do my best, but I am more lucky than skilled I guess.

Would this be the right way?:

  - conditions:
    - '{{ command == ''step_with_on_off'' }}'
    - '{{ step_mode == ''StepMode.Down'' }}'
    sequence:
    - choose:
      - conditions: 
        - '{{ current_light != none }}'
        - '{{ state_attr('current_light, 'brightness') => 1)' 
      sequence:
        - service: light.turn_on
          target: '{{ lights[states(current_light)] }}'
          data:
            brightness_step_pct: '{{ -step_size * dim_scale }}'
            transition: 1
      default:
      - service: light.turn_on
        target: !input first_light
        data:
          brightness_step_pct: '{{ -step_size * dim_scale }}'
          transition: 1

The part where the lights don’t turn off is also what I would like to see.

You are on the right track with checking the current brightness level. But due to the step_size and dim_scale, you need to take those into account in the comparison as well instead of just comparing against 1.

Hi there,

nice blueprint! How can I make adjustment to the initial values for transition, brightness_pct and color_temp_kelvin of the button setup?

I tried adding respective entries as follows in the data part. After refreshing the according automation I didn’t receive any error. Yet, using the button the newly added settings are being ignored.

Here’s the snippet of the changed first-button-section:

  - conditions:
    - '{{ command == ''recall'' }}'
    - '{{ scene == 1 }}'
    sequence:
    - service: homeassistant.toggle
      target: !input first_light
    - choose:
      - conditions: '{{ current_light != none }}'
        sequence:
        - service: input_text.set_value
          target:
            entity_id: !input current_light
          data:
            value: first_light
            transition: 2.0
            brightness_pct: 75
            color_temp_kelvin: 4000

The service being called there is input_text.set_value so that won’t have any effect on the light. You would be looking to replace the service call to homeassistant.toggle with a call to light.turn_on and passing that extra data to that service call.

- conditions:
    - '{{ command == ''recall'' }}'
    - '{{ scene == 1 }}'
    sequence:
    - service: light.turn_on
      target: !input first_light
      data:
          transition: 2.0
          brightness_pct: 75
          color_temp_kelvin: 4000
    - choose:
      - conditions: '{{ current_light != none }}'
        sequence:
        - service: input_text.set_value
          target:
            entity_id: !input current_light
          data:
            value: first_light

Something like that

I edited your example here (without trying it) so some syntax might be a little off.

Hello Jeremy, thanks a bunch - that did the trick for me :partying_face: