-
-
Save HugoGresse/9e3097109c50d561b16e5a558b2f0678 to your computer and use it in GitHub Desktop.
Zigbee2MQTT - Tuya 4-Button Scene Switch blueprint for Homassistant
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
blueprint: | |
name: Tuya Zigbee 4 button remote | |
description: "Blueprint for use with Tuya Zigbee 4 button remote (TS0044_1) on Zigbee2MQTT" | |
domain: automation | |
input: | |
switch: | |
name: Tuya Zigbee 4 button remote | |
description: Tuya Zigbee 4 button remote to use | |
selector: | |
entity: | |
button_1_short_press: | |
name: Single Press - Button 1 | |
description: Action to run on button 1 single press | |
default: [] | |
selector: | |
action: null | |
button_1_hold: | |
name: Hold - Button 1 | |
description: Action to run on button 1 long press | |
default: [] | |
selector: | |
action: null | |
button_1_double_press: | |
name: Double Press - Button 1 | |
description: Action to run on button 1 double press | |
default: [] | |
selector: | |
action: null | |
button_2_short_press: | |
name: Single Press - Button 2 | |
description: Action to run on button 2 single press | |
default: [] | |
selector: | |
action: null | |
button_2_hold: | |
name: Hold - Button 2 | |
description: Action to run on button 2 long press | |
default: [] | |
selector: | |
action: null | |
button_2_double_press: | |
name: Double Press - Button 2 | |
description: Action to run on button 2 double press | |
default: [] | |
selector: | |
action: null | |
button_3_short_press: | |
name: Single Press - Button 3 | |
description: Action to run on button 3 single press | |
default: [] | |
selector: | |
action: null | |
button_3_hold: | |
name: Hold - Button 3 | |
description: Action to run on button 3 long press | |
default: [] | |
selector: | |
action: null | |
button_3_double_press: | |
name: Double Press - Button 3 | |
description: Action to run on button 3 double press | |
default: [] | |
selector: | |
action: null | |
button_4_short_press: | |
name: Single Press - Button 4 | |
description: Action to run on button 4 single press | |
default: [] | |
selector: | |
action: null | |
button_4_hold: | |
name: Long Press - Button 4 | |
description: Action to run on button 4 long press | |
default: [] | |
selector: | |
action: null | |
button_4_double_press: | |
name: Double Press - Button 4 | |
description: Action to run on button 4 double press | |
default: [] | |
selector: | |
action: null | |
mode: queued | |
trigger: | |
- platform: state | |
entity_id: !input switch | |
condition: | |
- "{{ trigger.to_state.state != '' }}" | |
action: | |
- variables: | |
command: "{{ trigger.to_state.state }}" | |
- choose: | |
- conditions: | |
- "{{ command == '1_single' }}" | |
sequence: !input button_1_short_press | |
- conditions: | |
- "{{ command == '1_double' }}" | |
sequence: !input button_1_double_press | |
- conditions: | |
- "{{ command == '1_hold' }}" | |
sequence: !input button_1_hold | |
- conditions: | |
- "{{ command == '2_single' }}" | |
sequence: !input button_2_short_press | |
- conditions: | |
- "{{ command == '2_double' }}" | |
sequence: !input button_2_double_press | |
- conditions: | |
- "{{ command == '2_hold' }}" | |
sequence: !input button_2_hold | |
- conditions: | |
- "{{ command == '3_single' }}" | |
sequence: !input button_3_short_press | |
- conditions: | |
- "{{ command == '3_double' }}" | |
sequence: !input button_3_double_press | |
- conditions: | |
- "{{ command == '3_hold' }}" | |
sequence: !input button_3_hold | |
- conditions: | |
- "{{ command == '4_single' }}" | |
sequence: !input button_4_short_press | |
- conditions: | |
- "{{ command == '4_double' }}" | |
sequence: !input button_4_double_press | |
- conditions: | |
- "{{ command == '4_hold' }}" | |
sequence: !input button_4_hold |
Hi @Gittyflo you can fork it and adjust to your needs. I have planned to buy MOES 1 or 2 gangs wall buttons (220v) but later this year.
THANKS
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, I tried it with the new Z2MQTT in HA 2025,- I can see the Actions are detected but it does not execute the scenes or device states...
I believe it has to do with the change that only actions are used,- I have the MOES 4 Gang. Any idea how to edit the Yaml? THX