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

I’m new to that - how can that help?

The Advanced Button Controller was one of the few custom applications that in the last weeks were able to make use of the multiple buttons controllers… until yesterday!

Samsung have finally managed to fix the long-lasting bug in SmartThings mobile app, and now it is possible to assign different simple actions (routines) from the mobile app device page:

Check Google or Apple stores on your mobile device to make sure you have the mobile app updated to the latest version.

1 Like

Ive finally managed to setup in smartthings with a device handler 1.6 but press any button & nothing happends , if i add a routing to Button 1 nothing happens, if i setup a routine in any other button they dont even show up? Hope someone can help

Can you post the device details as shown in the Groovy IDE, ‘My devices’ tab?
Should be something like this:

Hi just checked yes TS004F

Although SangBoyST original driver should also work with TS004F model devices, providing single button push events for the left buttons and single+held events for the right buttons, I would recommend to try the modified version here:

Steps:

  1. Install the DHT from the link above.
  2. From the Groovy IDE, go to ‘My devices’ → your TS004F device page → ‘Edit’ button at bottom of the page → change the device type to ‘Powered bu Tuya TS004F’ driver.
  3. Remove the TS004F device from the mobile app ( Device details - Edit - remove/delete).
  4. Remove the battery for 1-2 minutes
  5. Put the battery back
  6. Add device - scan. Try to make the pairing close to the SmartThings hub.
  7. Press the lower left button for about 7-10 seconds, until all 4 LEDs start to blink
  8. A few seconds later the LEDs should begin to flicker a bit (during the lit period of the blinking sequence the LED brightness seems like is being slightly reduced, because of this high-frequency flickering)
  9. No more than 5-6 seconds after the flickering starts all the LEDs should go off.
  10. At this time the discovery of the new device should be shown on the mobile app.
    Sometimes, pressing some of the device buttons at the end of the pairing process seems to help to speed up the discovery.
  11. When the “Tuya 4 Button TS004F” default join name appears on the mobile app, the pairing process has finished.

Let me know if this procedure works for you. You can also observe the Groovy IDE ‘Live logging’ page for any debug / log messages that are shown when you press any of the buttons. If the device still does not work for you, copy and paste the logs and send them to me. Good luck!

1 Like

Many thanks, ive tried again & yes that worked but when i add to button 2,3 or 4 even though thwy work nothing shows up in under Press, Double press or Held?.

1 Like

That’s the SmartThings mobile app bug in action…
Make sure you are using the latest app version:
(Menu → Gear icon → ‘About Smartthings’ :
This is the Android version as on 19th of December 2021 :

This is exactly the ST bug that was fixed recently. Make sure you have the latest mobile app version installed on your mobile device. In the device page should see only 4 sections for the 4 buttons and the battery status on the bottom. If you still see 5 sections ( a common Pressed/Double/Held section on the top, followed by 4 individual buttons similar sections) - then you are using an old mobile app version.

3 Likes

Thanks. Works well now! Let’s see how the battery holds up.

I’m also trying to put this scene switch to work, but no success. Only the button 4 (TL) works properly and also, in the app, is shown 5 buttons, main and 1 to 4. Only the main button accepts automations and it’s triggered by the button 4.

@anthonyceegp did you follow all the steps in this post: Four button Tuya Zigbee device DTH (DTH link in post #7) (Same device from multiple brands: Zemismart, Yagusmart, Losonho , DYHF, etc) - #113 by Trakker2 ? Please make sure you are not skipping a step.

Also, seems like you are not using the latest SmartThings mobile app, please update it from Google or Apple stores.

@Trakker2 Thank you very much for sharing DTH.
I’m looking at your DTH to try to port it to edge.
Could you please clarify what the following line means?

"raw 0x0000  {10 00 00 04 00 00 00 01 00 05 00 07 00 FE FF}", "send 0x${device.deviceNetworkId} 1 1", "delay 200",
"raw 0x0000  {10 00 00 04 00 20 00 21}", "send 0x${device.deviceNetworkId} 1 1", "delay 50",

Also, what is the attribute 0xD011 under 0xE001 cluster?
Thank you

Hi @ygerlovin , thank you for your efforts in making an Edge driver!

These two commands are reading a set of attributes in single commands, matching exactly the way that Tuya Zigbee gateway does it. Mimicking the Tuya initialization sequence is the key point to successfully initialize the TS004F device in Scene control mode.

The same lines of code for Hubitat look this way :

cmd += zigbee.readAttribute(0x0000, [0x0004, 0x000, 0x0001, 0x0005, 0x0007, 0xfffe], [:], delay=200)    // Cluster: Basic, attributes: Man.name, ZLC ver, App ver, Model Id, Power Source, Unknown 0xfffe
cmd += zigbee.readAttribute(0x0006, 0x8004, [:], delay=50)                      // success / 0x00
cmd += zigbee.readAttribute(0xE001, 0xD011, [:], delay=50)                      // Unsupported attribute (0x86)
cmd += zigbee.readAttribute(0x0001, [0x0020, 0x0021], [:], delay=50)            // Battery voltage + Battery Percentage Remaining
cmd += zigbee.writeAttribute(0x0006, 0x8004, 0x30, 0x01, [:], delay=50)         // switch into Scene Mode !
cmd += zigbee.readAttribute(0x0006, 0x8004, [:], delay=50)

It is important to send the readAttribute commands for the Basic and Power clusters at once. Sending individual readAttribute commands for each attribute didn’t work.

This attribute is actually not used in the driver logic any further, but reading it is required for the successful initialization of the device.

It is also important to send the initialization sequence quickly, hence the very aggressive low-value delays between the readAttributes commands.

Good luck, I am eager to test the Edge driver!

2 Likes

@ygerlovin
Thanks for developing that driver ,in case you need it , i have that device i can test it , i can give you logs from cli

2 Likes

I had to reset the switch & delete the device. But now I cannot re add. All I get when I scan is THING?? Or sometimes Indo get Tya 4 Button TS004F but then the only info in device is Battery level? Hope someone can help.

Delete the device again and add it again , try neer your hub . You can also try to reboot your hub .

Thanks I have deleted & re added over 20 times still having issues. Also standing right next to the Smartthings hub. Ive rebooted the hub aswell.

Update managed to get it working. By pressing buttons marked 2 & 4 while in paring mode??

Hope ok to post but finally got mine working so thought I would upload a video as to what I did to get it working.

Setup and configure

3 Likes

Hello guys, i have got a single button of this device and it works perfectly. I am using it for unlocking the door when i am home but there is an issue. When i am out of home the battery drains very fast and after a couple hours it goes completely empty. What could be the problem?

A huge thanks for these recent instructions. I tried setting up a Moes 4-switch device last year with no luck, but the new device handler and video from @P_Will made set up a breeze this time!

I saw in the DHT there’s an option to use reverse button order but I can’t seem to make this work. Do I just need to modify line 104 to:
input name: "reverseButton", type: "bool", title: "Reverse button order", defaultValue: true, required: true
Can I just modify my existing handler and re-add the device, or do I need to remove everything and start again with the correct code modifications?

1 Like