Moes 4-Button Scene Controller - Zigbee2MQTT (Model: TS0044)

Moes 4-Button Scene Switch Z2M (TS0044) Blueprint

Easily Automate TS0044 Devices Paired via Zigbee2MQTT (Z2M)

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

Description

This blueprint is designed for the Moes 4-Button Scene Switch (TS0044), integrated with Zigbee2MQTT. It condenses all 12 unique button actions for a Scene Switch into a single, easy-to-maintain automation. It supports the following actions for each button:

  • Single Press – single_press
  • Double Press – double_press
  • Hold – hold_press

This blueprint allows you to quickly and easily configure multiple actions for each button on the scene switch, making it a versatile tool for managing your smart home devices.

Prerequisites

Ensure your device is properly integrated with Zigbee2MQTT. You’ll need to locate the MQTT topic associated with your scene switch before setting up the blueprint.

Note:

  • To expose the actions in Z2M for use in Home Assistant automations, I needed to manually select each button/action on the Scene Switch (e.g., single-click, double-click, and hold every button on the device following initial pairing with Z2M). Without this step, Home Assistant didn’t seem to recognize the actions in the automation YAML.

  • If you run into this issue, try this out to see if the actions are exposed and registered in Home Assistant. If that doesn’t work, try trailing the Z2M logs and monitor action payloads to that MQTT topic. Every payload reference for each value_template in the YAML below should match the actions exposed by your device.

Steps to find your device’s MQTT topic:

  1. Navigate to the Zigbee2MQTT integration in Home Assistant.
  2. Select “Logs” from the ribbon header.
  3. Press any button on your Moes Scene Switch.
  4. Locate the latest log entry and note the MQTT topic displayed.

Device Information:

  • Manufacturer: Moes / Tuya
  • Device Type: 4-Button Scene Switch
  • Model: TS0044
  • Zigbee Manufacturer: _TZ3000_wkai4ga5
  • Zigbee2MQTT Device Info: Link to TS0044
  • Switch Button Action Correlations:
    1. Top-Left
    2. Top-Right
    3. Bottom-Left
    4. Bottom-Right

How to Use

  1. Import: Select the “Import Blueprint” button at the top of this post.
  2. Configure: Use the MQTT topic you found earlier in the “switch_topic” field. Assign actions to each button press (single, double, or hold) using the blueprint inputs.
  3. Test: Save and test your automation. If you run into any issues, feel free to leave a comment below.

Blueprint YAML

blueprint:
  name: Moes/Tuya 4-Button Scene Switch (TS0044)
  description: >
    Controls various entities based on single and double press actions from a Moes 4-Button Scene Switch.
  domain: automation
  input:
    switch_topic:
      name: MQTT Topic
      description: The MQTT topic for the scene switch.
      selector:
        text:
    single_1:
      name: Action for 1 Single Press
      description: Action to run when button 1 is single pressed.
      selector:
        action: {}
    single_2:
      name: Action for 2 Single Press
      description: Action to run when button 2 is single pressed.
      selector:
        action: {}
    single_3:
      name: Action for 3 Single Press
      description: Action to run when button 3 is single pressed.
      selector:
        action: {}
    single_4:
      name: Action for 4 Single Press
      description: Action to run when button 4 is single pressed.
      selector:
        action: {}
    double_1:
      name: Action for 1 Double Press
      description: Action to run when button 1 is double pressed.
      selector:
        action: {}
    double_2:
      name: Action for 2 Double Press
      description: Action to run when button 2 is double pressed.
      selector:
        action: {}
    double_3:
      name: Action for 3 Double Press
      description: Action to run when button 3 is double pressed.
      selector:
        action: {}
    double_4:
      name: Action for 4 Double Press
      description: Action to run when button 4 is double pressed.
      selector:
        action: {}
    hold_1:
      name: Action for 1 hold Press
      description: Action to run when button 1 is held.
      selector:
        action: {}
    hold_2:
      name: Action for 2 hold Press
      description: Action to run when button 2 is held.
      selector:
        action: {}
    hold_3:
      name: Action for 3 hold Press
      description: Action to run when button 3 is held.
      selector:
        action: {}
    hold_4:
      name: Action for 4 hold Press
      description: Action to run when button 4 is held.
      selector:
        action: {}

trigger:
  - platform: mqtt
    topic: !input switch_topic

action:
  - choose:
      - conditions:
          - condition: template
            value_template: "{{ trigger.payload == '1_single' }}"
        sequence: !input single_1

      - conditions:
          - condition: template
            value_template: "{{ trigger.payload == '2_single' }}"
        sequence: !input single_2

      - conditions:
          - condition: template
            value_template: "{{ trigger.payload == '3_single' }}"
        sequence: !input single_3

      - conditions:
          - condition: template
            value_template: "{{ trigger.payload == '4_single' }}"
        sequence: !input single_4

      - conditions:
          - condition: template
            value_template: "{{ trigger.payload == '1_double' }}"
        sequence: !input double_1

      - conditions:
          - condition: template
            value_template: "{{ trigger.payload == '2_double' }}"
        sequence: !input double_2

      - conditions:
          - condition: template
            value_template: "{{ trigger.payload == '3_double' }}"
        sequence: !input double_3

      - conditions:
          - condition: template
            value_template: "{{ trigger.payload == '4_double' }}"
        sequence: !input double_4

      - conditions:
          - condition: template
            value_template: "{{ trigger.payload == '1_hold' }}"
        sequence: !input hold_1

      - conditions:
          - condition: template
            value_template: "{{ trigger.payload == '2_hold' }}"
        sequence: !input hold_2

      - conditions:
          - condition: template
            value_template: "{{ trigger.payload == '3_hold' }}"
        sequence: !input hold_3

      - conditions:
          - condition: template
            value_template: "{{ trigger.payload == '4_hold' }}"
        sequence: !input hold_4

mode: single
1 Like

What did you mean with Mqtt Topic ?

in my logs shows ( 2024-09-28 14:50:18z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/Moes Szene Switch/action', payload '1_hold'

Info 2024-09-28 14:50:32z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/Moes Szene Switch', payload '{"action":"1_single","battery":100,"last_seen":"2024-09-28T14:50:32+02:00","linkquality":136,"voltage":3000}'

Info 2024-09-28 14:50:32z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/Moes Szene Switch', payload '{"action":"","battery":100,"last_seen":"2024-09-28T14:50:32+02:00","linkquality":136,"voltage":3000}'

Info 2024-09-28 14:50:32z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/Moes Szene Switch/action', payload '1_single'

trying to test with only one action

same here. it appears to be broken

This is the only solution which has worked for me!

Here is how I got it working!

I had a name in Z2M which had spaces so the topic had spaces and that did NOT WORK. Next thing is I was unable to save as seen in @dimacoupe screenshot, however after adding an item to every single option I was able to save and finally trigger all these buttons. Then after initial save then I went and removed the action on the buttons I didn’t want and everything works!

Working to see if there is a way to fix the underlying automation from not saving unless there is a value in every single button command as we speak and will update here

This (save bug) seems like a bug in HA and not the blueprint from what I can see so not sure how to fix it. But it only causes issue for first save and my workaround fixed it