deCONZ - Tuya TS0044 4-button scene switch

This is a blueprint for the Tuya TS0044 4-button scene switch.
It supports single push, double push and long push actions.

blueprint:
  name: deCONZ - Tuya TS0044  4-button scene switch
  description: Automate your Tuya TS0044 4 button scene switch using deCONZ events.
  domain: automation
  input:
    tuya_ts0044:
      name: Tuya TS0044 4 button scene switch
      description: Tuya TS0044 4 button scene switch to use
      selector:
        device:
          integration: deconz
          manufacturer: _TZ3000_vp6clf9d
          model: TS0044
    button_one_long_press:
      name: Button 1 (long press)
      description: Action to run on button 1 (lower-left) long press
      default: []
      selector:
        action: {}
    button_one_single_press:
      name: Button 1 (single press)
      description: Action to run on button 1 (lower-left) single press
      default: []
      selector:
        action: {}
    button_one_double_press:
      name: Button 1 (double press)
      description: Action to run on button 1 (lower-left) double press
      default: []
      selector:
        action: {}
    button_two_long_press:
      name: Button 2 (long press)
      description: Action to run on button 2 (lower-right) long press
      default: []
      selector:
        action: {}
    button_two_single_press:
      name: Button 2 (single press)
      description: Action to run on button 2 (lower-right) single press
      default: []
      selector:
        action: {}
    button_two_double_press:
      name: Button 2 (double press)
      description: Action to run on button 2 (lower-right) double press
      default: []
      selector:
        action: {}
    button_three_long_press:
      name: Button 3 (long press)
      description: Action to run on button 3 (upper-right) long press
      default: []
      selector:
        action: {}
    button_three_single_press:
      name: Button 3 (single press)
      description: Action to run on button 3 (upper-right) single press
      default: []
      selector:
        action: {}
    button_three_double_press:
      name: Button 3 (double press)
      description: Action to run on button 3 (upper-right) double press
      default: []
      selector:
        action: {}
    button_four_long_press:
      name: Button 4 (long press)
      description: Action to run on button 4 (upper-left) long press
      default: []
      selector:
        action: {}
    button_four_single_press:
      name: Button 4 (single press)
      description: Action to run on button 4 (upper-left) single press
      default: []
      selector:
        action: {}
    button_four_double_press:
      name: Button 4 (double press)
      description: Action to run on button 4 (upper-left) double press
      default: []
      selector:
        action: {}  
mode: restart
max_exceeded: silent
trigger:
- platform: event
  event_type: deconz_event
  event_data:
    device_id: !input 'tuya_ts0044'
action:
- variables:
    event: '{{ trigger.event.data.event }}'
- choose:
  - conditions:
    - '{{ event == 1003 }}'
    sequence: !input 'button_one_long_press'  
  - conditions:
    - '{{ event == 1002 }}'
    sequence: !input 'button_one_single_press'
  - conditions:
    - '{{ event == 1004 }}'
    sequence: !input 'button_one_double_press'
  - conditions:
    - '{{ event == 2003 }}'
    sequence: !input 'button_two_long_press'
  - conditions:
    - '{{ event == 2002 }}'
    sequence: !input 'button_two_single_press'
  - conditions:
    - '{{ event == 2004 }}'
    sequence: !input 'button_two_double_press'
  - conditions:
    - '{{ event == 3003 }}'
    sequence: !input 'button_three_long_press'
  - conditions:
    - '{{ event == 3002 }}'
    sequence: !input 'button_three_single_press'
  - conditions:
    - '{{ event == 3004 }}'
    sequence: !input 'button_three_double_press'
  - conditions:
    - '{{ event == 4003 }}'
    sequence: !input 'button_four_long_press'
  - conditions:
    - '{{ event == 4002 }}'
    sequence: !input 'button_four_single_press'
  - conditions:
    - '{{ event == 4004 }}'
    sequence: !input 'button_four_double_press'

3 Likes

Hi @Peter1979

Thanks for this blueprint. I used it and it works great!

Boris

How do i use it, tried and does not work

Hi @Peter1979 ,

I have downloaded your blueprint and it is not working, can you teach me how to use it? I am new to this…

Hi

Tried to add the blueprint - no issue there.

Then added a persistent notification fort a single button short press… There I get 2 notifications?

Debugging in DeCONZ shows:

11:21:35:113 [INFO] - No button handler for: TS0044, unicast to: 0x0000, endpoint: 0x01, cluster: 0x0001, command: 0x0A, payload: 210020C8, zclSeq: 126
11:21:35:114 ZCL attribute report 0x5C0272FFFEC8951B for cluster: 0x0001, ep: 0x01, frame control: 0x08, mfcode: 0x0000 
11:21:35:420 [INFO] - Button 1002 - TS0044, unicast to: 0x0000, endpoint: 0x01, cluster: ONOFF (0x0006), action: B1 short, payload: 00, zclSeq: 127
11:21:36:425 [INFO] - Button 1002 - TS0044, unicast to: 0x0000, endpoint: 0x01, cluster: ONOFF (0x0006), action: B1 short, payload: 00, zclSeq: 127
11:21:37:921 skip binding for attribute reporting of ep: 0x00 cluster 0x1000 (end-device might sleep)

So is the problem in DeCONZ ?

Sorry, i have no idea. Did you update DeConz and phoscon to the latest version?

Seems to be a bug in DeCONZ … Will wait for a newer release

I was able to add the device to conbee, but it sees the device as one button (4 gang device). How can I add itto have all four buttons? Or can I do that in Home assistant once it is connected?

How do I use this blueprint?

Thanks

1 Like

For anyone who has a different model which doesnt show up within bueprint / automation:

open /config/blueprints/automation/Peter1979/deconz-tuya-ts0044-4-button-scene-switch.yaml

change the line :manufacturer: _TZ3000_vp6clf9d to your model;
to
your model; for example: manufacturer: _TZ3000_wkai4ga5

3 Likes

Came here to post this, but see someone beat me to it. Can confirm this works as well…great blueprint!

Added device through Deconz/Phoscon, Its working in HA cause I can see the device and the events fired. Its discovered in Phoscon/Deconz and HA as: _TZ3000_wkai4ga5

Changed the Manufacturer name in the blueprint yaml to: _TZ3000_wkai4ga5
Rebooted (don’t know if required)
But when creating an automation through the blueprint i get: “No matching devices found”

Got it working: copied and pasted the “manufacturer” name (_TZ3000_wkai4ga5) and the “model” name (TS0044) and now its working.

my blueprint:

blueprint:
  name: deCONZ - Tuya TS0044  4-button scene switch
  description: Automate your Tuya TS0044 4 button scene switch using deCONZ events.
  domain: automation
  input:
    tuya_ts0044:
      name: Tuya TS0044 4 button scene switch
      description: Tuya TS0044 4 button scene switch to use
      selector:
        device:
          integration: deconz
          manufacturer: _TZ3000_wkai4ga5
          model: TS0044
          multiple: false
    button_one_long_press:
      name: Button 1 (long press)
      description: Action to run on button 1 (lower-left) long press
      default: []
      selector:
        action: {}
    button_one_single_press:
      name: Button 1 (single press)
      description: Action to run on button 1 (lower-left) single press
      default: []
      selector:
        action: {}
    button_one_double_press:
      name: Button 1 (double press)
      description: Action to run on button 1 (lower-left) double press
      default: []
      selector:
        action: {}
    button_two_long_press:
      name: Button 2 (long press)
      description: Action to run on button 2 (lower-right) long press
      default: []
      selector:
        action: {}
    button_two_single_press:
      name: Button 2 (single press)
      description: Action to run on button 2 (lower-right) single press
      default: []
      selector:
        action: {}
    button_two_double_press:
      name: Button 2 (double press)
      description: Action to run on button 2 (lower-right) double press
      default: []
      selector:
        action: {}
    button_three_long_press:
      name: Button 3 (long press)
      description: Action to run on button 3 (upper-right) long press
      default: []
      selector:
        action: {}
    button_three_single_press:
      name: Button 3 (single press)
      description: Action to run on button 3 (upper-right) single press
      default: []
      selector:
        action: {}
    button_three_double_press:
      name: Button 3 (double press)
      description: Action to run on button 3 (upper-right) double press
      default: []
      selector:
        action: {}
    button_four_long_press:
      name: Button 4 (long press)
      description: Action to run on button 4 (upper-left) long press
      default: []
      selector:
        action: {}
    button_four_single_press:
      name: Button 4 (single press)
      description: Action to run on button 4 (upper-left) single press
      default: []
      selector:
        action: {}
    button_four_double_press:
      name: Button 4 (double press)
      description: Action to run on button 4 (upper-left) double press
      default: []
      selector:
        action: {}
  source_url: https://community.home-assistant.io/t/deconz-tuya-ts0044-4-button-scene-switch/289190
mode: restart
max_exceeded: silent
trigger:
- platform: event
  event_type: deconz_event
  event_data:
    device_id: !input tuya_ts0044
action:
- variables:
    event: '{{ trigger.event.data.event }}'
- choose:
  - conditions:
    - '{{ event == 1003 }}'
    sequence: !input button_one_long_press
  - conditions:
    - '{{ event == 1002 }}'
    sequence: !input button_one_single_press
  - conditions:
    - '{{ event == 1004 }}'
    sequence: !input button_one_double_press
  - conditions:
    - '{{ event == 2003 }}'
    sequence: !input button_two_long_press
  - conditions:
    - '{{ event == 2002 }}'
    sequence: !input button_two_single_press
  - conditions:
    - '{{ event == 2004 }}'
    sequence: !input button_two_double_press
  - conditions:
    - '{{ event == 3003 }}'
    sequence: !input button_three_long_press
  - conditions:
    - '{{ event == 3002 }}'
    sequence: !input button_three_single_press
  - conditions:
    - '{{ event == 3004 }}'
    sequence: !input button_three_double_press
  - conditions:
    - '{{ event == 4003 }}'
    sequence: !input button_four_long_press
  - conditions:
    - '{{ event == 4002 }}'
    sequence: !input button_four_single_press
  - conditions:
    - '{{ event == 4004 }}'
    sequence: !input button_four_double_press

and result is not expected:

I just bought this Tuya 4-button Scene Switch (TS0044)

Using deCONZ and paired successfully, however in Home Assistant there is only Switch Battery entity, should there be other entities visible? In Logbook i see activity when fired event ‘1002’ for 1st button single click.

I also imported blueprint from this thread address into Home Assistant 2023.8.1, but cannot select device in first step (no matching devices found)

What is wrong?

edit / FIXED:
modified blueprint file and set property:

manufacturer: _TZ3000_wkai4ga5

1 Like

Thank you, 3 years later still working like a charm

Thanks! This worked for me too once I restarted Home Assistant after modifying the blueprint yaml.