deCONZ - Philips Hue Dimmer Switch - Custom Actions

GitHub Gist: https://gist.github.com/sbyx/67f72210c5f95564adc592fb021d259e

This is a simple blueprint for deCONZ that allows to easily define custom actions for a Philips Hue Dimmer Switch. All 4 buttons can be freely programmed with one press and one hold action sequency each.

This is essentially a deCONZ port based on @mannerisms ZHA - Philips Hue Dimmer Switch (individual buttons with long presses)

Prerequisites

deCONZ and a Philips Hue Dimmer Switch (RWL020 or RWL021)

Blueprint Code

blueprint:
  name: "deCONZ - Philips Hue Dimmer Switch - Custom Actions"
  description: Freely customizable actions for Philips Hue Dimmer Switch buttons.
  domain: automation
  input:
    remote:
      name: Dimmer Switch
      selector:
        device:
          integration: deconz
          manufacturer: Philips
          entity:
            domain: sensor
            device_class: battery
    on_press:
      name: Button 1 (ON) press actions
      default: []
      selector:
        action: {}
    on_hold:
      name: Button 1 (ON) hold actions
      default: []
      selector:
        action: {}
    up_press:
      name: Button 2 (UP) press actions
      default: []
      selector:
        action: {}
    up_hold:
      name: Button 2 (UP) hold actions
      default: []
      selector:
        action: {}
    down_press:
      name: Button 3 (DOWN) press actions
      default: []
      selector:
        action: {}
    down_hold:
      name: Button 3 (DOWN) hold actions
      default: []
      selector:
        action: {}
    off_press:
      name: Button 4 (OFF) press actions
      default: []
      selector:
        action: {}
    off_hold:
      name: Button 4 (OFF) hold actions
      default: []
      selector:
        action: {}

mode: restart
max_exceeded: silent

trigger:
  - platform: event
    event_type: deconz_event
    event_data:
      device_id: !input remote

action:
  - variables:
      event: "{{ trigger.event.data.event }}"
  - choose:
      - conditions:
          - "{{ event == 1002 }}"
        sequence: !input on_press
      - conditions:
          - "{{ event == 1001 }}"
        sequence: !input on_hold
      - conditions:
          - "{{ event == 2002 }}"
        sequence: !input up_press
      - conditions:
          - "{{ event == 2001 }}"
        sequence: !input up_hold
      - conditions:
          - "{{ event == 3002 }}"
        sequence: !input down_press
      - conditions:
          - "{{ event == 3001 }}"
        sequence: !input down_hold
      - conditions:
          - "{{ event == 4002 }}"
        sequence: !input off_press
      - conditions:
          - "{{ event == 4001 }}"
        sequence: !input off_hold

Changelog

  • 2020-01-10: Initial version

My blueprints

8 Likes

Thanks! Works great for me. With other Blueprints I had the problem, that a long press also triggered the short press action. This one works as intended :slight_smile:

Not working with the RWL021 version of the dimmer. Says no input devices.

Thx ! Just discovering blueprints… And this one saves me a lot of time !

Too bad - doesn’t work with the older version of the remote.
:frowning:
As already written above.

Cheers
Rakete

Hi all,
Is it just my instance, or does anyone else have an issue when introducing a Delay action into this blueprint.
I have created a basic automation which goes through and turns off a number of power points (in a media room), each power point has 2 entities and there are 5 power points. The automation also has a Delay. So essentially it is

  1. Turn off Entity 1 on Powerpoint 1
  2. Turn off Entity 2 on Powerpoint 1
  3. Turn off Entity 1 on Powerpoint 2
  4. Turn off Entity 2 on Powerpoint 2
  5. Turn off Entity 1 on Powerpoint 3
  6. Turn off Entity 2 on Powerpoint 3
  7. Turn off Entity 1 on Powerpoint 4
  8. Turn off Entity 2 on Powerpoint 4
  9. Turn off Entity 1 on Powerpoint 5
  10. Wait (delay) 1 minute
  11. Turn off Entity 2 on Powerpoint 5

I have found that the automation will not progress past the Delay.

I have tested by adding a Delay of 5 seconds at step 1, which then does not allow the automation to progress past the first step (I then removed the Delay at step 1 and kept the Delay at the second last step)
I have also tested by calling a script (service) where i have added the Delay, but again, the automation will not progress past the delay. Is this just an issue I am experiencing?
I was going to add the actual yaml, but is is very basic.

Just edit the blueprint and change/remove manufacturer.

image

Would greatly appreciate if someone could update this automation to support V2 (RWL022) :slight_smile:

2 Likes