Skip to content

Instantly share code, notes, and snippets.

  • Select an option

  • Save teto/7038880877c962efc04a5b5e2ac3c0b2 to your computer and use it in GitHub Desktop.

Select an option

Save teto/7038880877c962efc04a5b5e2ac3c0b2 to your computer and use it in GitHub Desktop.
Zigbee2MQTT - Sonoff ZBM5-3C 3-Button Switch (MQTT Device Trigger) - connorjfarrell
blueprint:
name: Zigbee2MQTT - Sonoff ZBM5-3C (Handles Repeats)
description: "Handles toggle_l1, toggle_l2, and toggle_l3 presses from a Sonoff ZBM5-3C switch, including repeated presses of the same button. L1, L2, and L3 need to be in detached mode."
domain: automation
input:
mqtt_topic:
name: MQTT Topic of Device
description: The full MQTT action topic for the device (e.g. zigbee2mqtt/sonoff_switch/action)
default: "zigbee2mqtt/dummy_device/action"
selector:
text: {}
toggle_l1_action:
name: Action for toggle_l1
description: Action to run when toggle_l1 is received
default: []
selector:
action: {}
toggle_l2_action:
name: Action for toggle_l2
description: Action to run when toggle_l2 is received
default: []
selector:
action: {}
toggle_l3_action:
name: Action for toggle_l3
description: Action to run when toggle_l3 is received
default: []
selector:
action: {}
mode: parallel
trigger:
- trigger: mqtt
topic: !input mqtt_topic
payload: toggle_l1
id: toggle_l1
- trigger: mqtt
topic: !input mqtt_topic
payload: toggle_l2
id: toggle_l2
- trigger: mqtt
topic: !input mqtt_topic
payload: toggle_l3
id: toggle_l3
condition: []
action:
- choose:
- conditions:
- condition: trigger
id: toggle_l1
sequence: !input toggle_l1_action
- conditions:
- condition: trigger
id: toggle_l2
sequence: !input toggle_l2_action
- conditions:
- condition: trigger
id: toggle_l3
sequence: !input toggle_l3_action
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment