Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save NeskireDK/471921df3fe05e33c712a9a6c5aa2fb1 to your computer and use it in GitHub Desktop.
Save NeskireDK/471921df3fe05e33c712a9a6c5aa2fb1 to your computer and use it in GitHub Desktop.
Aqara Wireless Switch (single, double, hold)
blueprint:
name: Aqara Switch Blueprint
description: >
Use this blueprint to control actions for Aqara switches or any other MQTT sensor light switches.
domain: automation
input:
mqtt_device:
name: MQTT Device
description: >
Select an MQTT device, make sure to only select a device of Switch nature
selector:
device:
integration: mqtt
single_action:
name: Single Press Action
description: Define the action to execute on a single press.
default: []
selector:
action: {}
double_action:
name: Double Press Action
description: Define the action to execute on a double press.
default: []
selector:
action: {}
hold_action:
name: Hold Press Action
description: Define the action to execute on a hold press.
default: []
selector:
action: {}
trigger:
- platform: device
domain: mqtt
device_id: !input mqtt_device
type: action
subtype: single
id: Single
- platform: device
domain: mqtt
device_id: !input mqtt_device
type: action
subtype: double
id: Double
- platform: device
domain: mqtt
device_id: !input mqtt_device
type: action
subtype: hold
id: Hold
action:
- choose:
- conditions:
- condition: trigger
id: Single
sequence: !input single_action
- conditions:
- condition: trigger
id: Double
sequence: !input double_action
- conditions:
- condition: trigger
id: Hold
sequence: !input hold_action
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment