Photo: Moes 4 button switch (numbers = button numbers)
Quick Import:
WHAT IS IT?
My first blueprint!
A blueprint that enables you to quickly configure switches. It also is a lot easier to look at compared to manual events in an automation.
It was inspired by sherlocks blueprint.
Updates:
→No MQTT topic needed
→Actions grouped per button (see screenshot below)
→The least amount of text possible. (well you could use less text)
SETUP
- Import blueprint - Click the button above.
- Open blueprint
- Select switch - listed in the switch dropdown
- Configure actions - for each button
- Save
- Test
REQUIREMENTS
- Zigbee2MQTT
- Supported switch
DEVICE INFO
- Manufacturer: Tuya / Moes / Loratap / Nedis
- Model: TS0044
- Zigbee2MQTT: info
- Buttons: 4
- Supported actions:
â—‹ single click
â—‹ double click
â—‹ long click
NOTES
- Which switch? This works for the “fancy” switches like Moes as well as the ultra cheap, wobbely Tuya switches. There is a BIG difference between these switches.
- Single switch: I have not enabled multiple switches in a single automation
- Switch not visible? Open the switch device page. On the top left you should see (exactly) `Wireless switch with 4 buttons (TS0044) by Tuya’. If it doesn’t it may be a slightly different model.
TIP
- Use a labelmaker to print labels with icons, numbers or text. Great for the WAF and KAF.
- Mounting: I use very thin nano tape (see through / gel type) to put them on a wall. The factory default mounting tape often is impossible to take off.
BLUEPRINT YAML
blueprint:
name: _Zigbee2MQTT [Z2M] Tuya 4-Button Switch TS0044 ULTRA by DJF3
description: "Z2M blueprint for the <strong>Tuya 4-Button wireless remote switch TS0044</strong>.<br>
\ No MQTT topic or Helper needed. version 0.96: simplification in blueprint text<br>
\ Device info: [TS0044](https://www.zigbee2mqtt.io/devices/TS0044.html)
\n
\n .---.---. SUPPORTED:
\n | 1 | 2 | - single click
\n |---|---| - double click
\n | 3 | 4 | - long click
\n '---'---'\n"
author: DJ Uittenbogaard
homeassistant:
min_version: 2025.3.0
domain: automation
input:
your_remote:
name: "Select your Tuya 4-button remote"
description: ""
selector:
device:
filter:
- integration: mqtt
model: Wireless switch with 4 buttons
multiple: false
button1_section:
name: BUTTON 1 (top-left)
icon: mdi:numeric-1-box-outline
collapsed: true
input:
input_button1_single:
name: Button 1 - SINGLE click
description: ""
default: []
selector:
action: {}
input_button1_double:
name: Button 1 - DOUBLE click
description: ""
default: []
selector:
action: {}
input_button1_long:
name: Button 1 - LONG click
description: ""
default: []
selector:
action: {}
button2_section:
name: BUTTON 2 (top-right)
icon: mdi:numeric-2-box-outline
collapsed: true
input:
input_button2_single:
name: Button 2 - SINGLE click
description: ""
default: []
selector:
action: {}
input_button2_double:
name: Button 2 - DOUBLE click
description: ""
default: []
selector:
action: {}
input_button2_long:
name: Button 2 - LONG click
description: ""
default: []
selector:
action: {}
button3_section:
name: BUTTON 3 (bottom-left)
icon: mdi:numeric-3-box-outline
collapsed: true
input:
input_button3_single:
name: Button 3 - SINGLE click
description: ""
default: []
selector:
action: {}
input_button3_double:
name: Button 3 - DOUBLE click
description: ""
default: []
selector:
action: {}
input_button3_long:
name: Button 3 - LONG click
description: ""
default: []
selector:
action: {}
button4_section:
name: BUTTON 4 (bottom-right)
icon: mdi:numeric-4-box-outline
collapsed: true
input:
input_button4_single:
name: Button 4 - SINGLE click
description: ""
default: []
selector:
action: {}
input_button4_double:
name: Button 4 - DOUBLE click
description: ""
default: []
selector:
action: {}
input_button4_long:
name: Button 4 - LONG click
description: ""
default: []
selector:
action: {}
mode: single
trigger:
# ------- Button 1
- domain: mqtt
device_id: !input your_remote
type: action
subtype: 1_single
id: 1_single
trigger: device
- domain: mqtt
device_id: !input your_remote
type: action
subtype: 1_double
id: 1_double
trigger: device
- domain: mqtt
device_id: !input your_remote
type: action
subtype: 1_hold
id: 1_hold
trigger: device
# ------- Button 2
- domain: mqtt
device_id: !input your_remote
type: action
subtype: 2_single
id: 2_single
trigger: device
- domain: mqtt
device_id: !input your_remote
type: action
subtype: 2_double
id: 2_double
trigger: device
- domain: mqtt
device_id: !input your_remote
type: action
subtype: 2_hold
id: 2_hold
trigger: device
# ------- Button 3
- domain: mqtt
device_id: !input your_remote
type: action
subtype: 3_single
id: 3_single
trigger: device
- domain: mqtt
device_id: !input your_remote
type: action
subtype: 3_double
id: 3_double
trigger: device
- domain: mqtt
device_id: !input your_remote
type: action
subtype: 3_hold
id: 3_hold
trigger: device
# ------- Button 4
- domain: mqtt
device_id: !input your_remote
type: action
subtype: 4_single
id: 4_single
trigger: device
- domain: mqtt
device_id: !input your_remote
type: action
subtype: 4_double
id: 4_double
trigger: device
- domain: mqtt
device_id: !input your_remote
type: action
subtype: 4_hold
id: 4_hold
trigger: device
conditions: []
actions:
- choose:
# ------- Button 1
- conditions:
- condition: trigger
id:
- 1_single
sequence: !input input_button1_single
- conditions:
- condition: trigger
id:
- 1_double
sequence: !input input_button1_double
- conditions:
- condition: trigger
id:
- 1_hold
sequence: !input input_button1_long
# ------- Button 2
- conditions:
- condition: trigger
id:
- 2_single
sequence: !input input_button2_single
- conditions:
- condition: trigger
id:
- 2_double
sequence: !input input_button2_double
- conditions:
- condition: trigger
id:
- 2_hold
sequence: !input input_button2_long
# ------- Button 3
- conditions:
- condition: trigger
id:
- 3_single
sequence: !input input_button3_single
- conditions:
- condition: trigger
id:
- 3_double
sequence: !input input_button3_double
- conditions:
- condition: trigger
id:
- 3_hold
sequence: !input input_button3_long
# ------- Button 4
- conditions:
- condition: trigger
id:
- 4_single
sequence: !input input_button4_single
- conditions:
- condition: trigger
id:
- 4_double
sequence: !input input_button4_double
- conditions:
- condition: trigger
id:
- 4_hold
sequence: !input input_button4_long
Other blueprints that I created:
Questions or comments? Let me know!