Instantly share code, notes, and snippets.
Last active
February 3, 2022 21:50
-
Star
0
(0)
You must be signed in to star a gist -
Fork
0
(0)
You must be signed in to fork a gist
-
Save alansaid/280cabd69eaa8e9afc4d3d250fdf35c8 to your computer and use it in GitHub Desktop.
This file contains hidden or 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: ZHA - Aqara Opple - Wireless Scene Switch 2 Button | |
description: 'Control anything using Aqara Opple two button remote' | |
domain: automation | |
input: | |
remote: | |
name: Remote | |
description: Opple remote to use | |
selector: | |
device: | |
integration: zha | |
manufacturer: LUMI | |
model: lumi.remote.b286opcn01 | |
# ---------------------------- BUTTON TOP LEFT ---------------------------- | |
button_left_single_press: | |
name: Left button - Single press | |
description: Action to run on a single press of the left button | |
default: [] | |
selector: | |
action: {} | |
button_left_double_press: | |
name: Left button - Double press | |
description: Action to run on a double press of the left button | |
default: [] | |
selector: | |
action: {} | |
button_left_triple_press: | |
name: Left button - Triple press | |
description: Action to run on a triple press of the left button | |
default: [] | |
selector: | |
action: {} | |
button_left_hold_release: | |
name: Left button - Hold release | |
description: Action to run when left button was held in and released | |
default: [] | |
selector: | |
action: {} | |
button_left_hold_in: | |
name: Left button - Hold in | |
description: Action to run when left button is held in | |
default: [] | |
selector: | |
action: {} | |
# ---------------------------- BUTTON TOP RIGHT ---------------------------- | |
button_right_single_press: | |
name: Right button - Single press | |
description: Action to run on a single press of the right button | |
default: [] | |
selector: | |
action: {} | |
button_right_double_press: | |
name: Right button - Double press | |
description: Action to run on a double press of the right button | |
default: [] | |
selector: | |
action: {} | |
button_right_triple_press: | |
name: Right button - Triple press | |
description: Action to run on a triple press of the right button | |
default: [] | |
selector: | |
action: {} | |
button_right_hold_release: | |
name: Right button - Hold release | |
description: Action to run when right button was held in and released | |
default: [] | |
selector: | |
action: {} | |
button_right_hold_in: | |
name: Right button - Hold in | |
description: Action to run when right button is held in | |
default: [] | |
selector: | |
action: {} | |
mode: restart | |
max_exceeded: silent | |
trigger: | |
- platform: event | |
event_type: zha_event | |
event_data: | |
device_id: !input 'remote' | |
action: | |
- variables: | |
event: '{{ trigger.event.data.command }}' | |
- choose: | |
# ---------------------------- BUTTON TOP LEFT ---------------------------- | |
- conditions: | |
- '{{ event == "1_single" }}' | |
sequence: !input 'button_left_single_press' | |
- conditions: | |
- '{{ event == "1_double" }}' | |
sequence: !input 'button_left_double_press' | |
- conditions: | |
- '{{ event == "1_triple" }}' | |
sequence: !input 'button_left_triple_press' | |
- conditions: | |
- '{{ event == "1_release" }}' | |
sequence: !input 'button_left_hold_release' | |
- conditions: | |
- '{{ event == "1_hold" }}' | |
sequence: !input 'button_left_hold_in' | |
# ---------------------------- BUTTON TOP RIGHT ---------------------------- | |
- conditions: | |
- '{{ event == "2_single" }}' | |
sequence: !input 'button_right_single_press' | |
- conditions: | |
- '{{ event == "2_double" }}' | |
sequence: !input 'button_right_double_press' | |
- conditions: | |
- '{{ event == "2_triple" }}' | |
sequence: !input 'button_right_triple_press' | |
- conditions: | |
- '{{ event == "2_release" }}' | |
sequence: !input 'button_right_hold_release' | |
- conditions: | |
- '{{ event == "2_hold" }}' | |
sequence: !input 'button_right_hold_in' | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment