[OBSOLETE] Four button Tuya Zigbee device DTH (DTH link in post #7) (Same device from multiple brands: Zemismart, Yagusmart, Losonho , DYHF, etc)

Hi @Hendo25, thank you for your feedback! I am this glad that this DH worked for you.

On the different possible modes question - it is a bit complicated topic, I will try to collect some useful information and post it here. The difficulties come from the different interpretations and the different implementations of the Zigbee standards, and Tuya is famous for their ‘special’ interpretation of the standards… :frowning:

Shortly, the goal of this DH is to make the new TS004F devices when paired to SmartThings hub behave exactly the same way, as the old TS0044 switches (that are not produced anymore). I.e. send single, double press, and hold events to the hub.

I don’t know a way to make the new mobile app appearance change, depending on the currently active mode (dimmer or switch). So to make it simpler and to avoid any confusion, in the next DH I will remove the possibilities and the references to the dimmer control mode. I will post again here when done.

Thanks @Trakker2 - that sounds like it makes sense to drop the dimmer control mode.

Are you able to shorten the “Held” time? It seems like you have to hold it for quite a while to register that. Or is that a hardware/firmware condition?

Unfortunately, the delay for “Held” time (about 3 seconds) is hardcoded into the device firmware.

1 Like

@Matthaus I too have the TS004F from _TZ3000_xabckq1v and it doesn’t work either with the 1.6 version or with the modified version from @Trakker2
It shows the 4 buttons but all in stand-by and for each i can choose between “pressed”, “double pressed”, “held”, “pressed 2 times”, “pressed 3 times”, pressed up to 6 times and then toggled from 1 to 6 times…
kinda confusing… is there any way to include that version to your DTH @Trakker2?

@daverda00 @Matthaus can you try the new version 2.3 from the same link posted above ?

In this version, the DH tries (rather aggressively) to initialize the device in Scene Switch mode…

Please try to pair the device close to the ST hub. The success (or the failure) of the initialization depends on the short time slot available right after the device joins the Zigbee coordinator network. Tuya hub achieves 100% success probably because the initialization process is optimized per the particular Tuya device/model, but with ST (and other hubs) this optimization is difficult to acheive.

When the 4 LEDs stop blinking, you can immediately press any of the buttons a few times, this keeps the sleepy device awake and increases the chances for successful configuration.

I have added in the code consecutive attempts to initialize the device in Scene switch mode (thus enabling double press and held events for all keys) after every keypress event that has been sent in Dimmer mode. So if it doesn’t work from the first time, a few keystrokes should make it work

I would recommend also to first completely exit from the ST mobile app and then open the page where the device is again. I have noticed the keypress events are not always shown when the device was just added.

If pairing and configuration (after a few keypresses) was successful, double-click and held events should be shown like this:

image
(also inside the device page and in the ‘History’ tab)

Inside the device page on the mobile up there should be only ‘Pressed’, ‘Double pressed’ and ‘Held’ sections for configuring simple automations.

Please let me know if this works for you.

@Trakker2 thank you for the update. I have tried it, now it successfully recognizes the device but it doesn’t recognize if a button is pressed.
I have placed the switch right near the hub while pairing, and have randomly pressed the buttons as soon as the leds stopped blinking.
Now the device is automatically named “Powered by Tuya 4 Button TS004F” and on the smartthings app i have the correct menu (single, double and hold). Instead of “Standby”, the device is marked as “Ready”.
Yet if I press a button they don’t get recognized. The event history both on the app as on the Groovy IDE is completely empty. Automations assigned to the buttons also don’t get triggered.
I have tried re-pairing the device but it remains the same.
Do you have any suggestion if I am doing something wrong?

@daverda00 if you go to “Live logging” page on the Groovy IDE, do you see anything coming from the DH when you press a button?

Something to check: Go to “My Hubs” ->“View Utilities” → ZigBee Utilities section ->Network Security → press on “Retrieve Current Setting”.

Make sure “Unsecure Rejoin is enabled” and try again to repair the device.
When TS004F is operating in Scene Control mode, it sends the packets from 4 different ‘zigbee endpoints’ (opposed to EP 1 when in the default mode). I have noticed the device sending rejoin requests to the ST hub coordinator … Can you check and try again?

EDIT Dec 17, 2021 : Enabling the ‘Unsecure Rejoin’ is not needed!

@Trakker2 at the live logging page there is no activity when I press a button.
The “unsecure rejoin” was disabled, but even enabling it and re-pairing the device a couple of times didn’t solve the issue.
But I don’t want to bother you too much I could also simply buy a similar switch which runs on the go without all these issues from tuya. Maybe you can recommend a better product?

@daverda00 Sorry this didn’t work for you… But you are right, this odd thing doesn’t deserve so much time and efforts! :frowning:

If you are located in Europe, I would recommend [LINKS DELETED] I use all these 3 models without any problems.

@Trakker2 Thank you for your recommendation i have ordered a Smart+ Switch hope it will work from the start :slight_smile:

@daverda00 I am sorry that the switch that I recommended didn’t work out of the box… Hope you can find information and help in the ST forum and it will work for you.

I have removed the links from my previous post, sorry again.

BTW, I have made some more optimizations to TS004F driver operating in scene mode only. Now I can pair it even when the switch is away from my ST hub, i.e. the initialization is now much less dependant on delays or retransmission errors during the initialization. Revision 2.4 can be downloaded from the same link.

@Trakker2 Don’t worry about the new switches issues, I’m starting to understand that the zigbee world is a world full of luck and random issues :smiley:

I have tried your new version of the DTH, still no improvements. It pairs perfectly each time but no message gets sent on the live logging. Maybe I have some kind of updated version of the switch as your DTH works for the most of the people here.

Btw I have configured the switch to a tuya zigbee gateway, where it works perfectly. This means the switch is not faulty.
But nevermind I can still use the switch for tuya automations so it’s not completely useless.
Thanks again I really appreciate your help.

2 Likes

So I managed to solve the issue with the help of @Trakker2
I had to keep pressed the two buttons on the right row (2 dots and 4 dots) for about 5-6 seconds until the led of the 3-dot-button lights up for a split second.
This changes the “mode” of the button and from then on it worked perfectly. Single tap, double tap and hold are shown on the live logging and recognized from the app aswell.
@Trakker2 thank you again for the great help!

1 Like

I am glad this worked for you ! :slight_smile:

Last version 2.6 : - added ‘Reverse button order’ setting back (off by default)

* ---------                    ---------
 * ! 4 ! 3 !                    ! 1 ! 2 !
 * ---------                    ---------
 * ! 1 ! 2 !                    ! 3 ! 4 !
 * --------- : default          --------- : 'Reverse button order' setting ON 

Keymapping can be changed from the mobile app - click on the device details page 3 dots icon (upper right corner of the screen), then Settings, “Reverse button order”.

1 Like

@Trakker2
I have tested this DH a bit more, and I’ve noticed a problem with storing Actions on the device page on the Smarthings app.

When adding actions for each button (pressed, 2x, held), the actions do successfully get registered in Smartthings, and they appear on the Automations tab. (And they work!)

However - only the actions for button 1 show within the device controls. I can add an action to any other button, it stores correctly on the Automations tab, but on the device controls it says “No actions assigned”.

If I do add an action for another button, that action replaces the action assigned to button 1 in the device controls presentation - even though it doesn’t actually replace the Automation (which works successfully).

I hope this all makes sense.

Have you seen this before, and any guidance how it can be fixed?

Thanks

1 Like

I am not sure how to fix this, seems like something has changed in ST new mobile application, I don’t follow these changes very closely… Anyway, the solution should be the same as for any other 4 button devices, such as TS0044 for example.

Have you tried ‘Routines’ ? :
press the ‘+’ button on the mobile app, then ‘Add routine’, select ‘Custom’ at the bottom left, ‘If’ → ‘Device status’, select the TS004F device, select one of the 4 buttons, select one of Pressed / Double pressed / Held options for that button, hit Done, then assign a device to control …

Does this work for your setup?

@nayelyz this the same issue that I reported couple days ago with EcoSmart Remote. It is happening with other devices too. Those Fast Automations on main Device’s page are not working.

@Trakker2 this is something that happened on ST side, as device that I have, have exactly the same problem and is using SmartThings stock DTH.

See my post and response from @nayelyz

1 Like

Thanks @milandjurovic71 - it does appear to be exactly the same problem.
The only reason I can’t be 100% sure is that I hadn’t properly tested the DTH prior to this, so don’t know if the recent change in Smartthings has caused this.

I’ll keep an eye on the other thread to see if there’s any updates for you.

My previous feedback was related to _TZ3000_czuyt8lz which, apart from the issue mentioned above about actions not sticking to the buttons on the device page, the DTH seems to be working very well. (And I understand that this issue is down to Smartthings, and not the DTH).

I am now testing with _TZ3000_xabckq1v and I am getting very little success.
Button 4 (TL) seems to work, but nothing else.

I have tried switching to scene mode as per @daverda00 comment above in post 92.I can see in the logs that it supposedly switches modes, but I’m still not getting any other success with other buttons.

Is there anything else I can try, or any further updates to this DTH?

Thanks in advance

There seems to be a large variety of different devices by different manufacturers that use one and the same product identifier (model) TS004F…
@Hendo25 can you post a link to a picture of _TZ3000_czuyt8lz device?

_TZ3000_xabckq1v should be the same device that I am testing with. Looks like this:
image