Yagusmart 4 button Scene Switch

One major difference that I can think of is that I have connected my switch to a Tuya hub before... So I will remove the battery for 10 minutes, although there is a little chance this will change anything.

Hopefully adding some more debug information in the next version will help to find out where the problem may be. I am testing my one pcs TS004F pairing to two different HE hubs, the 'production' one using the driver as downloaded from GitHub.

I'll remove my battery too before trying again

@Inge_Jones hold on, I was able to reproduce the same problem.
Will ping you when I have a new version, hopefully soon! :slight_smile:

Ok well in case this helps, my logs from after doing what I said are now

NB I didn't press button 4 but I did press buttons 2 and 3, which didn't appear in logs or events (I did try using the switch to scene mode a couple of times - tho it looks like the install did it in the first place too)

Bad news.. :frowning:
Switching between the Dimmer and Scene modes works, but... only when TS004F has been first paired to a Tuya gateway! Afterward, when the device is re-paired to HE hub, it can be switched into Scene control mode and all the 12 button combinations work.

However, if the battery cell is removed for several minutes and the device is paired to HE again, it will not work anymore.

The above means that we are still missing some specific configurations that are performed by the Tuya hub during the pairing process. I hope this missing configuration depends only on the Tuya Zigbee coordinator, and does not involve Tuya cloud in any way!

So, we don't have a working driver for TS004F yet. I will continue trying, but for sure this will take more time.

I think it's this 2mqtt stuff. An update would be needed in Hubitat libraries to handle this type of Tuya device properly, before we could write successful drivers on top of it. There is a thread requesting it here Smart life / Tuya support

I have just received this one

And this one works fine with HE with the default tuya switch driver.
The model that it comes with is TS0044.

I does feel quite cheap in comparison with the other switch that is not working with HE.

My TS004F works! I don't know why, but it works.

It didn't work as expected after the first pairing. Aside from connecting it, it does nothing. After re-paired to HE hub with kkossev "Tuya Scene Switch TS004F" driver still couldn't change to Scene control mode. I looked at the driver. I corrected the typo: "swicthIntoSceneMode" (rather it has nothing to do with whether the switch works). Re-paired. Then I changed the driver to the default tuya switch driver. Now the switch is working.

I did not have time to check if, apart from pressing, there is a possibility to use double pressing and holding option for the buttons. I was able to assign single press to each button.

I haven't had a tuya gate before. I have not changed to scene mode. I assigned actions to buttons via Button Controller (device / driver did not generate child buttons).

Tried that but no luck unfortunetly.
Any specifics steps you took?

That's weird ... Did your TS004F switch come with a battery already installed?

Shame to say but I don't remember. I did not expect anything to work, so I changed the settings so quickly. Here in the city I have everything on another smart system but at the weekend I will be in the countryside and check it thoroughly.

The switch came with the battery installed

Some pics below:





If the battery was already installed is it possible you received one that had been returned by a previous customer? Maybe they had already paired with a Tuya hub previously?

1 Like

The switch was new. I bought here:

https://allegro.pl/oferta/pilot-przycisk-zigbee-tuya-smart-4-kanaly-12-scen-10246019100

Of course it could be that someone had paired the tuya before, but this is unlikely.

It is quite possible that I will contact the seller about his other product (I still cannot find a working driver to his other product that will generate 2 child devices for me):

https://allegro.pl/oferta/wlacznik-2-obwody-zigbee-tuya-bez-n-przekaznik-10665807847

then I will ask if the switch was once paired and let you know.

Some pics (although the packaging says that the battery was not included, it was certainly included):


I'd expect quite a few of them had been returned as people expected them to work like others that appear identical, then return them assuming them to be faulty. After testing (with their Tuya hub) at the factory they are probably sent out again to sell as "working fine". Which could explains why it's not totally rare that some already have batteries.

1 Like

Of course it may be as you say. I will ask the seller.

Hmm... but even if it were, I still couldn't (and should have been able to) change it to scene switch mode and use with kkossev "Tuya Scene Switch TS004F" driver.

I'll let you know after talking to the seller.

Based on post #124 where kkossev says their device worked with the driver but only where it had been previously paired with a Tuya gateway. After a hard reset it was no longer fully compliant with the driver.

I get it but mine never works with this driver. Also couldn't switch to scene mode. I use default tuya switch driver now.

But as I wrote earlier, it may be as you wrote, regardless of the driver I use, the switch had to be paired before.

I will contact the seller and on the weekend I will take out and put the battery back in and see if it works.

@Martin_P can you please wait taking the battery out, I am almost sure the device will stop working with HE afterward.

I will send you a driver with improved debug logging, your case may help us to troubleshoot the mystery...

1 Like

Of course I'll wait. It would be great if I could help.

2 Likes

New experimental version (2.2.0) of the Tuya Scene Switch TS004F driver 2.2.0 is now published at:
https://raw.githubusercontent.com/kkossev/Hubitat/main/Drivers/Tuya%20TS004F/TS004F.groovy

I am not 100% sure why, but after sending quickly a magic sequence of read attributes commands during the pairing process, now it works for me even when the battery was taken out for a long time,.

Please test and let me know if it works in your environments. Here I have tested it with two different C7 hubs (one is even on a non-standard Zigbee channel 24), but I have only one TS004F device. Seems there are critical timings that may vary in different setups.

1 Like