ZHA - Philips Hue Dimmer Switch (RWL020, RWL021)

What had to be changed that this runs on Zigbee2Mqtt? =)

1 Like

I have added this blueprint + the automation but every time i press the Hue Dimmer switch i get a red light for all of the buttons except off. any idea why thats the only action that seems to work?

Can’t seem to get this to work. My RWL021 sends the event as follows, but nothing happens with the light. Anyone who can help be debug this?

{
    "event_type": "zha_event",
    "data": {
        "device_ieee": "00:17:88:01:02:c1:50:19",
        "unique_id": "00:17:88:01:02:c1:50:19:2:0xfc00",
        "device_id": "7fda29db5cded63c24b37cc37391733b",
        "endpoint_id": 2,
        "cluster_id": 64512,
        "command": "on_press",
        "args": {
            "button": "on",
            "press_type": "press",
            "command_id": 0,
            "args": [
                1,
                3145728,
                0,
                33,
                0,
                0
            ]
        }
    },
    "origin": "LOCAL",
    "time_fired": "2020-12-22T12:44:51.760571+00:00",
    "context": {
        "id": "9d55de40164d587de24e3cab15347571",
        "parent_id": null,
        "user_id": null
    }
}

The automation created looks like this, and it works like a charm to manually turn the light on.

alias: ZHA - Philips Hue Dimmer Switch
description: ''
use_blueprint:
  path: vanstinator/zha-philips-hue-dimmer-switch-rwl020-rwl021.yaml
  input:
    brightness: '100'
    remote: 7fda29db5cded63c24b37cc37391733b
    light:
      entity_id: light.sofflampan_level_on_off

I’ll reply to my own post. After updating the firmware for my Hue Dimmer Switches the blueprint works just fine!

Thanks @vanstinator this is great and eliminated many separate automations and scripts.

I added a Minimum Brightness option when dimming. Found this useful to set the brightness to the lowest setting that still produces a desirable amount of light.

Added Input

    min_brightness:
      name: Min Brightness
      description: Minimum brightness of the light(s) when dimming
      default: 0
      selector:
        number:
          min: 0
          max: 255
          mode: slider
          step: 1

Updated Variables

variables:
  light: !input 'light'
  force_brightness: !input 'force_brightness'
  brightness: !input 'brightness'
  min_brightness: !input 'min_brightness'

action:
- variables:
    command: '{{ trigger.event.data.command }}'
    cluster_id: '{{ trigger.event.data.cluster_id }}'
    endpoint_id: '{{ trigger.event.data.endpoint_id }}'
    args: '{{ trigger.event.data.args }}'
    cur_brightness: '{{ state_attr(light.entity_id, ''brightness'') | int }}'

Updated Conditions

  - conditions:
    - '{{ command == ''step'' }}'
    - '{{ cluster_id == 8 }}'
    - '{{ endpoint_id == 1 }}'
    - '{{ args == [1, 30, 9] }}'
    sequence:
    - choose:
      - conditions: '{{ (cur_brightness - 25) >= min_brightness }}'
        sequence:
        - service: light.turn_on
          target: !input 'light'
          data:
            transition: 1
            brightness_step: -25
      default:
      - service: light.turn_on
        target: !input 'light'
        data:
          transition: 1
          brightness: !input 'min_brightness'

  - conditions:
    - '{{ command == ''step'' }}'
    - '{{ cluster_id == 8 }}'
    - '{{ endpoint_id == 1 }}'
    - '{{ args == [1, 56, 9] }}'
    sequence:
    - choose:
      - conditions: '{{ (cur_brightness - 50) >= min_brightness }}'
        sequence:
        - service: light.turn_on
          target: !input 'light'
          data:
            transition: 1
            brightness_step: -50
      default:
      - service: light.turn_on
        target: !input 'light'
        data:
          transition: 1
          brightness: !input 'min_brightness'

Still new to blueprints, any comments appreciated!

2 Likes

@term Interestingly enough in another Blueprint (ZHA - Philips Hue Dimmer Switch (individual buttons with long presses)) the author has a similar zha_event structure as you had prior to updating firmware and has long-press functionality that “we” don’t have here. It may be possible your old firmware actually supported more functionality, which I am unsure what to do with :slight_smile:

Anyone have a remote that may not “work” with this Blueprint, but has a more robust zha_event when you try e.g. a “press_type” for instance? Very curious as I’ve had remotes not upgraded for probably 2 years myself, so wondering what/when this all changed if I am observing the disparity correctly.

Self update from that other thread at ZHA - Philips Hue Dimmer Switch (individual buttons with long presses) – I just realized my weeks-old dimmer purchase has the more detailed zha_event like @term had prior. My other three remotes that are likely 3 years out-of-date on firmware updates have this Blueprint’s simpler zha_event structure.

Based on @term’s statement they upgraded firmware, I suspect my “new” remote has a very old firmware. The “firmware” value in Home Assistant’s Zigbee details show the same on both remotes, however, so I am unclear what value to trust to sort this out. I do not have a Hue hub to check further firmware information, unfortunately. Anyone have ideas/similar experiences?

OK, so based on some feedback about this event data being related to ZHA quirks functionality, I did a “Remove” in the Zigbee control panel on one of my “old” remotes and did the ‘Setup’ button on my remote. When the device was re-added, I am now seeing the extra button meta data! Will perform the same on my last two “old” remotes, but it seems like because they were added before some quirks functionality was updated, I never received that support in Home Assistant.

That said, I am now unclear this Blueprint structure is “the right one” long term. Love the design of it, but may be cool to merge functionality into the newer remote structure with the other Blueprint I linked so we can get more functionality out of the same remote long term.

same isue. hue app (and hub) can use the dimmer OK. “Standard” automations built manually can use the dimmer, but the 2 Hue DImmer automations dont see the device as being available for use. same model number on my device (bought from Amazon about 1 year ago)

I’m using this on 5 RWL021’s and it’s working great, thanks!

My only request, if possible, is to add the functionality of the on button cycling through the main 4? Color temperatures if you push the on button when the light is already on.

I saw a couple of posts mentioning scenes and scripts etc, but if it could be in a blueprint, that would be better.

1 Like

I’m having a weird issue with this blueprint where sometimes it sets the brightness to the minimum apparently just before turning a light off, I have the force brightness toggle off.

Tested with two different Hue bulbs, both of them always go back to their previous brightness level if toggled on/off via the HA interface or in the Hue app. If I just turn off the bulb with the switch using the blueprint though, when the bulb is turned back on through any method it’s set at minimum brightness.

It’s almost as if the “turn off” process which fades the brightness to off sets the actual brightness at the minimum in the last step.

Im not sure if its any changes, but I had to change all commands to named commands to make my EU-version work

1 Like

thank you for this, I had to use your version for my European dimmer, too.

Hey, once I have imported the Blueprint, what steps do I take next?

You create an automation based on that blueprint.
Select a remote that you use and select some lights that need to switch.
Save the automation and test if it works.

I took the liberty to create a big update for this blueprint.

Thanks to @vanstinator and @WarriorRocker for the inspiration!

Get it using the link:
Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

Or manually import it using this link:

The (big) downside of my version is that you can only target a single light entity. So you can’t target area’s or devices anymore. sorry!

But these cool features make up for that:

  • I used the new ‘select’ selector introduced in version 2021.3.
  • The “on” button behavior is adjustable. By default it behaves like this:
    - Press it while the light is off, and the light will turn on to the last set brightness.
    - Press it again while the light is on, the light will turn to the fixed brightness setting.
  • Limit the minimum brightness of the light(s) when dimming down. Set this to zero to disable this feature.
  • Add actions for double / triple presses!

Does this blueprint not work for you? Did you add your Hue dimmer to ZHA before July 2020? It might help to press the ‘Reconfigure device’ button on the ZHA Device info page. This enables some new ZHA quirks functionality.

1 Like

I just received a new Hue Dimmer and hooked it up to ZHA. So far so good. I noticed it is recognized as RWL022. The blueprint cannot find the dimmer. Is there any chance you can update the blueprint to support RWL022 as well?
I would be very grateful!

1 Like

The RWL022 is a new device that is not yet supported by ZHA (I think).

I think you need to open a device support request here:

More info:

Thanks Stefan.
I submitted a device support request

Hi,
My RWL022 works with this blueprint, once I removed the “manufacturer” selector.
This switch is no more from “Philips”, but “Signify Netherlands B.V.” (like my Hue bulbs)

Main difference is that the top button is used for on/off (I think the bottom button “hue” is designed to trigger other actions)

3 Likes