Blueprint - Zigbee2MQTT - Tuya 3-button Scene Switch (TS0043)

Supported actions for each button:

  1. Short press
  2. Double press
  3. Long press (5 seconds)

Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

blueprint:
  name: Zigbee2MQTT - Tuya 3-Button Scene Switch
  description: Automate your Tuya 3-Button Scene Switch via Zigbee2MQTT. Version 280524-1
  domain: automation
  input:
    switch:
      name: Tuya 3-Button Scene Switch
      description: Tuya 3-Button Scene Switch to use
      selector:
        entity:
          integration: mqtt
          domain:
          - sensor
          multiple: false
    button_one_short_press:
      name: Single Press - Button 1
      description: Action to run on button 1 (left) single press
      default: []
      selector:
        action: {}
    button_one_double_press:
      name: Double Press - Button 1
      description: Action to run on button 1 (left) double press
      default: []
      selector:
        action: {}
    button_one_long_press:
      name: Long Press - Button 1
      description: Action to run on button 1 (left) long press
      default: []
      selector:
        action: {}
    button_two_short_press:
      name: Single Press - Button 2
      description: Action to run on button 2 (middle) single press
      default: []
      selector:
        action: {}
    button_two_double_press:
      name: Double Press - Button 2
      description: Action to run on button 2 (middle) double press
      default: []
      selector:
        action: {}
    button_two_long_press:
      name: Long Press - Button 2
      description: Action to run on button 3 (middle) long press
      default: []
      selector:
        action: {}
    button_three_short_press:
      name: Single Press - Button 3
      description: Action to run on button 3 (right) single press
      default: []
      selector:
        action: {}
    button_three_double_press:
      name: Double Press - Button 3
      description: Action to run on button 3 (right) double press
      default: []
      selector:
        action: {}
    button_three_long_press:
      name: Long Press - Button 3
      description: Action to run on button 3 (right) long press
      default: []
      selector:
        action: {}        
  source_url: https://github.com/piwi3910/HA_blueprints/blob/c031a5a529a62f2675dfccb3697d017f71eff9d8/blueprints/Tuya-3button-ts0043.yaml
mode: restart
max_exceeded: silent
trigger:
- platform: state
  entity_id: !input switch
  attribute: action
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