ZHA - Tuya 2-button Scene Switch (TS0041)

Another rip-off from Stringer 4 button switch :slight_smile:

Supported actions for each button:

  1. Short press
  2. Double press
  3. Long press (5 seconds)
blueprint:
  name: ZHA - Tuya 1-Button Scene Switch
  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: _TZ3000_4upl1fcj
          model: TS0041
    button_one_short_press:
      name: Single Press
      description: Action to run on button 1 (left) single press
      default: []
      selector:
        action: {}
    button_one_double_press:
      name: Double Press
      description: Action to run on button 1 left) double press
      default: []
      selector:
        action: {}
    button_one_long_press:
      name: Long Press
      description: Action to run on button 1 (left) long press
      default: []
      selector:
         action: {}
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'
1 Like

I presume you mean โ€œ1-buttonโ€? There is mention of โ€œleftโ€, but not right. And as a side note worked beautifully on my 1-button switch, so thanks! :slight_smile:

I imported the blueprint OK and set up an automation so that a single press toggles a light. However, the automation is never triggered. Did I miss a step?

Hi, I have a _TZ3000_qgwcxxws. Teoreticaly, the same buttom.
But it does not show when I try to make an automation.
Is it posible to make a more generic blueprint ?

And how can I modify this to fit mi buttom ? I tried copy and paste on the YAML editor, but HA refuses to save with the message:
Message malformed: Missing input tuya_1button_scene_switch

Thanks