Zigbee2MQTT - Tuya 4-button Scene Switch (TS0044)

Thank you very much for the answer. I was trying to put the configuration into the proper file now in the catalog zigbee2mqtt. What are my concerns now:

  1. Visual studio code is telling about missing comma:

Is the configuration properly set? The file TS004F.js is also in catalog zigbee2mqtt

  1. zigbee2mqtt is working with above configuration but I am trying to permit again TS004F I am getting Unsupported device :frowning:

Dear Community,

I am trying to make it work next night and unfortunately without success at all. I followed the instruction of how to add connector into the HA instance as well as set of the tutorials on YouTube bot for me it’ simply does not work like described.

What I did:

  1. I created file TS004F.js in the home path of zigbee2mqtt

  1. I added configuration through the configuration tab on the Supervisor tab:

With the line in the configuration unfortunately Add-On zigbee2mqtt stops working showing error message: “502: Bad Gateway” When I delete line from configuration (external_converters:

  • TS004F.js) Add-on back to normal work.

Here is the piece of log from the zigbee2mqtt module:

Use node --trace-warnings ... to show where the warning was created)
(node:12964) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see Command-line API | Node.js v21.6.2 Documentation). (rejection id: 1)
(node:12964) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
[00:52:11] INFO: Handing over control to Zigbee2mqtt Core …

Can I ask about your support here? Thanks!

I test this switch (TS004F) with Tuya Zigbee Hub, and all 12 functions worked!! Then I tested with deconz/conbeeII and only worked 6 functions, same as zigbee2mqtt. There’s something wrong here, why SmartLife app can access 12 functions and zb2mqtt or deconz can’t…??

I have 04 switchs of this model, and really want this to work as advised…
Can I help to debug, or try anything else ???

have you tried to using zigbee2mqtt edge version? i just got my 4 button switch and it was unsupported on the zigbee2mqtt… once i switched to the edge version… it got supported… now testing the blueprint…

cant get the blueprint to work though… sucks
gonna use node red

Thanks for this, I was about to return the remote. Hopefully it can get finished so its fully functional.

Hi,
I have the TS004F version of this switch - using “Zigbee2Mqtt Edge” the switch is discovered correctly (as TS004F) and listed as “Supported”.

But, I can’t for the life of me get this Blueprint to work.

  1. I can load it into HASS just fine (see image).
  2. When I go to make an Automation from the Blueprint, my switch is listed fine (see image).

However, when I try to save the Automation, I get an error notification, and logs say that the automation cannot find the ZHA version of the blueprint - even though I clearly have the Zigbee2Mqtt version installed.

This switch is riving me crazy. Any thoughts? BTW - I am using a Sonoff ZBBridge as the coordinator.

Cheers,
Rich

Image 1:
Capture1

Image 2:

Image 3:

Hi,
I have also this wireless switch (TS004F) and for me it was working fine with this Blueprint, but after I updated Z2M o version 1.19.0 I started noticing that the actions were done only on the second press of the buttons. I later found out that in 1.19.0 a native support for this switch was added via z2m (1.19.0 changelog) and I also had still the external converter in place, thats why on the first press I received “brightness_step_up” (action from z2m) and the second time I received “3_single” (from the external converter) and this blueprint works only with the external converter. When you remove the external converter the switch is still supported in Z2M, but does not work with this blueprint.
There is also a blueprint available for the TS004F with the native support of Z2M without the external converter here which works without issues for me.

Hello, did you manage to make progress on this?

I have now 6 switches (procured from different vendors…) sitting there, all recognized as TS004F while what I really need are TS0044 :sweat_smile: and though the description of the vendors was definitely "12 scenes switch).

Upgrade your Zigbee2MQTT

Thanks @francisp, but I’m already at the latest version (1.21).

I get all the actions listed for the TS004F but what I really wanted was the TS0044 with the 12 possible commands.

Unfortunately it seems impossible to procure. All the ones I get are TS004F and I don’t have a Tuya bridge.

I did the steps but I doesnt work
The log say

(node:1769) UnhandledPromiseRejectionWarning: TypeError: Cannot read property ‘length’ of undefined
at Object.addDefinition [as addDeviceDefinition] (/app/node_modules/zigbee-herdsman-converters/index.js:78:29)
at new ExternalConverters (/app/lib/extension/externalConverters.js:13:38)
at new Controller (/app/lib/controller.js:79:34)
at start (/app/index.js:94:18)

Somebody knows some solutions to resolve this problem

Hey @aiditz, I’ve been using your converter since months ago and worked perfectly! Thanks for that!

But since the last Z2M update (1.21.2-1) the converter is not working anymore. I get the default actions (on,off,brightness up & down).

Is there a way to fix this?

Since the last Z2M update this blueprint no longer works properly, namely:

  • if there is no change in the state it ignores the press of a button
  • if there is a change in the state (different button is pressed) it executes the previous command.

I have traced and researched so far, but my coding skills it this area are not sufficient to repair the blueprint.

Thanks in advance for any suggestion.

Have people got this working on zigbee2mqtt? as soon as i add the line for the convertor and restart z2mqtt, it fails to load.

You can use mqtt trigger in place of sensor. Everything remains the same.

1 Like
Logger: homeassistant.components.automation
Source: components/automation/__init__.py:646
Integration: Automation (documentation, issues)
First occurred: 4:49:40 PM (6 occurrences)
Last logged: 4:51:29 PM

Blueprint Zigbee2MQTT - Tuya 4-Button Scene Switch generated invalid automation with inputs OrderedDict([('switch', 'sensor.office_switch_action'), ('button_one_short_press', [OrderedDict([('service', 'climate.turn_on'), ('data', OrderedDict()), ('entity_id', 'climate.office_ac')])]), ('button_one_double_press', [OrderedDict([('service', ''), ('data', OrderedDict())])]), ('button_one_long_press', [OrderedDict([('service', 'climate.turn_off'), ('data', OrderedDict()), ('entity_id', 'climate.office_ac')])])]): Service does not match format <domain>.<name> for dictionary value @ data['action'][1]['choose'][4]['sequence'][0]['service']. Got None

I keep getting this error but I don’t see any corresponding automation. Any idea on how to fix this error?

For everyone that updated Zigbee2MQTT or the Blueprint stopped working in General,
Try changing this Part of the Code

action:
- choose:
  - conditions:
    - '{{ topic.split(''/'')[1].replace(''/'', '''') == deviceName.split('' '')[0]
      }}'
    sequence:
    - choose:
      - conditions:
        - '{{ command == ''1_single'' }}'
        sequence: !input 'button_one_short_press'
      - conditions:
        - '{{ command == ''3_single'' }}'
        sequence: !input 'button_two_short_press'
      - conditions:
        - '{{ command == ''2_single'' }}'
        sequence: !input 'button_three_short_press'
      - conditions:
        - '{{ command == ''4_single'' }}'
        sequence: !input 'button_four_short_press'
      - conditions:
        - '{{ command == ''2_hold'' }}'
        sequence: !input 'button_three_long_press'
      - conditions:
        - '{{ command == ''4_hold'' }}'
        sequence: !input 'button_four_long_press'

This should make it work again, only the Package Content of Mqtt was changed

Bought one recently here: Tuya Smart ZigBee Smart Switch 4 Gang Scenario 12 Scene Switch Push Button Controller Support deCONZ Tuya Hub|Building Automation| - AliExpress

With the latest update of zigbee2mqtt the blueprint also works with the TS004F Model n ° ESW-0ZAA-EU (branded above the battery with number ESW-0ZBA-EU)

Link:
https://www.zigbee2mqtt.io/devices/TS004F.html

GRAZIE!

1 Like

Guys I have the zemismart 4 scene button connected to my SmartThings hub and works ok but in HA I can only get the Button 1 to work 2/3/4 do now work but maybe I am not calling it correctly?
You can see the button names here:


And this works image

But if I call Home Cinema Scene Button 1 or 2/3/4 it does not.
Any ideas? All buttons do work ok on the ST side but not on HA (child buttons do not work or I do not know what their names are?)