Last active
May 10, 2024 12:37
-
-
Save lukyjay/c7ad758da1e1ab41bd0e4f3dc3c40e48 to your computer and use it in GitHub Desktop.
Simple Hue Remote Switch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
blueprint: | |
name: Simple Hue Remote Switch | |
description: | | |
A simple Hue Remote Switch (RWL022) automation. | |
This remote accepts more button press combinations than shown below, but are you really going to remember and use those? | |
domain: automation | |
input: | |
remote_device: | |
name: Dimmer switch | |
description: "Select your Hue remote" | |
selector: | |
device: | |
integration: zha | |
model: RWL022 | |
Power_Release: | |
name: Power | |
description: Power button | |
default: [] | |
selector: | |
action: null | |
Power_HoldPress: | |
name: Power Hold | |
description: Power button held down | |
default: [] | |
selector: | |
action: null | |
Up_Release: | |
name: Up | |
description: Up button | |
default: [] | |
selector: | |
action: null | |
Up_HoldPress: | |
name: Up Hold | |
description: Up button held down | |
default: [] | |
selector: | |
action: null | |
Down_Release: | |
name: Down | |
description: Down button | |
default: [] | |
selector: | |
action: null | |
Down_HoldPress: | |
name: Down Hold | |
description: Down button held down | |
default: [] | |
selector: | |
action: null | |
Hue_Release: | |
name: Hue | |
description: Hue button | |
default: [] | |
selector: | |
action: null | |
Hue_HoldPress: | |
name: Hue Hold | |
description: Hue button held down | |
default: [] | |
selector: | |
action: null | |
mode: single | |
max_exceeded: silent | |
variables: | |
device_id: !input "remote_device" | |
trigger: | |
- platform: event | |
event_type: zha_event | |
condition: "{{ trigger.event.data.device_id == device_id }}" | |
action: | |
- variables: | |
button: "{{ trigger.event.data.args.button }}" | |
press_type: "{{ trigger.event.data.args.press_type }}" | |
command_type: "{{ trigger.event.data.command }}" | |
- service: logbook.log | |
data: | |
name: Button | |
message: "{{ button }}" | |
- service: logbook.log | |
data: | |
name: Press Type | |
message: "{{ press_type }}" | |
- service: logbook.log | |
data: | |
name: Device | |
message: "{{ zha_device }}" | |
- service: logbook.log | |
data: | |
name: Command | |
message: "{{ command_type }}" | |
- choose: | |
- conditions: '{{ command_type == "on_short_release" }}' | |
sequence: !input "Power_Release" | |
- conditions: '{{ command_type == "on_hold" }}' | |
sequence: !input "Power_HoldPress" | |
- conditions: '{{ command_type == "up_short_release" }}' | |
sequence: !input "Up_Release" | |
- conditions: '{{ command_type == "up_hold" }}' | |
sequence: !input "Up_HoldPress" | |
- conditions: '{{ command_type == "down_short_release" }}' | |
sequence: !input "Down_Release" | |
- conditions: '{{ command_type == "down_hold" }}' | |
sequence: !input "Down_HoldPress" | |
- conditions: '{{ command_type == "off_short_release" }}' | |
sequence: !input "Hue_Release" | |
- conditions: '{{ command_type == "off_hold" }}' | |
sequence: !input "Hue_HoldPress" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment