ZHA - MOES ZigBee Wireless Scene Switch | 3 button remote (TS0043) powered by Tuya

Blueprint for the MOES ZigBee (TS0043) 3 button remote. It supports single and double press actions on all 3 buttons.

Blueprint Code

Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.
Click the badge to import this Blueprint: (needs Home Assistant Core 2021.3 or higher)
Or import this Blueprint by using the forum topic / Gist URL:

blueprint:
  name: MOES ZigBee (TS0043) 3 button remote
  description: Automate your MOES ZigBee Wireless Scene Switch 3 button remote using
    ZHA events.
  domain: automation
  input:
    moes_ts0043:
      name: Moes TS0043 3 button remote
      description: Moes TS0043 3 button remote to use
      selector:
        device:
          integration: zha
          manufacturer: _TZ3000_gbm10jnj
          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 'moes_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'
2 Likes

Hi Prash,

Got this to work with my MOES TS0042 2-button remote and modified your blueprint slightly to accommodate this slightly different switch and it works brilliantly!

blueprint:
  name: MOES ZigBee (TS0042) 2 button remote
  description: Automate your MOES ZigBee Wireless Scene Switch 2 button remote using
    ZHA events.
  domain: automation
  input:
    moes_ts0042:
      name: Moes TS0042 2 button remote
      description: Moes TS0042 2 button remote
      selector:
        device:
          integration: zha
          manufacturer: _TZ3000_5e235jpa
          model: TS0042
          multiple: false
    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: {}
  source_url: https://community.home-assistant.io/t/zha-moes-zigbee-wireless-scene-switch-3-button-remote-ts0043-powered-by-tuya/512399
mode: restart
max_exceeded: silent
trigger:
- platform: event
  event_type: zha_event
  event_data:
    device_id: !input moes_ts0042
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

Thanks!

1 Like

Great to hear this helped

1 Like

I’ve been working with @denhamcoote at his request to port my HUE smartbutton multi-press blueprint to these Moes buttons if you want to try it out @Prash @AndyWhittaker

Unfortunately I don’t own these buttons so I can’t test it myself but here’s my first rough draft:

Due to the nature of it allowing 5 presses altogether, it treats single and double press events the same for now. Until I find a better way to handle this you need to try and time your button presses slower to not register a “Moes double press”

2 Likes

Thanks, I believe this means you can have it register combined key button presses for an action, if I understood it correctly?

You get 5 presses/actions per button + a hold action.

It comes with some hue smartbutton-like logic built in, so you can assign the button to a light to toggle it on/off or press it up to 5 times to cycle through scenes. If you don’t want that you just have 5 different assignable actions for the presses instead

2 Likes

Got this as a Blueprint to share?