Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save denselm/5049daf0d2812c8b6ae9a6dc298f471c to your computer and use it in GitHub Desktop.
Save denselm/5049daf0d2812c8b6ae9a6dc298f471c to your computer and use it in GitHub Desktop.
Aqara Wireless Switch (single, double, hold)
blueprint:
name: Aqara Wireless Switch (single, double, hold, release) - Zigbee2MQTT 2.0.0 compatible
description: Aqara Wireless Switch blueprint that supports single, double, hold and release actions using MQTT device triggers to be compatible with Zigbee2MQTT 2.0.0
domain: automation
input:
input_device_id:
name: Device Name
description: Aqara device used to trigger actions
selector:
device:
entity:
- integration: mqtt
domain:
- sensor
multiple: false
press_single:
name: Single button press
description: Action to run on single button press
default: []
selector:
action: {}
press_double:
name: Double button press
description: Action to run on double button press
default: []
selector:
action: {}
press_hold:
name: Button hold
description: Action to run on hold
default: []
selector:
action: {}
press_release:
name: Button release
description: Action to run on release
default: []
selector:
action: {}
source_url: https://gist.github.com/denselm/5049daf0d2812c8b6ae9a6dc298f471c
mode: restart
max_exceeded: silent
triggers:
- domain: mqtt
device_id: !input input_device_id
type: action
subtype: single
trigger: device
id: single
- domain: mqtt
device_id: !input input_device_id
type: action
subtype: double
trigger: device
id: double
- domain: mqtt
device_id: !input input_device_id
type: action
subtype: hold
trigger: device
id: hold
- domain: mqtt
device_id: !input input_device_id
type: action
subtype: release
trigger: device
id: release
actions:
- if:
- condition: trigger
id:
- single
then:
- sequence: !input press_single
- if:
- condition: trigger
id:
- double
then:
- sequence: !input press_double
- if:
- condition: trigger
id:
- hold
then:
- sequence: !input press_hold
- if:
- condition: trigger
id:
- release
then:
- sequence: !input press_release
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment