ZHA - Philips Hue Dimmer Switch (RWL020, RWL021)

Thanks for sharing the fix!

Hi together,

I tried all version of this script, and i have always the same issue. I am able to dim and turn off the lamp but turning on does not work. Does anyone know what the issue or how to debug?

solution got already posted by bamzero

I have the same problem

Fix my issue thanks!

The blueprint, as it installs using automated install, is broken, It will definitely turn on the light, but dim and off no longer working.
I use the blueprint so I don’t have to mess with code too much. If there is a fix, it should really be put in the blueprint so others downloading do not have to mess with the code to fix a bug…

There are alternative blueprints for the RWL020 / RWL021 (Version 1) Dimmer Switches, and there is a nice V2 dimmer switch blueprint if you have the new one with the Hue button on the bottom.
This one works well for the Version 1 (RWL020/RWL021) dimmers, a lot of options in it though and maybe not quite as simple, but the main thing is it works.

1 Like

This blueprint does not seem to be working anymore with my RWL020. The on button will work to turn the light on, but the dim and off buttons do not do anything.

Can we get a fix please? This is my favorite blueprint for this device and would love to keep using it.

1 Like

Can confirm. Currently, both the v1 and v2 versions seem to be broken. v2 doesn’t even seem to pick up any actions. v1 does register my off/on presses, but doesn’t do anything to the lights.

hey guys, i fixed it.
i dont understand why, but the declaration of the variable ‘args’ doesnt work anymore.

quick’n’dirty fix:
replace all ‘{{ args == […] }}’
with ‘{{ trigger.event.data.args == […] }}’

that sould fix it.

6 Likes

I’m in the same boat as @jeremytodd1
For as long as I can remember, only the ON button has been working.

Thank you so much for this. First blueprint I have tried that works like expected with RWL021

Hey, that was the solution in my case too!
But I also didn’t understand why the variable is no longer pulled correctly.

Thank you!

doest seem to work for me,

I can only get the on button to work.

randomly thought i would try and change the on button to turn off the light and that doesn’t work either. Although i am very new here it could just be my coding lol

1 Like

Same for me. Something changed and now I can only use the turn on button, everything else is without function.

by me the same :frowning:

that worked like a charm, thx!

I have exactly the same behavior. Only the ON button works.
Does anybody know what’s ther problem with it?

2 Likes

I have the same behavior. any fix would be great.

sorry where can I change this. Still a noob to HA…

I am on ZHA Skyconnect only and use a RWL021 probably v1. It is quite old

I spent some time learning how Blueprints work yesterday and came up with this modification of the original. Note this has only been tested with the v1 remote as that’s all I have but it restores functionality to all buttons for me.

blueprint:
  name: ZHA - Philips Hue Dimmer Switch (Fixed)
  description: 'Control lights with a Philips Hue Dimmer Switch.

    The top "on" button will turn the lights on to the last set brightness

    (unless the force brightness is toggled on in the blueprint).

    Dim up/down buttons will change the brightness smoothly and can be pressed

    and hold until the brightness is satisfactory.


    The bottom "off" button will turn the lights off.

    '
  domain: automation
  input:
    remote:
      name: Philips Hue Dimmer Switch
      description: Pick either RWL020 (US) or RWL021 (EU)
      selector:
        device:
          filter:
            - integration: zha
              manufacturer: Philips
          entity:
            - domain:
                - sensor
              device_class:
                - battery
          multiple: false
    light:
      name: Light(s)
      description: The light(s) to control
      selector:
        target:
          entity:
            - domain:
                - light
    force_brightness:
      name: Force turn on brightness
      description:
        'Force the brightness to the set level below, when the "on" button
        on the remote is pushed and lights turn on.'
      default: false
      selector:
        boolean: {}
    brightness:
      name: Brightness
      description: Brightness of the light(s) when turning on
      default: 100
      selector:
        number:
          min: 0.0
          max: 100.0
          mode: slider
          step: 1.0
          unit_of_measurement: "%"
  source_url: https://community.home-assistant.io/t/zha-philips-hue-dimmer-switch-rwl020-rwl021/255048
mode: restart
max_exceeded: silent
variables:
  force_brightness: !input force_brightness
trigger:
  - platform: event
    event_type: zha_event
    event_data:
      device_id: !input remote
action:
  - variables:
      command: "{{ trigger.event.data.command }}"
      cluster_id: "{{ trigger.event.data.cluster_id }}"
      endpoint_id: "{{ trigger.event.data.endpoint_id }}"
  - choose:
      # Light on
      - conditions:
          - "{{ command == 'on' }}"
          - "{{ cluster_id == 6 }}"
          - "{{ endpoint_id == 1 }}"
        sequence:
          - choose:
              - conditions: "{{ force_brightness }}"
                sequence:
                  - service: light.turn_on
                    target: !input light
                    data:
                      transition: 1
                      brightness_pct: !input brightness
            default:
              - service: light.turn_on
                target: !input light
                data:
                  transition: 1
      # Light off
      - conditions:
          - "{{ command == 'off_press' }}"
          - "{{ cluster_id == 64512 }}"
          - "{{ endpoint_id == 2 }}"
        sequence:
          - service: light.turn_off
            target: !input light
            data:
              transition: 1
      # Brightness up
      - conditions:
          - "{{ command == 'step' }}"
          - "{{ cluster_id == 8 }}"
          - "{{ endpoint_id == 1 }}"
          - "{{ trigger.event.data.params.step_mode == 0 }}"
        sequence:
          - service: light.turn_on
            target: !input light
            data:
              brightness_step_pct: 10
              transition: 1
      # Brightness down
      - conditions:
          - "{{ command == 'step' }}"
          - "{{ cluster_id == 8 }}"
          - "{{ endpoint_id == 1 }}"
          - "{{ trigger.event.data.params.step_mode == 1 }}"
        sequence:
          - service: light.turn_on
            target: !input light
            data:
              brightness_step_pct: -10
              transition: 1

I did try setting trigger.event.data.params.step_mode as a step_mode variable in the actions but I couldn’t get it to work :man_shrugging:.

1 Like