ZHA - Tuya 4-button Scene Switch (TS0044)

Thanks, solved for my Moes wireless scene switch
manufacturer: _TZ3000_wkai4ga5
Is working now

Hi Eduardo,

I also tried to add my Moes 4-way switch but it didnt worked. I used the blueprint mentioned above, changed the integration to deconz and paired the device.

I see the device info:

Device info

TS0044
by _TZ3000_wkai4ga5

Connected via [Phoscon-GW]

Reloaded automation, deconz and complete HA but when I click on Add Automation it states there is no automation available for the device.

And of course I see the events fired in the Logbook.

Can you help out ?

1 Like

Thank very much for this blue print - worked like a charm (eventually);
Patience seems to be the key with these devices…
Home Assistant 2022.12.8
Supervisor 2022.12.1
Operating System 9.4
Frontend 20221213.1 - latest
Here are the steps I used;

  1. bind the device to HA (Hold the 3 button (bottom left) for nearly 15 seconds, until all lights flash.
    Here is what it looks like when bound to zb network;
    image
  • I found the pairing process to be VERY SLOW like 10 minutes to complete the interview, be patient.
  1. press button 2 and 4 and hold for around 3 seconds (until button 3 flashes once. For my device this was critical to get the automation in the blue print to work. If this doesnt work try rebinding to a different router. I finally got this to work using sonoff 31zb.
  2. Import the blueprint (luisfmrosa/zha-ts004f-tuya-4-button-dimmer-switch-blueprint.yaml)
  3. setup the automations you want in the blue print.
    Here are some donts I did :wink:

I did not have the install any ZHA quirks to successfully deploy.

  • Don’t change the device name - it seemed to cause it not to be detected by the blue print.
    If everything appears to be working but the automations don’t trigger in the blue print - you very VERY likely not successful in step 3 (hold button 2 and 4 until button 3 flashes). You will see the automation trace going around all your objects, instead of through as below;
    image

I hope this is helpful for other users :slight_smile: :upside_down_face:

Struggling here… I use ZHA for Zigbee stuff in my house, and have a Tuya ZB gateway in my cabin connected to a WAP (run from ethernet cable).
I’ve tested the TS0044 with ZHA in the house and it works fine, all button presses are recognized. Now, when I pair it with the Tuya gateway, it integrates with HA as a different name (ZC-YED 四键场景开关(无遥控功能)) and doesn’t allow me to create any automations, seemingly seeing no entities.

Separate Sonoff gateway finds the device but doesn’t actually pair with it. Anyone know if I can use the Tuya integration to show the device properly?
Alternatively, does anyone know how I can extend the ZHA network to my cabin?

I think you may have some options.
Option 1 install some zigbee repeaters to stregthen your zigbee network to the cabin (dont know how far it is…) - I used this method in my integration
Option 2 - Use the Tuya Cloud integration in HA to connect to the Tuya and control the device. I use this for other devices temporarily then add them using the local tuya integration.
Option 3 - Integrate them using Tuyalocal

sometimes it lags, I don’t know why, anyone has any suggestions? missclick or just have to wait 10 seconds for light to turn on

Hey guys, this is my first post here so please be kind if I’m using wrong format or am posting this blueprint in the wrong spot. Also, feel free to put it somewhere where it can be found more easily!

I have a “Moes” 4-button switch that identifies as “_TZ3000_wkai4ga5” in ZHA. As it has a different identifier than the one mentioned in the blueprint here, this switch wouldn’t show up when I tried to use the (otherwise working, with the exception of changed buttons) blueprint. So I ended up altering the blueprint so I could use it for my Moes switch.

Here’s the blueprint for y’all to use:

blueprint:
  name: ZHA - Tuya 4-Button Scene Switch ("Moes") (_TZ3000_wkai4ga5)
  description: Automate your Tuya 4-Button Scene Switch using ZHA events.
  domain: automation
  input:
    tuya_4button_scene_switch:
      name: Tuya 4-Button Scene Switch
      description: Tuya 4-Button Scene Switch to use
      selector:
        device:
          integration: zha
          manufacturer: _TZ3000_wkai4ga5
          model: TS0044
          multiple: false
    button_one_short_press:
      name: Button 1 (upper left), single press
      description: Action to run on button 1 (upper-left) single press
      default: []
      selector:
        action: {}
    button_one_double_press:
      name: Button 1 (upper left), double press
      description: Action to run on button 1 (upper-left) double press
      default: []
      selector:
        action: {}
    button_one_long_press:
      name: Button 1 (upper left), long press
      description: Action to run on button 1 (upper-left) long press
      default: []
      selector:
        action: {}
    button_two_short_press:
      name: Button 2 (upper right), single press
      description: Action to run on button 2 (upper-right) single press
      default: []
      selector:
        action: {}
    button_two_double_press:
      name: Button 2 (upper right), double press
      description: Action to run on button 2 (upper-right) double press
      default: []
      selector:
        action: {}
    button_two_long_press:
      name: Button 2 (upper right), long press
      description: Action to run on button 2 (upper-right) long press
      default: []
      selector:
        action: {}
    button_three_short_press:
      name: Button 3 (lower left), single press
      description: Action to run on button 3 (lower-left) single press
      default: []
      selector:
        action: {}
    button_three_double_press:
      name: Button 3 (lower left), double press
      description: Action to run on button 3 (lower-left) double press
      default: []
      selector:
        action: {}
    button_three_long_press:
      name: Button 3 (lower left), long press
      description: Action to run on button 3 (lower-left) long press
      default: []
      selector:
        action: {}
    button_four_short_press:
      name: Button 4 (lower right), single press
      description: Action to run on button 4 (lower-right) single press
      default: []
      selector:
        action: {}
    button_four_double_press:
      name: Button 4 (lower right), double press
      description: Action to run on button 4 (lower-right) double press
      default: []
      selector:
        action: {}
    button_four_long_press:
      name: Button 4 (lower right), long press
      description: Action to run on button 4 (lower-right) long press
      default: []
      selector:
        action: {}
  source_url: https://community.home-assistant.io/t/zha-tuya-4-button-scene-switch-ts0044/265099
mode: restart
max_exceeded: silent
trigger:
- platform: event
  event_type: zha_event
  event_data:
    device_id: !input tuya_4button_scene_switch
action:
- variables:
    command: '{{ trigger.event.data.command }}'
    endpoint_id: '{{ trigger.event.data.endpoint_id }}'
- choose:
  - conditions: '{{ command == ''remote_button_short_press'' }}'
    sequence:
    - choose:
      - conditions: '{{ endpoint_id == 1 }}'
        sequence: !input button_one_short_press
      - conditions: '{{ endpoint_id == 2 }}'
        sequence: !input button_two_short_press
      - conditions: '{{ endpoint_id == 3 }}'
        sequence: !input button_three_short_press
      - conditions: '{{ endpoint_id == 4 }}'
        sequence: !input button_four_short_press
  - conditions: '{{ command == ''remote_button_double_press'' }}'
    sequence:
    - choose:
      - conditions: '{{ endpoint_id == 1 }}'
        sequence: !input button_one_double_press
      - conditions: '{{ endpoint_id == 2 }}'
        sequence: !input button_two_double_press
      - conditions: '{{ endpoint_id == 3 }}'
        sequence: !input button_three_double_press
      - conditions: '{{ endpoint_id == 4 }}'
        sequence: !input button_four_double_press
  - conditions: '{{ command == ''remote_button_long_press'' }}'
    sequence:
    - choose:
      - conditions: '{{ endpoint_id == 1 }}'
        sequence: !input button_one_long_press
      - conditions: '{{ endpoint_id == 2 }}'
        sequence: !input button_two_long_press
      - conditions: '{{ endpoint_id == 3 }}'
        sequence: !input button_three_long_press
      - conditions: '{{ endpoint_id == 4 }}'
        sequence: !input button_four_long_press

Hope this helps you, too.
Thanks to everyone who contributed to the blueprint I used for this!

3 Likes

Thank you so much, @Netpoet !! I’m using a CC2531 coordinator with ZHA on HAOS and it’s working really well!

1 Like

The device TS0044 is working very well!
But i see that there is a delay of 1-2 seconds until the action happens.

I compared this device with a Ikea Tradfri button, and with the ikea button the action is instant.

How can i fix the delay?

I know this is an old post but, as it’s near the top of the thread, I’ll post a reply for anyone else that reads this thread in the future (or if you’re still having the issue). Deleting the 4 button switch from your Zigbee integration and then reconnecting it (reset the switch (hold any of the buttons until all lights start flashing) and set the Zigbee Integration to search for new devices), should make the blueprint work for you. I had a similar issue and it worked after resetting the switch.

However, it’s worth noting (I had this issue too) that there are a number of different versions of this blueprint because of the amount of different versions of this device that are out there (they’re all Tuya TS0044 devices but released under different manufacturers), so it’s definitely a good idea to also confirm you have the correct blueprint for your device, and if not, doing a search on here for the exact version for your device (*you can also modify any of the blueprints to fit your device by opening the corresponding blueprint yaml file and changing the model number (the second half of the model number tends to be the difference) and potentially the integration that the blueprint should use (there are a number of different integrations that can be used to connect Zigbee devices to HA due to the amount of manufacturers that use the format and the number of hubs and dongles that are out there, although the Zigbee Home Automation integration (displayed as “zha” within yaml) is probably the most widely used)).

**Another note…Some of the blueprints on this page show the wrong button placement description (as an example, button 1 described as “lower-right”). This was the case for the version I needed to use for my device. Obviously this isn’t a deal breaker if you know where button 1 really is but isn’t ideal. However, it is easily fixed by changing the button description in the blueprint yaml.

I know this may have been mentioned before, but the button placement descriptions don’t seem to be correct, at least compared to my ZHA Tuya TS0044. For example button 1 being described as the lower-left button whereas it is the upper-left button on my device.

However, for anyone else having this issue, it doesn’t effect how the blueprint works, it might just confuse you for a minute or two, I know it did with me lol. It can make you think the switch and automation aren’t working when really you’re pressing button 3 instead of 1. This isn’t a deal breaker when it comes to using this blueprint as it works but it obviously isn’t ideal either. It is however easy to change it by opening the corresponding blueprint yaml file (located in the config\blueprints\automation\stringer folder of your Home Assistant hard drive) and changing the descriptions for each button’s single/double/long click actions to match the button placement of your device. Only the change the descriptions though, everything else is correct (for this device manufacturer/dongle combo).

Hello Expert.

I got the following error: Message malformed: Missing input tuya_4button_scene_switch

Can someone help?

Hi All,

Managed to resolve the issue.

Blueprint is good.

Sorry to post on an old thread. I just got this switch and added to home assistant ZHA. But this doesn’t show up under the blueprint. Anyone faced similar issue and resolved?

I was able to resolve my issue by updating the below line in the blueprint.

          manufacturer: _TZ3000_wkai4ga5
1 Like

Has anyone getting native groups to work ? E.g., binding this switch to a groupid other than 0, and then sending group messages ?

[disclosure, my switch is a MOES switch reporting at this TUYA switch, maybe it has a different or broken firmware. Manufacturer ID is _TZ3000_wkai4ga5]

This would allow to switch groups even if the coordinator is offline.

I know I can get this to work with deconz/phoscon app, but I would prefer a native way.

If it’s not possible, can someone recommend a scene switch that DOES work natively with zigbee groups ?

Many thanks, and happy 2024!

This blueprint finally worked for me

Hi all,

I’m looking at this post because I have bought two Moes 4-gang switches via Ali Express. In the Tuya IOT cloud enviroment I see Tuya has identified it with this ZC-YED 四键场景开关(无遥控功能. I would like to configure and setup automations within Home Assistant without using ZHA. I already have a Silvercrest Zigbee Gateway. Is there a way to set this 4-gang switch without ZHA?

Br,

Stevan

Hi,

I’m new to HA but I got this 4-button switch to use in my theater room, but the blueprint as-is wasn’t working. Just posting this here in case someone else has run into the same problem…

The device wouldn’t show up when creating an automation from this blueprint. Couldn’t find a matching device. Turns out my manufacturer id was different than the one in the blue print. Mine was _TZ3000_wkai4ga5. So I was able to edit the blueprint and put that in, and then the device showed up!

Edit - actually if you just remove the manufacturer line in the yaml, then your device should show up. That’s cleaner!