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

Hi there, thanks for reply. I have a hue hub but not using it. i have a co-ordinator ( Texas Instruments CC2531, Z-Stack) and it can find the Hue dimmer when i search for new devices and add it to home assistant. When I add the automation from the blueprint is asks for the phillips hue dimmer from my entities and i select the phillips RWL021 which is fine, however the automation does not run and comes up with the error in the trace of the automation. Hope this makes sense
Executed: May 27, 2022, 4:14:39 PM
Error: UndefinedError: ā€˜dict objectā€™ has no attribute ā€˜eventā€™

Thanks for help

Just to add to this. When the dimmer was connected to the Hue Hub a green led on the dimmer would aluminate when you pressed On/Off/Up/Down but now with each button press it is a orange or red led that illuminates when i press a button. It is almost like it is not synced to a hub or co-ordinator???
I am not technical so just trying to understand why it is not workingā€¦

Hi,

Ok, so you have the dimmer paired with a coordinator that is in HA, therefore, I presume it integrates to HA through ZHA integration, right?
If that is the case, go to developer tools menu, click events tab, type zha_event to the listen event box and start listening button.

Now, press the button on your philips remote. What you see there?

BRs,
Jose.

Did you solve this issue? i have the same texas cc2531 and thinking about to buy this RWL022 model, to control some lights and use some scripts

I wasnā€™t about for the past week, but now am back and my hue dimmer switch and automation has stopped working entirely.

I checked out the ā€˜trace timelineā€™ and can see Iā€™m getting the below error, can someone please point me in the right direction to get this working again?

Many thanks in advance for any help!

Triggered by the event 'zha_event' at 6 June 2022, 09:46:32
 
Define variables command, cur_brightness, is_turned_on
Stopped because an error was encountered at 6 June 2022, 09:46:32 (runtime: 0.02 seconds)
 
ValueError: Template error: int got invalid input 'None' when rendering template '{{ state_attr(light, 'brightness') | int }}' but no default was specified

Ok, think itā€™s fixed now, at least my switch is working again.

I had to edit /config/blueprints/automation/stefanroelofs/hue_dimmer_switchV2.yaml

From there I just set the default argument for ā€˜intā€™ to zero:

Changing:

{{ state_attr(light, 'brightness') | int }}

To:

{{ state_attr(light, 'brightness') | int(0) }}

2 Likes

Is there any way this blueprint could be modified to work with the RWL022 added through HomeKit Controller instead of through ZHA? Adding through HomeKit eliminates the delay, but it only exposes one click function per button, and no holds. I tried going through ZHA but itā€™s pretty unreliable.

Can it be modified to work with the remote through HomeKit controller?

Is there a way I can setup the ā€œhueā€ button to switch between the different white tones like it originally did with this? or how is it possible?

Could you not manually save each one as individual scenes in HA (could still call them Bright, Energise, Relax etc)? Then use the blueprint to cycle them when hue pressed 1x, 2x, 3x ,4x. This is what I intend to do, just havenā€™t got around to it yet.

It is possible but you have to do a custom scenario for each light. This means that you have to manually set the preferred light setting for each scenario as well and then use the scenario for press 2 e.g. Iā€™m not sure but I donā€™t think that thereā€™s a way to import the scene from hue and then use it as a scenario in HA.

Iā€™ve now got scene changes on the hue button working. What I first proposed above works but isnā€™t great because you have to press 2x, 3x ,4x etc which is unnatural. This reddit post explains how to do it (credit to the OP) with single presses of the Hue button:

Brief summary is:

  1. create your scenes (I used the hue app to figure out fairly closely what settings in HA equate to the Hue defaults)
  2. create a new dropdown select helper to cycle through the scenes
  3. create an extra automation (with the template in reddit post) that runs the scene with the matching name when your helper is updated.
  4. update this automation so that when ā€˜hueā€™ button is pressed the helper changes to next entry.

It works pretty well. Only very minor thing that bugs me is the transitions are a bit harsh and instantaneous but I can live with this.

The only real pain is that you have to do a fair amount of unique manual setup for each and every dimmer switch (scenes, helper and two automations).

Hi @danieljclark, thanks for your explanation. It works for me too. Moreover, I was also bothered by the harsh transitions and I found the solution. You can set a smooth transition by adding the following to the automation that actually turns on the scene:

data:
  transition: 1

such that it becomes

alias: NAME
description: ''
trigger:
- platform: state
  entity_id:
  - input_select.DROPDOWNHELPER
condition:
- condition: not
  conditions:
  - condition: state
    entity_id: input_select.DROPDOWNHELPER
    state: unknown
action:
- service: scene.turn_on
  target:
    entity_id: '{{''scene.'' + states(''input_select.DROPDOWNHELPER'').replace("
	","_").lower()}}'
  data:
    transition: 1

The value ā€˜1ā€™ is of course the transition time.

I am trying to reproduce the original behaviour of the dimmer as much as possible so Iā€™m only still looking for a way to smoothly dim the lights using the middle two buttons. If anyone has suggestions, please let me know!

1 Like

Iā€™m resurrecting this one so apologies for dragging it back up. I have some RWL022 dimmers that work with the original blueprint here, which is great.

But Iā€™m interested to know how you managed to get it to work for RWL020ā€™s as I have a few RWL021ā€™s (EU version of the RWL020). Nothing I do seems to work with those though.

I copied the original blueprint code and made my own yaml file, saved to my config/blueprints folder and changed ā€˜RWL022ā€™ to ā€˜RWL021ā€™, even in the source_url,ā€¦but it didnā€™t work! I duplicated the original blueprint and changed the title to include RWL021, including in the code but, again, didnā€™t work.

How did you get this to work for your RWL020?

Hi @c0ntax

As mentioned, I just used the above copy of the blueprint and it works for me.

Things to consider:

  • update the Hue remote firmware (I donā€™t know what version I have but they were updated some time ago)
  • check the event generated by your remote in the dev menu, mine look like this:
event_type: zha_event
data:
  device_ieee: 00:17:88:xx:xx:xx:xx:xx
  unique_id: 00:17:88:xx:xx:xx:xx:xx:x:0xwwyy
  device_id: 506c489f6ce048xxxxxxxxxxxxxx
  endpoint_id: 2
  cluster_id: 64512
  command: on_double_press
  args:
    button: "on"
    press_type: double_press
    command_id: 0
    args:
      - 1
      - 3145728
      - 0
      - 33
      - 0
      - 0
  params: {}
origin: LOCAL
time_fired: "2022-10-04T16:57:08.622433+00:00"
context:
  id: 01GEHYW18EDGR97CEH3N8G56FW
  parent_id: null
  user_id: null
 

I hope you can figure it out.

are there any way to convert this bluprint to fit deCONZ?

This works pretty nicely.

Can anyone help me edit the blueprint so that when holding down the ā€œdownā€ button to dim lights they do not dim to 0 and are always on by at least 10%. I am struggling to understand how to make edits with variables and add a conditional threshold.

Thanks for sharing this blueprint. There are so many freaking Hue Remote blueprints out there that do not work because they are still leveraging the virtual double clicking for ZHA, which is no longer needed. So far so good with this one.

I am having the same issue. I canā€™t get my remote to show in the device list. Quite literally nothing shows. Says I have no matching devices. And itā€™s paired with HA through ZHA, not through the Hue Bridge. I also tried the copy paste from above for the RWL020 and restarted HA several times. Still nothing.

For anyone having the same issue I was (nothing showing in the device selection box), I had to go into the Blueprint and remove the two lines that I quoted here. Just under ā€œdevice:ā€

How about putting a condition which will only dim the lights if the brightness is above 10?

Keep in mind that depending on the step size you could accidentally jump over 10 and get, say, 5. In this example i assume step size of 10 so for any value below 20 the action changes to set the brightness to 10.

  - if:
      - condition: numeric_state
        entity_id: light.living_room
        value_template: "{{state_attr('light.living_room','brightness')}}"
        above: 19
    then:
      - device_id: b9663f5d26e754c15dff0da4c696e0cf
        domain: light
        entity_id: light.living_room
        type: brightness_decrease
    else:
      - service: light.turn_on
        data:
          brightness_pct: 10
        target:
          entity_id: light.living_room

I will test it and see if I can get it to work depending on the step size.