ZHA - Cleverio/Tuya 1-Button Scene Switch TS0041A _TYZB01_4qw4rl1u

blueprint:
  name: ZHA - Tuya 1-Button Scene Switch ("Cleverio") ( _TYZB01_4qw4rl1u)
  description: Automate your Tuya 1-Button Scene Switch using ZHA events.
  domain: automation
  input:
    tuya_1button_scene_switch:
      name: Tuya 1-Button Scene Switch
      description: Tuya 1-Button Scene Switch to use
      selector:
        device:
          integration: zha
          manufacturer:  _TYZB01_4qw4rl1u
          model: TS0041A
          multiple: false
    button_one_short_press:
      name: Button, single press
      description: Action to run on button single press
      default: []
      selector:
        action: {}
    button_one_double_press:
      name: Button, double press
      description: Action to run on button double press
      default: []
      selector:
        action: {}
    button_one_long_press:
      name: Button, long press
      description: Action to run on button long press
      default: []
      selector:
        action: {}
  source_url: https://community.home-assistant.io/t/zha-cleverio-tuya-1-button-scene-switch-tyzb01-4qw4rl1u/552120
mode: restart
max_exceeded: silent
trigger:
- platform: event
  event_type: zha_event
  event_data:
    device_id: !input tuya_1button_scene_switch
action:
- variables:
    command: '{{ trigger.event.data.command }}'
    endpoint_id: '{{ trigger.event.data.endpoint_id }}'
- choose:
  - conditions: '{{ command == ''remote_button_short_press'' }}'
    sequence:
    - choose:
      - conditions: '{{ endpoint_id == 1 }}'
        sequence: !input button_one_short_press
  - conditions: '{{ command == ''remote_button_double_press'' }}'
    sequence:
    - choose:
      - conditions: '{{ endpoint_id == 1 }}'
        sequence: !input button_one_double_press
  - conditions: '{{ command == ''remote_button_long_press'' }}'
    sequence:
    - choose:
      - conditions: '{{ endpoint_id == 1 }}'
        sequence: !input button_one_long_press