ZHA - Philips Hue v2 Smart Dimmer Switch and Remote - RWL022

This is my first blueprint so please let me know if there are any problems or changes I should make to improve it.

Features

Basic blueprint to give you the ability to assign actions to all the types of button presses possible. Each of the four buttons (power, plus, minus, hue) have assignable actions for the following presses…

  • single press
  • double press
  • triple press
  • quadruple press
  • quintuple press
  • release (called after any press multiple)
  • hold (long press)
  • long release (called after any hold)

Requires

  • Zigbee coordinator/hub (tested with HUSBZB-1)
  • Zigbee Home Automation (ZHA) Integration
  • Philips Hue v2 Smart Dimmer Switch and Remote (RWL022)

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


I didn’t see a blueprint for this remote anywhere else that provided all the possible button presses available. There are still some actions I plan on adding in the future once I figure out how to decipher what is happening because it seems there are a few additional meta events this switch sends in addition to the straight forward button presses.


blueprint:
  domain: automation
  name: Philips Hue v2 Smart Dimmer Switch and Remote
  description: Philips Hue v2 Smart Dimmer Switch and Remote (RWL022) using Zigbee Home Automation
  input:
    zha_device:
      name: Philips Hue v2 Smart Dimmer Switch and Remote
      description: List of available Philips Hue v2 Smart Dimmer Switch and Remote devices
      selector:
        device:
          integration: zha
          model: RWL022
    Power_Press:
      name: Power Press
      description: Power button pressed
      default: []
      selector:
        action: null
    Power_Press2x:
      name: Power Press 2x
      description: Power button pressed 2x
      default: []
      selector:
        action: null
    Power_Press3x:
      name: Power Press 3x
      description: Power button pressed 3x
      default: []
      selector:
        action: null
    Power_Press4x:
      name: Power Press 4x
      description: Power button pressed 4x
      default: []
      selector:
        action: null
    Power_Press5x:
      name: Power Press 5x
      description: Power button pressed 5x
      default: []
      selector:
        action: null
    Power_Release:
      name: Power Release
      description: Power button released
      default: []
      selector:
        action: null
    Power_HoldPress:
      name: Power Hold
      description: Power button held down
      default: []
      selector:
        action: null
    Power_HoldRelease:
      name: Power Hold Release
      description: Power button released after held down
      default: []
      selector:
        action: null
    Up_Press:
      name: Up Press
      description: Up button pressed
      default: []
      selector:
        action: null
    Up_Press2x:
      name: Up Press 2x
      description: Up button pressed 2x
      default: []
      selector:
        action: null
    Up_Press3x:
      name: Up Press 3x
      description: Up button pressed 3x
      default: []
      selector:
        action: null
    Up_Press4x:
      name: Up Press 4x
      description: Up button pressed 4x
      default: []
      selector:
        action: null
    Up_Press5x:
      name: Up Press 5x
      description: Up button pressed 5x
      default: []
      selector:
        action: null
    Up_Release:
      name: Up Release
      description: Up button released
      default: []
      selector:
        action: null
    Up_HoldPress:
      name: Up Hold
      description: Up button held down
      default: []
      selector:
        action: null
    Up_HoldRelease:
      name: Up Hold Release
      description: Up button released after held down
      default: []
      selector:
        action: null
    Down_Press:
      name: Down Press
      description: Down button pressed
      default: []
      selector:
        action: null
    Down_Press2x:
      name: Down Press 2x
      description: Down button pressed 2x
      default: []
      selector:
        action: null
    Down_Press3x:
      name: Down Press 3x
      description: Down button pressed 3x
      default: []
      selector:
        action: null
    Down_Press4x:
      name: Down Press 4x
      description: Down button pressed 4x
      default: []
      selector:
        action: null
    Down_Press5x:
      name: Down Press 5x
      description: Down button pressed 5x
      default: []
      selector:
        action: null
    Down_Release:
      name: Down Release
      description: Down button released
      default: []
      selector:
        action: null
    Down_HoldPress:
      name: Down Hold
      description: Down button held down
      default: []
      selector:
        action: null
    Down_HoldRelease:
      name: Down Hold Release
      description: Down button released after held down
      default: []
      selector:
        action: null
    Hue_Press:
      name: Hue Press
      description: Hue button pressed
      default: []
      selector:
        action: null
    Hue_Press2x:
      name: Hue Press 2x
      description: Hue button pressed 2x
      default: []
      selector:
        action: null
    Hue_Press3x:
      name: Hue Press 3x
      description: Hue button pressed 3x
      default: []
      selector:
        action: null
    Hue_Press4x:
      name: Hue Press 4x
      description: Hue button pressed 4x
      default: []
      selector:
        action: null
    Hue_Press5x:
      name: Hue Press 5x
      description: Hue button pressed 5x
      default: []
      selector:
        action: null
    Hue_Release:
      name: Hue Release
      description: Hue button released
      default: []
      selector:
        action: null
    Hue_HoldPress:
      name: Hue Hold
      description: Hue button held down
      default: []
      selector:
        action: null
    Hue_HoldRelease:
      name: Hue Hold Release
      description: Hue button released after held down
      default: []
      selector:
        action: null
mode: single
max_exceeded: silent
variables:
  device_id: !input "zha_device"
trigger:
  - platform: event
    event_type: zha_event
condition: "{{ trigger.event.data.device_id == device_id }}"
action:
  - variables:
      button: "{{ trigger.event.data.args.button }}"
      press_type: "{{ trigger.event.data.args.press_type }}"
      command_type: "{{ trigger.event.data.command }}"
  - service: logbook.log
    data:
      name: Button
      message: "{{ button }}"
  - service: logbook.log
    data:
      name: Press Type
      message: "{{ press_type }}"
  - service: logbook.log
    data:
      name: Device
      message: "{{ zha_device }}"
  - service: logbook.log
    data:
      name: Command
      message: "{{ command_type }}"
  - choose:
      - conditions: '{{ command_type == "on_press" }}'
        sequence: !input "Power_Press"
      - conditions: '{{ command_type == "on_double_press" }}'
        sequence: !input "Power_Press2x"
      - conditions: '{{ command_type == "on_triple_press" }}'
        sequence: !input "Power_Press3x"
      - conditions: '{{ command_type == "on_quadruple_press" }}'
        sequence: !input "Power_Press4x"
      - conditions: '{{ command_type == "on_quintuple_press" }}'
        sequence: !input "Power_Press5x"
      - conditions: '{{ command_type == "on_short_release" }}'
        sequence: !input "Power_Release"
      - conditions: '{{ command_type == "on_hold" }}'
        sequence: !input "Power_HoldPress"
      - conditions: '{{ command_type == "on_long_release" }}'
        sequence: !input "Power_HoldRelease"

      - conditions: '{{ command_type == "up_press" }}'
        sequence: !input "Up_Press"
      - conditions: '{{ command_type == "up_double_press" }}'
        sequence: !input "Up_Press2x"
      - conditions: '{{ command_type == "up_triple_press" }}'
        sequence: !input "Up_Press3x"
      - conditions: '{{ command_type == "up_quadruple_press" }}'
        sequence: !input "Up_Press4x"
      - conditions: '{{ command_type == "up_quintuple_press" }}'
        sequence: !input "Up_Press5x"
      - conditions: '{{ command_type == "up_short_release" }}'
        sequence: !input "Up_Release"
      - conditions: '{{ command_type == "up_hold" }}'
        sequence: !input "Up_HoldPress"
      - conditions: '{{ command_type == "up_long_release" }}'
        sequence: !input "Up_HoldRelease"

      - conditions: '{{ command_type == "down_press" }}'
        sequence: !input "Down_Press"
      - conditions: '{{ command_type == "down_double_press" }}'
        sequence: !input "Down_Press2x"
      - conditions: '{{ command_type == "down_triple_press" }}'
        sequence: !input "Down_Press3x"
      - conditions: '{{ command_type == "down_quadruple_press" }}'
        sequence: !input "Down_Press4x"
      - conditions: '{{ command_type == "down_quintuple_press" }}'
        sequence: !input "Down_Press5x"
      - conditions: '{{ command_type == "down_short_release" }}'
        sequence: !input "Down_Release"
      - conditions: '{{ command_type == "down_hold" }}'
        sequence: !input "Down_HoldPress"
      - conditions: '{{ command_type == "down_long_release" }}'
        sequence: !input "Down_HoldRelease"

      - conditions: '{{ command_type == "off_press" }}'
        sequence: !input "Hue_Press"
      - conditions: '{{ command_type == "off_double_press" }}'
        sequence: !input "Hue_Press2x"
      - conditions: '{{ command_type == "off_triple_press" }}'
        sequence: !input "Hue_Press3x"
      - conditions: '{{ command_type == "off_quadruple_press" }}'
        sequence: !input "Hue_Press4x"
      - conditions: '{{ command_type == "off_quintuple_press" }}'
        sequence: !input "Hue_Press5x"
      - conditions: '{{ command_type == "off_short_release" }}'
        sequence: !input "Hue_Release"
      - conditions: '{{ command_type == "off_hold" }}'
        sequence: !input "Hue_HoldPress"
      - conditions: '{{ command_type == "off_long_release" }}'
        sequence: !input "Hue_HoldRelease"
15 Likes

Hey, good to see that I’m not the only one trying to get a RWL022 working with HA :slight_smile:

Did you also see/try this blueprint :

I’m currently checking it but until now no positive result…

Will also try your blueprint somewhere during the next couple of days…

1 Like

did already a small test…and wow! It’s working! :smiley:

Also checked the link I send you, but noticed it was not designed for the RWL022.

So…really great job! :+1:

Hi, I see my dimmer switch in the Hue devices but it not in the Blueprint. (it is the v2 model with “hue” at the bottom.

check the device info in HA.
It should mentioned RWL022

afbeelding

This is what I see.

Screenshot

are you using ZHA ??

Everything from Hue is connected via the Hue bridge.

Besides the hue bridge I have a zwave stick and rfxcom, so nothing else for zigbee.

Although it is not apparent from the description is the need for a Zigbee coordinator and ZHA integration?

Created the automatons manual instead of using the Blueprint script and everything is working.

Thanks for pointing that out – I edited the description to explicitly state the ZHA and coordinator requirements.

Looks more complicated but I like how they are supporting multiple integrations. Maybe I’ll consider that in the future if I have some spare time.

Glad you got it to work and at least someone else found it useful!

Awesome blueprint! I use it for my two RWL022 devices and it works great! Do you know if I can modify the blueprint in any way to get it working with my other two dimmer switches (old ones, RWL020/21)? As i would like to use the same functionality on those as well :slight_smile:

Could somebody help me? I am still getting this error:

Executed: 20 January 2022, 21:52:10
Error: UndefinedError: ‘dict object’ has no attribute ‘event’

Many thanks

Hi @Drhyde ,

Yes you can. Just modify the filter line to model: RWL020 and it should work. I’ve done that to my bunch of old ones.

just in case, my whole file is:

blueprint:
  domain: automation
  name: Philips Hue Smart Dimmer Switch and Remote
  description: Philips Hue Smart Dimmer Switch and Remote (RWL020) using Zigbee
    Home Automation
  input:
    zha_device:
      name: Philips Hue Smart Dimmer Switch and Remote
      description: List of available Philips Hue Smart Dimmer Switch and Remote
        devices
      selector:
        device:
          integration: zha
          model: RWL020
    Power_Press:
      name: Power Press
      description: Power button pressed
      default: []
      selector:
        action: {}
    Power_Press2x:
      name: Power Press 2x
      description: Power button pressed 2x
      default: []
      selector:
        action: {}
    Power_Press3x:
      name: Power Press 3x
      description: Power button pressed 3x
      default: []
      selector:
        action: {}
    Power_Press4x:
      name: Power Press 4x
      description: Power button pressed 4x
      default: []
      selector:
        action: {}
    Power_Press5x:
      name: Power Press 5x
      description: Power button pressed 5x
      default: []
      selector:
        action: {}
    Power_Release:
      name: Power Release
      description: Power button released
      default: []
      selector:
        action: {}
    Power_HoldPress:
      name: Power Hold
      description: Power button held down
      default: []
      selector:
        action: {}
    Power_HoldRelease:
      name: Power Hold Release
      description: Power button released after held down
      default: []
      selector:
        action: {}
    Up_Press:
      name: Up Press
      description: Up button pressed
      default: []
      selector:
        action: {}
    Up_Press2x:
      name: Up Press 2x
      description: Up button pressed 2x
      default: []
      selector:
        action: {}
    Up_Press3x:
      name: Up Press 3x
      description: Up button pressed 3x
      default: []
      selector:
        action: {}
    Up_Press4x:
      name: Up Press 4x
      description: Up button pressed 4x
      default: []
      selector:
        action: {}
    Up_Press5x:
      name: Up Press 5x
      description: Up button pressed 5x
      default: []
      selector:
        action: {}
    Up_Release:
      name: Up Release
      description: Up button released
      default: []
      selector:
        action: {}
    Up_HoldPress:
      name: Up Hold
      description: Up button held down
      default: []
      selector:
        action: {}
    Up_HoldRelease:
      name: Up Hold Release
      description: Up button released after held down
      default: []
      selector:
        action: {}
    Down_Press:
      name: Down Press
      description: Down button pressed
      default: []
      selector:
        action: {}
    Down_Press2x:
      name: Down Press 2x
      description: Down button pressed 2x
      default: []
      selector:
        action: {}
    Down_Press3x:
      name: Down Press 3x
      description: Down button pressed 3x
      default: []
      selector:
        action: {}
    Down_Press4x:
      name: Down Press 4x
      description: Down button pressed 4x
      default: []
      selector:
        action: {}
    Down_Press5x:
      name: Down Press 5x
      description: Down button pressed 5x
      default: []
      selector:
        action: {}
    Down_Release:
      name: Down Release
      description: Down button released
      default: []
      selector:
        action: {}
    Down_HoldPress:
      name: Down Hold
      description: Down button held down
      default: []
      selector:
        action: {}
    Down_HoldRelease:
      name: Down Hold Release
      description: Down button released after held down
      default: []
      selector:
        action: {}
    Hue_Press:
      name: Hue Press
      description: Hue button pressed
      default: []
      selector:
        action: {}
    Hue_Press2x:
      name: Hue Press 2x
      description: Hue button pressed 2x
      default: []
      selector:
        action: {}
    Hue_Press3x:
      name: Hue Press 3x
      description: Hue button pressed 3x
      default: []
      selector:
        action: {}
    Hue_Press4x:
      name: Hue Press 4x
      description: Hue button pressed 4x
      default: []
      selector:
        action: {}
    Hue_Press5x:
      name: Hue Press 5x
      description: Hue button pressed 5x
      default: []
      selector:
        action: {}
    Hue_Release:
      name: Hue Release
      description: Hue button released
      default: []
      selector:
        action: {}
    Hue_HoldPress:
      name: Hue Hold
      description: Hue button held down
      default: []
      selector:
        action: {}
    Hue_HoldRelease:
      name: Hue Hold Release
      description: Hue button released after held down
      default: []
      selector:
        action: {}
  source_url: https://community.home-assistant.io/t/zha-philips-hue-smart-dimmer-switch-and-remote-rwl020/353143
mode: single
max_exceeded: silent
variables:
  device_id: !input "zha_device"
trigger:
  - platform: event
    event_type: zha_event
condition: "{{ trigger.event.data.device_id == device_id }}"
action:
  - variables:
      button: "{{ trigger.event.data.args.button }}"
      press_type: "{{ trigger.event.data.args.press_type }}"
      command_type: "{{ trigger.event.data.command }}"
  - service: logbook.log
    data:
      name: Button
      message: "{{ button }}"
  - service: logbook.log
    data:
      name: Press Type
      message: "{{ press_type }}"
  - service: logbook.log
    data:
      name: Device
      message: "{{ zha_device }}"
  - service: logbook.log
    data:
      name: Command
      message: "{{ command_type }}"
  - choose:
      - conditions: '{{ command_type == "on_press" }}'
        sequence: !input "Power_Press"
      - conditions: '{{ command_type == "on_double_press" }}'
        sequence: !input "Power_Press2x"
      - conditions: '{{ command_type == "on_triple_press" }}'
        sequence: !input "Power_Press3x"
      - conditions: '{{ command_type == "on_quadruple_press" }}'
        sequence: !input "Power_Press4x"
      - conditions: '{{ command_type == "on_quintuple_press" }}'
        sequence: !input "Power_Press5x"
      - conditions: '{{ command_type == "on_short_release" }}'
        sequence: !input "Power_Release"
      - conditions: '{{ command_type == "on_hold" }}'
        sequence: !input "Power_HoldPress"
      - conditions: '{{ command_type == "on_long_release" }}'
        sequence: !input "Power_HoldRelease"
      - conditions: '{{ command_type == "up_press" }}'
        sequence: !input "Up_Press"
      - conditions: '{{ command_type == "up_double_press" }}'
        sequence: !input "Up_Press2x"
      - conditions: '{{ command_type == "up_triple_press" }}'
        sequence: !input "Up_Press3x"
      - conditions: '{{ command_type == "up_quadruple_press" }}'
        sequence: !input "Up_Press4x"
      - conditions: '{{ command_type == "up_quintuple_press" }}'
        sequence: !input "Up_Press5x"
      - conditions: '{{ command_type == "up_short_release" }}'
        sequence: !input "Up_Release"
      - conditions: '{{ command_type == "up_hold" }}'
        sequence: !input "Up_HoldPress"
      - conditions: '{{ command_type == "up_long_release" }}'
        sequence: !input "Up_HoldRelease"
      - conditions: '{{ command_type == "down_press" }}'
        sequence: !input "Down_Press"
      - conditions: '{{ command_type == "down_double_press" }}'
        sequence: !input "Down_Press2x"
      - conditions: '{{ command_type == "down_triple_press" }}'
        sequence: !input "Down_Press3x"
      - conditions: '{{ command_type == "down_quadruple_press" }}'
        sequence: !input "Down_Press4x"
      - conditions: '{{ command_type == "down_quintuple_press" }}'
        sequence: !input "Down_Press5x"
      - conditions: '{{ command_type == "down_short_release" }}'
        sequence: !input "Down_Release"
      - conditions: '{{ command_type == "down_hold" }}'
        sequence: !input "Down_HoldPress"
      - conditions: '{{ command_type == "down_long_release" }}'
        sequence: !input "Down_HoldRelease"
      - conditions: '{{ command_type == "off_press" }}'
        sequence: !input "Hue_Press"
      - conditions: '{{ command_type == "off_double_press" }}'
        sequence: !input "Hue_Press2x"
      - conditions: '{{ command_type == "off_triple_press" }}'
        sequence: !input "Hue_Press3x"
      - conditions: '{{ command_type == "off_quadruple_press" }}'
        sequence: !input "Hue_Press4x"
      - conditions: '{{ command_type == "off_quintuple_press" }}'
        sequence: !input "Hue_Press5x"
      - conditions: '{{ command_type == "off_short_release" }}'
        sequence: !input "Hue_Release"
      - conditions: '{{ command_type == "off_hold" }}'
        sequence: !input "Hue_HoldPress"
      - conditions: '{{ command_type == "off_long_release" }}'
        sequence: !input "Hue_HoldRelease"

It would be nice to have some sort of wildcard to select models like RWL*

BRs,
José

1 Like

I keep finding the blueprint resets itself when I go into edit it and all the fields go blank - bug or user error?

Hi, I am new using HA.
So, the blueprint does not work if u have only a philps hue bridge and not a zigbee coordinator/hub?

I have an RWL022 integrated with Conbee II/deconz and using this blueprint, I can set it as the controlling device. However, this automation does not seem to be triggered. I tried different actions and it still does not get activated. Can someone help?

Hi all.
I am getting this error when I trace the automation

Executed: May 11, 2022, 7:15:57 PM
Error: UndefinedError: ‘dict object’ has no attribute ‘event’

Any help to resolve this would be greatly appreciated

1 Like

that is correct, this automation is meant to act upon the remote control events sent by the zigbee coordinator. Philips HUE bridge, although it is a zigbee device, it bridges the zigbee networks through HTTP API, hence, what Homeassistant can do with it depends directly on the exposed local API and/or Philips Cloud API.