Skip to content

Instantly share code, notes, and snippets.

@alexsotoaguilera
Last active November 14, 2024 15:40
Show Gist options
  • Select an option

  • Save alexsotoaguilera/e242ab8573148f0650a98f90e56366ab to your computer and use it in GitHub Desktop.

Select an option

Save alexsotoaguilera/e242ab8573148f0650a98f90e56366ab to your computer and use it in GitHub Desktop.
HomeAssistant Blueprint: Smart Button with MQTT device triggers
blueprint:
name: Smart Button with MQTT device triggers
description: Configure Smart Button with MQTT device triggers with SINGLE, DOUBLE and HOLD tap actions.
domain: automation
author: Alex Soto Aguilera
source_url: https://github.com/alexsotoaguilera/homeassistant/tree/main/blueprints/automation/alexsotoaguilera/smartbutton-mqtt-device-triggers.yaml
homeassistant:
min_version: 2022.4.0
input:
smart_button_device:
name: Smart Button device
description: Smart Button device, ensure to your device supports MQTT device triggers with SINGLE, DOUBLE and HOLD tap actions.
selector:
device:
multiple: false
actions_single:
name: Single Tap Actions
description: Select actions to activate with SINGLE tap.
selector:
action: {}
actions_double:
name: Double Tap Actions
description: Select actions to activate with Double tap.
selector:
action: {}
actions_hold:
name: Hold Tap Actions
description: Select actions to activate with Hold tap.
selector:
action: {}
triggers:
- trigger: device
domain: mqtt
id: single
device_id: !input "smart_button_device"
type: action
subtype: single
- trigger: device
domain: mqtt
id: double
device_id: !input "smart_button_device"
type: action
subtype: double
- trigger: device
domain: mqtt
id: hold
device_id: !input "smart_button_device"
type: action
subtype: hold
action:
- choose:
- conditions:
- condition: trigger
id: single
sequence: !input "actions_single"
- conditions:
- condition: trigger
id: double
sequence: !input "actions_double"
- conditions:
- condition: trigger
id: hold
sequence: !input "actions_hold"
mode: single
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment