Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save rdeangel/11f5b0ec29bf22af83d7b7489a541ac2 to your computer and use it in GitHub Desktop.
Save rdeangel/11f5b0ec29bf22af83d7b7489a541ac2 to your computer and use it in GitHub Desktop.
Zigbee2MQTT - Sonoff 1-Button Switch (MQTT Device Trigger) - rdeangel
blueprint:
name: Zigbee2MQTT - Sonoff 1-Button Switch (MQTT Device Trigger) - rdeangel
description: "Blueprint Version: 12-01-25\n
Blueprint Name: Zigbee2MQTT - Sonoff 1-Button Switch (MQTT Device Trigger) - rdeangel\n\n
This blueprint uses MQTT `device` based triggers and it will be triggered
only when the selected Device MQTT messages are received."
domain: automation
input:
mode:
name: Automation Modes
description: https://www.home-assistant.io/docs/automation/modes/
default: parallel
selector:
select:
mode: dropdown
options:
- single
- restart
- queued
- parallel
zigbee_device:
name: Zigbee Device - SNZB-01 (and alike)
description: Select the correct Zigbee device to use.
selector:
device:
integration: mqtt
single_press:
name: Single Press
description: Action to run on single press
default: []
selector:
action: {}
double_press:
name: Double Press
description: Action to run on double press
default: []
selector:
action: {}
long_press:
name: Long Press
description: Action to run on long press (4 seconds)
default: []
selector:
action: {}
source_url: https://gist.github.com/rdeangel/11f5b0ec29bf22af83d7b7489a541ac2
mode: !input mode
max_exceeded: silent
trigger:
- platform: device
device_id: !input zigbee_device
domain: mqtt
type: action
subtype: single
id: single_press
- platform: device
device_id: !input zigbee_device
domain: mqtt
type: action
subtype: double
id: double_press
- platform: device
device_id: !input zigbee_device
domain: mqtt
type: action
subtype: long
id: long_press
- platform: device
device_id: !input zigbee_device
domain: mqtt
type: action
subtype: hold
id: long_press
condition: []
action:
- choose:
- conditions:
- condition: trigger
id: single_press
sequence: !input single_press
- conditions:
- condition: trigger
id: double_press
sequence: !input double_press
- conditions:
- condition: trigger
id: long_press
sequence: !input long_press
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment