This blueprint assumes that the Aqara H1 is put into operation mode 1 and click mode 2.
See more information at [Device Support Request] Aqara H1 wireless switch double rocker (model WRS-R02) · Issue #940 · zigpy/zha-device-handlers · GitHub
blueprint:
name: ZHA - Aqara H1 (WRS-R02) Wireless Remote Switch (Double Rocker)
description: Automate your Xiaomi Aqara H1 (WRS-R02) Wireless Remote Switch (Double Rocker) using ZHA events.
domain: automation
input:
aqara_h1_switch:
name: Select the Aqara H1 (WRS-R02) Wireless Remote Switch (Double Rocker)
description: Aqara H1 (WRS-R02) Wireless Remote Switch (Double Rocker)
selector:
device:
integration: zha
manufacturer: LUMI
entity:
domain: sensor
device_class: battery
# Left button
button_single_press_left:
name: Single Press Left
description: Action to run on single press
default: []
selector:
action:
button_double_press_left:
name: Double Press Left
description: Action to run on double press
default: []
selector:
action:
button_triple_press_left:
name: Triple Press Left
description: Action to run on triple press
default: []
selector:
action:
button_long_press_left:
name: Long Press Left
description: Action to run when button is long pressed (held down)
default: []
selector:
action:
# Right button
button_single_press_right:
name: Single Press Right
description: Action to run on single press
default: []
selector:
action:
button_double_press_right:
name: Double Press Right
description: Action to run on double press
default: []
selector:
action:
button_triple_press_right:
name: Triple Press Right
description: Action to run on triple press
default: []
selector:
action:
button_long_press_right:
name: Long Press Right
description: Action to run when button is long pressed (held down)
default: []
selector:
action:
# Both buttons
button_single_press_both:
name: Single Press Both Buttons
description: Action to run on single presses
default: []
selector:
action:
button_double_press_both:
name: Double Press Both Buttons
description: Action to run on double presses
default: []
selector:
action:
button_triple_press_both:
name: Triple Press Both
description: Action to run on triple presses
default: []
selector:
action:
button_long_press_both:
name: Long Press Both Buttons
description: Action to run when buttons are long pressed (held down)
default: []
selector:
action:
mode: restart
max_exceeded: silent
trigger:
- platform: event
event_type: zha_event
event_data:
device_id: !input aqara_h1_switch
action:
-
variables:
command: “{{ trigger.event.data.command }}” -
choose:
-
conditions:
- “{{ command == ‘1_single’ }}”
sequence: !input button_single_press_left
- “{{ command == ‘1_single’ }}”
-
conditions:
- “{{ command == ‘1_double’ }}”
sequence: !input button_double_press_left
- “{{ command == ‘1_double’ }}”
-
conditions:
- “{{ command == ‘1_triple’ }}”
sequence: !input button_triple_press_left
- “{{ command == ‘1_triple’ }}”
-
conditions:
- “{{ command == ‘1_hold’ }}”
sequence: !input button_long_press_left
- “{{ command == ‘1_hold’ }}”
-
conditions:
- “{{ command == ‘2_single’ }}”
sequence: !input button_single_press_right
- “{{ command == ‘2_single’ }}”
-
conditions:
- “{{ command == ‘2_double’ }}”
sequence: !input button_double_press_right
- “{{ command == ‘2_double’ }}”
-
conditions:
- “{{ command == ‘2_triple’ }}”
sequence: !input button_triple_press_right
- “{{ command == ‘2_triple’ }}”
-
conditions:
- “{{ command == ‘2_hold’ }}”
sequence: !input button_long_press_right
- “{{ command == ‘2_hold’ }}”
-
conditions:
- “{{ command == ‘3_single’ }}”
sequence: !input button_single_press_both
- “{{ command == ‘3_single’ }}”
-
conditions:
- “{{ command == ‘3_double’ }}”
sequence: !input button_double_press_both
- “{{ command == ‘3_double’ }}”
-
conditions:
- “{{ command == ‘3_triple’ }}”
sequence: !input button_triple_press_both
- “{{ command == ‘3_triple’ }}”
-
conditions:
- “{{ command == ‘3_hold’ }}”
sequence: !input button_long_press_both
Comment
- “{{ command == ‘3_hold’ }}”
-