From 8e68d906b6d71fab491b387f031c62a2897d4932 Mon Sep 17 00:00:00 2001 From: Pavel Kachalouski Date: Sun, 21 May 2023 09:24:26 +0200 Subject: [PATCH] Added simple dimmer blueprint --- philips_zigbee_dimmer_simple.yaml | 132 ++++++++++++++++++++++++++++++ 1 file changed, 132 insertions(+) create mode 100644 philips_zigbee_dimmer_simple.yaml diff --git a/philips_zigbee_dimmer_simple.yaml b/philips_zigbee_dimmer_simple.yaml new file mode 100644 index 0000000..8beec1c --- /dev/null +++ b/philips_zigbee_dimmer_simple.yaml @@ -0,0 +1,132 @@ +blueprint: + name: Philips Hue Dimmer Remote + description: "Control lights with a Philips Hue Dimmer Switch." + domain: automation + input: + remote: + name: Philips Hue Dimmer Switch + description: Pick either RWL020 (US) or RWL021 (EU) or RWL022 (EU) + selector: + device: + integration: zha + manufacturer: Signify Netherlands B.V. + model: RWL022 + light: + name: Controlled light + description: The light(s) to control with single press + selector: + target: + entity: {} + 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: "%" + current_light: + name: (OPTIONAL) Current Light + description: + 'Text helper to track the current light to dim. Set for the dimmer controls to change which light they are controlling according to the last one turned on. + For instance, double press "on" and then the dimmer buttons will control the Double Press Light' + default: + selector: + entity: + domain: input_text + source_url: https://github.com/xeppaka/ha-automations/blob/main/philips_zigbee_dimmer_simple.yaml +mode: restart +max_exceeded: silent +trigger: + - platform: event + event_type: zha_event + event_data: + device_id: !input "remote" +action: + - variables: + light: !input light + command: "{{ trigger.event.data.command }}" + cluster_id: "{{ trigger.event.data.cluster_id }}" + endpoint_id: "{{ trigger.event.data.endpoint_id }}" + args: "{{ trigger.event.data.args }}" + - choose: + - condition: + - and: + - "{{ command == 'on_press' }}" + - "{{ is_state(light, 'off') }}" + sequence: + - service: light.turn_on + target: !input "light" + data: + transition: 1 + brightness_pct: !input "brightness" + - conditions: + - "{{ command == 'off_with_effect' }}" + sequence: + - service: light.turn_off + target: !input "light" + data: + transition: 1 + - conditions: + - "{{ command == 'step' }}" + - "{{ args == [0, 30, 9] }}" + sequence: + - service: light.turn_on + target: !input "light" + data: + brightness_step_pct: 10 + transition: 1 + - conditions: + - "{{ command == 'step' }}" + - "{{ args == [0, 63, 9] }}" + sequence: + - service: light.turn_on + target: !input "light" + data: + brightness_step_pct: 25 + transition: 1 + - conditions: + - "{{ command == 'up_press' }}" + sequence: + - service: light.turn_on + target: !input "light" + data: + brightness_step_pct: 10 + transition: 1 + - conditions: + - "{{ command == 'step' }}" + - "{{ args == [1, 30, 9] }}" + sequence: + - service: light.turn_on + target: !input "light" + data: + brightness_step_pct: -10 + transition: 1 + - conditions: + - "{{ command == 'step' }}" + - "{{ args == [1, 63, 9] }}" + sequence: + - service: light.turn_on + target: !input "light" + data: + brightness_step_pct: -25 + transition: 1 + - conditions: + - "{{ command == 'down_press' }}" + sequence: + - service: light.turn_on + target: !input "light" + data: + brightness_step_pct: -10 + transition: 1