ZHA - Tuya TS0043 3 button remote

Tags: #<Tag:0x00007f326e265780> #<Tag:0x00007f326e2655f0>

Blueprint for the Tuya TS0043 3 button remote. It supports single and double press actions on all 3 buttons.

grafik

blueprint:
  name: ZHA - Tuya TS0043 3 button remote
  description: Automate your Tuya TS0043 3 button remote using
    ZHA events.
  domain: automation
  input:
    tuya_ts0043:
      name: Tuya TS0043 3 button remote
      description: Tuya TS0043 3 button remote to use
      selector:
        device:
          integration: zha
          manufacturer: _TZ3000_bi6lpsew
          model: TS0043
    button_one_single_press:
      name: Button 1 (single press)
      description: Action to run on button 1 single press
      default: []
      selector:
        action: {}
    button_one_double_press:
      name: Button 1 (double press)
      description: Action to run on button 1 double press
      default: []
      selector:
        action: {}
    button_two_single_press:
      name: Button 2 (single press)
      description: Action to run on button 2 single press
      default: []
      selector:
        action: {}
    button_two_double_press:
      name: Button 2 (double press)
      description: Action to run on button 2 double press
      default: []
      selector:
        action: {}
    button_three_single_press:
      name: Button 3 (single press)
      description: Action to run on button 3 single press
      default: []
      selector:
        action: {}
    button_three_double_press:
      name: Button 3 (double press)
      description: Action to run on button 3 double press
      default: []
      selector:
        action: {}
mode: restart
max_exceeded: silent
trigger:
- platform: event
  event_type: zha_event
  event_data:
    device_id: !input 'tuya_ts0043'
action:
  - variables:
      command: '{{ trigger.event.data.command }}'
      endpoint_id: '{{ trigger.event.data.endpoint_id }}'
  - choose:
    - conditions:
        - '{{ command == ''remote_button_short_press'' and endpoint_id == 1 }}'
      sequence: !input 'button_one_single_press'
    - conditions:
        - '{{ command == ''remote_button_double_press'' and endpoint_id == 1 }}'
      sequence: !input 'button_one_double_press'
    - conditions:
        - '{{ command == ''remote_button_short_press'' and endpoint_id == 2 }}'
      sequence: !input 'button_two_single_press'
    - conditions:
        - '{{ command == ''remote_button_double_press'' and endpoint_id == 2 }}'
      sequence: !input 'button_two_double_press'
    - conditions:
        - '{{ command == ''remote_button_short_press'' and endpoint_id == 3 }}'
      sequence: !input 'button_three_single_press'
    - conditions:
        - '{{ command == ''remote_button_double_press'' and endpoint_id == 3 }}'
      sequence: !input 'button_three_double_press'
1 Like

Thanks for publishing this! Works perfectly for me. I added the long press commands for each button as well and continues to work well in my installation.

blueprint:
  name: ZHA - Tuya TS0043 3 button remote
  description: Automate your Tuya TS0043 3 button remote using
    ZHA events.
  domain: automation
  input:
    tuya_ts0043:
      name: Tuya TS0043 3 button remote
      description: Tuya TS0043 3 button remote to use
      selector:
        device:
          integration: zha
          manufacturer: _TZ3000_bi6lpsew
          model: TS0043
    button_one_single_press:
      name: Button 1 (single press)
      description: Action to run on button 1 single press
      default: []
      selector:
        action: {}
    button_one_double_press:
      name: Button 1 (double press)
      description: Action to run on button 1 double press
      default: []
      selector:
        action: {}
    button_one_long_press:
      name: Button 1 (long press)
      description: Action to run on button 1 long press
      default: []
      selector:
        action: {}
    button_two_single_press:
      name: Button 2 (single press)
      description: Action to run on button 2 single press
      default: []
      selector:
        action: {}
    button_two_double_press:
      name: Button 2 (double press)
      description: Action to run on button 2 double press
      default: []
      selector:
        action: {}
    button_two_long_press:
      name: Button 2 (long press)
      description: Action to run on button 2 long press
      default: []
      selector:
        action: {}
    button_three_single_press:
      name: Button 3 (single press)
      description: Action to run on button 3 single press
      default: []
      selector:
        action: {}
    button_three_double_press:
      name: Button 3 (double press)
      description: Action to run on button 3 double press
      default: []
      selector:
        action: {}
    button_three_long_press:
      name: Button 3 (long press)
      description: Action to run on button 3 long press
      default: []
      selector:
        action: {}
mode: restart
max_exceeded: silent
trigger:
- platform: event
  event_type: zha_event
  event_data:
    device_id: !input 'tuya_ts0043'
action:
  - variables:
      command: '{{ trigger.event.data.command }}'
      endpoint_id: '{{ trigger.event.data.endpoint_id }}'
  - choose:
    - conditions:
        - '{{ command == ''remote_button_short_press'' and endpoint_id == 1 }}'
      sequence: !input 'button_one_single_press'
    - conditions:
        - '{{ command == ''remote_button_double_press'' and endpoint_id == 1 }}'
      sequence: !input 'button_one_double_press'
    - conditions:
        - '{{ command == ''remote_button_long_press'' and endpoint_id == 1 }}'
      sequence: !input 'button_one_long_press'
    - conditions:
        - '{{ command == ''remote_button_short_press'' and endpoint_id == 2 }}'
      sequence: !input 'button_two_single_press'
    - conditions:
        - '{{ command == ''remote_button_double_press'' and endpoint_id == 2 }}'
      sequence: !input 'button_two_double_press'
    - conditions:
        - '{{ command == ''remote_button_long_press'' and endpoint_id == 2 }}'
      sequence: !input 'button_two_long_press'
    - conditions:
        - '{{ command == ''remote_button_short_press'' and endpoint_id == 3 }}'
      sequence: !input 'button_three_single_press'
    - conditions:
        - '{{ command == ''remote_button_double_press'' and endpoint_id == 3 }}'
      sequence: !input 'button_three_double_press'
    - conditions:
        - '{{ command == ''remote_button_long_press'' and endpoint_id == 3 }}'
      sequence: !input 'button_three_long_press'