Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save connorjfarrell/b0273b54a540ccd242267d279f7048c0 to your computer and use it in GitHub Desktop.

Select an option

Save connorjfarrell/b0273b54a540ccd242267d279f7048c0 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 topic for the device (e.g. zigbee2mqtt/sonoff_switch)
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:
- platform: mqtt
topic: !input mqtt_topic
payload: toggle_l1
id: toggle_l1
- platform: mqtt
topic: !input mqtt_topic
payload: toggle_l2
id: toggle_l2
- platform: 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
@pvangorp

pvangorp commented Oct 5, 2026 •

Copy link
Copy Markdown

Hereby the fix! Can you apply this?!
One simple change:

default: "zigbee2mqtt/dummy_device/action"

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