This blueprint is designed to work with the Aqara D1 Wireless Remote Switch (Double Rocker) using a Zigbee2mqtt action sensor. It allows configurable actions for left, right, both, single, double, and hold.
Blueprint:
blueprint:
name: Z2M - Aqara D1 Wireless Remote Switch (Double)
domain: automation
input:
remote:
name: Remote
description: Zigbee2mqtt Action Sensor
selector:
entity:
integration: mqtt
domain: sensor
condition:
name: Condition
description: Condition to test before handling a button press
default: []
selector:
action:
left_click:
name: Left Single
default: []
selector:
action:
left_double:
name: Left Double
default: []
selector:
action:
left_long:
name: Left Long
default: []
selector:
action:
right_click:
name: Right Single
default: []
selector:
action:
right_double:
name: Right Double
default: []
selector:
action:
right_long:
name: Right Long
default: []
selector:
action:
both_click:
name: Both Single
default: []
selector:
action:
both_double:
name: Both Double
default: []
selector:
action:
both_long:
name: Both Long
default: []
selector:
action:
mode: restart
max_exceeded: silent
trigger:
platform: state
entity_id: !input remote
attribute: action
condition: !input condition
action:
- variables:
command: "{{ trigger.to_state.state }}"
- choose:
- conditions: "{{ command == 'single_left' or command == 'left' }}"
sequence: !input left_click
- conditions: "{{ command == 'double_left' or command == 'left_double' }}"
sequence: !input left_double
- conditions: "{{ command == 'hold_left' or command == 'left_long' }}"
sequence: !input left_long
- conditions: "{{ command == 'single_right' or command == 'right' }}"
sequence: !input right_click
- conditions: "{{ command == 'double_right' or command == 'right_double' }}"
sequence: !input right_double
- conditions: "{{ command == 'hold_right' or command == 'right_long' }}"
sequence: !input right_long
- conditions: "{{ command == 'single_both' or command == 'both' }}"
sequence: !input both_click
- conditions: "{{ command == 'double_both' or command == 'both_double' }}"
sequence: !input both_double
- conditions: "{{ command == 'hold_both' or command == 'both_long' }}"
sequence: !input both_long