ZHA - Philips Hue Dial Switch with custom button actions

Based on the Blueprint by @apollo1220


Control brightness of a single light by rotating the dial.

Create custom actions for any of four buttons.

The buttons currently only support single click.

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


blueprint:
  name: Philips Tap Dial Switch
  description: 'Control brightness of one light with the dial on a Philips Hue Tap Switch. Use the four buttons
    to assign your own actions.'
  source_url: https://github.com/nnmalex/ha-blueprints/blob/3caff790c415e9e2ae84f58ef77e84a43fc52992/philips_tap_dial_switch.yaml
  domain: automation
  input:
    remote:
      name: Philips Hue Tap Switch
      selector:
        device:
          integration: zha
          manufacturer: Signify Netherlands B.V.
          model: RDM002
          multiple: false
    dimmable_light:
      name: Dimmable Light
      description: The light to be controlled with the dial
      selector:
        target:
          entity:
            domain: light
    button_1_press:
      name: Button 1 Press
      description: Action to run in a single press of button 1
      default: []
      selector:
        action: {}
    button_2_press:
      name: Button 2 Press
      description: Action to run in a single press of button 2
      default: []
      selector:
        action: {}
    button_3_press:
      name: Button 3 Press
      description: Action to run in a single press of button 3
      default: []
      selector:
        action: {}
    button_4_press:
      name: Button 4 Press
      description: Action to run in a single press of button 4
      default: []
      selector:
        action: {}

mode: restart
max_exceeded: silent

variables:
  event: '{{ trigger.event.data.command }}'
  scene: "{{ trigger.event.data.args[1] }}"
  step_mode: "{{ trigger.event.data.params.step_mode }}"
  step_size: "{{ trigger.event.data.params.step_size }}"

trigger:
- platform: event
  event_type: zha_event
  event_data:
    device_id: !input remote
action:
  - choose:
    # Dial rotatation
    - conditions:
      - '{{ event == "step_with_on_off" }}'
      - '{{ step_mode == "StepMode.Up" }}'
      sequence:
        - service: light.turn_on
          target: !input dimmable_light
          data:
            brightness_step_pct: '{{ step_size }}'
            transition: 1
    - conditions:
      - '{{ event == "step_with_on_off" }}'
      - '{{ step_mode == "StepMode.Down" }}'
      sequence:
        - service: light.turn_on
          target: !input dimmable_light
          data:
            brightness_step_pct: '{{ -step_size }}'
            transition: 1
    # Buttons
    - conditions:
      - '{{ event == "recall" }}'
      - '{{ scene == 1 }}'
      sequence: !input button_1_press
    - conditions:
      - '{{ event == "recall" }}'
      - '{{ scene == 0 }}'
      sequence: !input button_2_press
    - conditions:
      - '{{ event == "recall" }}'
      - '{{ scene == 5 }}'
      sequence: !input button_3_press
    - conditions:
      - '{{ event == "recall" }}'
      - '{{ scene == 4 }}'
      sequence: !input button_4_press
4 Likes

Hi. Is there a way to add action also to dial to clockwise and counterclockwise? Thanks.

That’s what StepMode.Up and StepMode.Down are - one is a left wheel ‘click’, the other is a right one.

Not sure which is Left versus Right (I’m using NodeRED as opposed to this Blueprint), but a quick experiment could determine that for you!

Thank you for the blueprint.
I did edit out the wheel, so i can control the volume of my sonos with the buttons now.
And it works great.

I am now looking to make a blueprint just for the wheel and control the volume with the wheel and not buttons. Will post it when it works. For now i am happy with you blueprint and controle the volume ofset with the buttons. Dont have to walk to my sonon anymore or taking my phone out :slight_smile:

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)