Understandably somewhat redundant as the multiple button presses can be set as individual automation triggers, but I like to have a single automation control all options of the button, so for others that share the same OCD, here a simple blueprint for the Aqara (aq2) mini switch.
edit: Modified to work for 2024-08. Thanks to @raphi
blueprint:
name: ZHA - Aqara Wireless Mini Switch (aq2)
description: Automate your Xiaomi Aqara Wireless Mini Switch using ZHA events.
domain: automation
input:
aqara_mini_switch:
name: Aqara Wireless Mini Switch
description: Aqara Wireless Mini Switch to use
selector:
device:
integration: zha
manufacturer: LUMI
model: lumi.sensor_switch.aq2
button_single_press:
name: Single Press
description: Action to run on single press
default: []
selector:
action: {}
button_double_press:
name: Double Press
description: Action to run on double press
default: []
selector:
action: {}
button_triple_press:
name: Triple Press
description: Action to run when button is triple pressed
default: []
selector:
action: {}
button_quadruple_press:
name: Quadruple
description: Action to run when button is quadruple pressed
default: []
selector:
action: {}
mode: restart
max_exceeded: silent
trigger:
- platform: event
event_type: zha_event
event_data:
device_id: !input "aqara_mini_switch"
action:
- choose:
- conditions:
- "{{ trigger.event.data.args.attribute_value == 1 }}"
sequence: !input "button_single_press"
- conditions:
- "{{ trigger.event.data.args.attribute_value == 2 }}"
sequence: !input "button_double_press"
- conditions:
- "{{ trigger.event.data.args.attribute_value == 3 }}"
sequence: !input "button_triple_press"
- conditions:
- "{{ trigger.event.data.args.attribute_value == 4 }}"
sequence: !input "button_quadruple_press"