Needing help with a 3-button scene switch - Zigbee2MQTT

I just added a 3-button Zigbee scene switch, Tuya TS0043, into Zigbee2MQTT. I had zero issues adding it to Z2M or HA. I copied a Blueprint that I found on here, but it’s not working. I see log entries for the BP Automation when I press a button, but it doesn’t perform any of the actions I’ve defined, including sending notifications. The blueprint and a section of logs is below.

blueprint:
  name: Zigbee2MQTT - Loratap SS600ZB / Tuya TS0043 Zigbee Wireless Switch
  description: Automate your Loratap SS600ZB / Tuya TS0043 Zigbee Wireless Switch via Zigbee2MQTT.
  domain: automation
  input:
    switch:
      name: Loratap SS600ZB / Tuya TS0043 Zigbee Wireless Switch
      description: Loratap SS600ZB / Tuya TS0043 Zigbee Wireless Switch to use
      selector:
        entity:
          integration: mqtt
          domain: sensor
    button_one_short_press:
      name: Single Press - Button 1
      description: Action to run on button 1 - single press
      default: []
      selector:
        action: {}
    button_one_double_press:
      name: Double Press - Button 1
      description: Action to run on button 1 - double press
      default: []
      selector:
        action: {}
    button_one_long_press:
      name: Long Press - Button 1
      description: Action to run on button 1 - long press
      default: []
      selector:
        action: {}
    button_two_short_press:
      name: Single Press - Button 2
      description: Action to run on button 2 - single press
      default: []
      selector:
        action: {}
    button_two_double_press:
      name: Double Press - Button 2
      description: Action to run on button 2 - double press
      default: []
      selector:
        action: {}
    button_two_long_press:
      name: Long Press - Button 2
      description: Action to run on button 2 - long press
      default: []
      selector:
        action: {}
    button_three_short_press:
      name: Single Press - Button 3
      description: Action to run on button 3 - single press
      default: []
      selector:
        action: {}
    button_three_double_press:
      name: Double Press - Button 3
      description: Action to run on button 3 - double press
      default: []
      selector:
        action: {}
    button_three_long_press:
      name: Long Press - Button 3
      description: Action to run on button 3 - long press
      default: []
      selector:
        action: {}
  source_url: https://github.com/AramidX/ha-blueprint/blob/8e259f8e40ab1218f06ea1ce1d1444f67b4cd62f/blueprints/tuya/loratap_ss600zb_wireless_switch_z2m.yaml
mode: restart
max_exceeded: silent
trigger:
- platform: state
  entity_id: !input "switch"
action:
- variables:
    command: '{{ trigger.to_state.state }}'
- choose:
  - conditions:
    - '{{ command == ''1_single'' }}'
    sequence: !input 'button_one_short_press'
  - conditions:
    - '{{ command == ''2_single'' }}'
    sequence: !input 'button_two_short_press'
  - conditions:
    - '{{ command == ''3_single'' }}'
    sequence: !input 'button_three_short_press'
  - conditions:
    - '{{ command == ''1_double'' }}'
    sequence: !input 'button_one_double_press'
  - conditions:
    - '{{ command == ''2_double'' }}'
    sequence: !input 'button_two_double_press'
  - conditions:
    - '{{ command == ''3_double'' }}'
    sequence: !input 'button_three_double_press'
  - conditions:
    - '{{ command == ''1_hold'' }}'
    sequence: !input 'button_one_long_press'
  - conditions:
    - '{{ command == ''2_hold'' }}'
    sequence: !input 'button_two_long_press'
  - conditions:
    - '{{ command == ''3_hold'' }}'
    sequence: !input 'button_three_long_press'
Kitchen 3 button test triggered
7:29:34 PM - 1 minute ago
Kitchen 3 button test triggered by state of Kitchen 3 button test turned on
7:29:02 PM - 1 minute ago
Kitchen 3 button test triggered by state of kitchen_light_sw3 Action
7:29:02 PM - 1 minute ago
kitchen_light_sw3 Action
7:29:02 PM - 1 minute ago
kitchen_light_sw3 Action changed to 1_double
7:29:02 PM - 1 minute ago
Kitchen 3 button test triggered by state of kitchen_light_sw3 Action
7:29:00 PM - 1 minute ago
kitchen_light_sw3 Action
7:29:00 PM - 1 minute ago
Kitchen 3 button test triggered by state of kitchen_light_sw3 Action
7:29:00 PM - 1 minute ago
kitchen_light_sw3 Action changed to 1_single
7:29:00 PM - 1 minute ago
Kitchen 3 button test triggered by state of Kitchen 3 button test turned on
7:28:47 PM - 1 minute ago
Kitchen 3 button test triggered by state of kitchen_light_sw3 Action

Try with mode “queued“, instead of restart. My 4 button switch send a blank massage right after the actual button, triggering a restart of the automation.

1 Like

Try with mode “ queued“, in-sted of restart. My 4 button switch send a blank massage right arter the actual button, triggering a restart of the automation.

That fixed it! Thank you!

  source_url: https://github.com/AramidX/ha-blueprint/blob/8e259f8e40ab1218f06ea1ce1d1444f67b4cd62f/blueprints/tuya/loratap_ss600zb_wireless_switch_z2m.yaml
mode: queued
max_exceeded: silent

Of course if you look in your logs it is spamming junk in there because of the triggers that don’t do anything.
To clean this up, add a condition statement that lists all the valid triggers and ignores all the invalid triggers, making things work properly.
See examples in my stuff for inspiration:

Replacing “restart” with “queued” fixed it

As I stated, your buttons work, but did you look at the mess the false triggers are doing to your logs, possibly masking other problems?
Just trying to help you out.

Moved ti the correct topic as the Blueprint Exchange it intended for sharing blueprints.

I posted the BLUEPRINT. The actions are assigned. It didn’t work at all until i changed the Restart to Queued.