ZHA - Philips Hue Switch RWL022 (choose all buttons)

This is a blueprint for the Philips Hue Switch RWL022 for use with ZHA.
You can choose what to execute with single press, dubble press or hold.

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

blueprint:
  name: ZHA - Philips Hue Dimmer Switch RWL022
  description: |
    Choose what all four buttons will do.
  domain: automation
  input:
    remote:
      name: Remote
      description: Choose the remote
      selector:
        device:
          integration: zha
          manufacturer: Signify Netherlands B.V.
          entity:
            domain: sensor
            device_class: battery
    button_1_single_press:
      name: Button 1 (POWER) Single Press
      description: Action to run on single press
      default: []
      selector:
        action: {}
    button_1_long_press:
      name: Button 1 (POWER) Long Press
      description: Action to run on long press
      default: []
      selector:
        action: {}
    button_1_double_press:
      name: Button 1 (POWER) Double Press
      description: Action to run on double press
      default: []
      selector:
        action: {}
    button_2_single_press:
      name: Button 2 (BRIGHTNESS_UP) Single Press
      description: Action to run on single press
      default: []
      selector:
        action: {}
    button_2_long_press:
      name: Button 2 (BRIGHTNESS_UP) Long Press
      description: Action to run on long press
      default: []
      selector:
        action: {}
    button_2_double_press:
      name: Button 2 (BRIGHTNESS_UP) Double Press
      description: Action to run on double press
      default: []
      selector:
        action: {}
    button_3_single_press:
      name: Button 3 (BRIGHTNESS_DOWN) Single Press
      description: Action to run on single press
      default: []
      selector:
        action: {}
    button_3_long_press:
      name: Button 3 (BRIGHTNESS_DOWN) Long Press
      description: Action to run on long press
      default: []
      selector:
        action: {}
    button_3_double_press:
      name: Button 3 (BRIGHTNESS_DOWN) Double Press
      description: Action to run on double press
      default: []
      selector:
        action: {}
    button_4_single_press:
      name: Button 4 (HUE) Single Press
      description: Action to run on single press
      default: []
      selector:
        action: {}
    button_4_long_press:
      name: Button 4 (HUE) Long Press
      description: Action to run on long press
      default: []
      selector:
        action: {}
    button_4_double_press:
      name: Button 4 (HUE) Double Press
      description: Action to run on double press
      default: []
      selector:
        action: {}
mode: restart
max_exceeded: silent
trigger:
  - platform: event
    event_type: zha_event
    event_data:
      device_id: !input "remote"
action:
  - variables:
      command: "{{ trigger.event.data.command }}"
  - choose:
      - conditions:
          - "{{ command == 'on_short_release' }}"
        sequence: !input "button_1_single_press"
      - conditions:
          - "{{ command == 'on_hold' }}"
        sequence: !input "button_1_long_press"
      - conditions:
          - "{{ command == 'on_double_press' }}"
        sequence: !input "button_1_double_press"
      - conditions:
          - "{{ command == 'up_short_release' }}"
        sequence: !input "button_2_single_press"
      - conditions:
          - "{{ command == 'up_hold' }}"
        sequence: !input "button_2_long_press"
      - conditions:
          - "{{ command == 'up_double_press' }}"
        sequence: !input "button_2_double_press"
      - conditions:
          - "{{ command == 'down_short_release' }}"
        sequence: !input "button_3_single_press"
      - conditions:
          - "{{ command == 'down_hold' }}"
        sequence: !input "button_3_long_press"
      - conditions:
          - "{{ command == 'down_double_press' }}"
        sequence: !input "button_3_double_press"
      - conditions:
          - "{{ command == 'off_short_release' }}"
        sequence: !input "button_4_single_press"
      - conditions:
          - "{{ command == 'off_hold' }}"
        sequence: !input "button_4_long_press"
      - conditions:
          - "{{ command == 'off_double_press' }}"
        sequence: !input "button_4_double_press"
1 Like

This looks great! I posted my version earlier this week which I believe provides the same functionality and more since it also supports for 3x, 4x, and 5x button presses. I just wanted to link that here so people can have the option if they need that additional functionality.