Yagusmart 4 button Scene Switch

This is the TS004F that does nothing more than connect to HE.

I bought switches from the exact same listing and same seller on Aliexpress 3 months apart. The later one came with the later model. Safe to say unless the seller has old stock all of it will be the new TS004F now

I last bought this in July and it works with the Tuya Scene Switch driver. TS0044

I am beginning to get the feeling this might require some lower level (than driver) change to accept the input of the button presses for TS004F. I'm not even getting a raw.

Thanks for that link. I can't buy it from there, sadly. Well, there's a slim chance someone will figure this out before I return the TS004F.

Apparently it pairs fine with the SmartThings hub, and if you really like the device there's the option of getting the Tuya hub. Maybe Mike's looking at the problem behind the scenes and we'll get a lovely surprise in 2.2.9 :slight_smile:

But this might be a clue: [Release] zigbee2mqtt EcoSmart Remote ZBT-CCTSwitch-D0001

The weird thing is, parse(String description) isn't called at all. It's almost as if the button presses are not actually sending anything. I thought at least there might be some gobbledygook.

I've just successfully switched my TS004F device into a 'Scene control' mode! :champagne: :grinning:

Now each of the 4 buttons single press, double press, hold/release generate data that can be parsed in HE.

I will publish the driver in a few hours.

1 Like

Yay!!!! Well done :slight_smile:

Nicee.
Keep us posted.
I have 2 switches from different sellers to test. They are probably same model underneath in any case.

This is the link for downloading the experimental driver : https://raw.githubusercontent.com/kkossev/Hubitat/main/Drivers/Tuya%20TS004F/TS004F.groovy

...this thing will not give up easy! :frowning: Two major issues:

  • switching into 'Scene control' mode may not be always successful during the initial pairing process. Seems like sending the switching mode command 5 seconds after the pairing is working for me, but every system is different... So if after the initial pairing the keypresses are not seen in the Events or in the device log, try clicking on 'Switch into Scene Mode' (there is a typo that I will fix it in the next version) and press one of the device buttons to wake it up.
  • The device is sending several parsable events on a single keypress for buttons 1, 2, and 3. Only button 4 is sending just one event. To overcome this I had to implement a simple debouncing logic inside the driver, but this is in spite of 1 second delay between two consecutive keypresses... The user experience is not great when the keys are pushed fast...

Please let me know if this works for you. As there may be different fingerprints for different manufacturers of the same device, it may happen that this driver will not be automatically selected when paired. If this happens, manually change the driver to "Tuya Scene Switch TS004F" from the Device Information page in HE.

1 Like

Well I already had mine paired with the hub, so I assigned the driver and then used switch into scene mode, which then enabled me to press a button and get "button 4 was pushed" in the event log, regardless of which button I pushed. I did once manage to get a double press, but usually that came up as a single press on button 4 as well. I will try unpairing and pairing again. Is it meant to make child buttons, btw?

Well done for getting anything captured at all! Which manufacturer or brand is the device you are testing with?

Later: It's actually worse after re-pairing. It did pick up the fingerprint for your driver, but after picking up my first press (still button 4) it didn't register any further events. It looks like below - it this correct?

@Inge_Jones you are using the wrong driver! Go to HE Drivers code page and delete the old 'Powered by Tuya...' driver. It does not work, but has the same device signature. Delete it.

The name of the driver should be Tuya Scene Switch TS004F :

Oops! I forgot I even had that one. Should I pair again? I am still only getting button 4 reported in events. BTW I was using the right one in my first test, it just picked up the wrong one when I paired again.

Here is some logging

Yes, pair it again with the new driver. Switching the mode to Scene control seems to be more reliable during the pairing process, if compared to the manual process by pressing the "Switch to Scene Mode button". There are right timings that are to be determined later.
If the mode switch is successful, you should see such infos in the log:

While I was waiting for your reply I did that. The log output was from after re-pairing and it picking up the correct driver. You didn't say what brand or manufacturer your device is from? Mine is actually direct from Moes which I decided to do to make sure I got the TS004F

Honestly, I do not remember if there was any brand written on the box, and I don't keep the box anymore.
This is what is shown on the device info page:
image

The errors that you see on the log are due to missing some code that is not related to the physical button operation. I will fix it, but the problem is not there.

It matches those details. Ok well I will remove the device again, and reboot the hub before pairing again in case it has some old memory of it.

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