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

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

The option for reversing the buttons order is available from the mobile app :
Press the 3 dots at the upper right corner of the device details screen :

Then switch the ‘Reverse button order’ option

2 Likes

Ah! I would never have found that there - thank you!

The only thing that doesn’t seem to work for me is the battery status, shows a 0% with a little red dot - might just be that my Moes model isn’t fully supported by by this device handler, but the main thing is the buttons work.

1 Like

Hey guys, could you please add the following FP to the driver?
ZEMISMART 1 Channel Tuya Zigbee Button model: TS0041

Hi, @Trakker2

A few weeks ago I was able to translate the Zigbee configuration commands into ST Edge Lua and it works properly in a MOES TS004F, but I was wondering… is it possible that these steps are applicable for rebranded TS004F or even the 3-Button model (TS0043 model if I’m correct)?

For reference, I mean these steps you shared with us:

And also, for everyone here, I’d really appreciate it if you could test the driver I developed for this device. A community member confirmed at this thread that it works ok with a not-even-branded TS004F, so I was hoping to get some feedback from you if possible :grimacing:

So, I’ll leave my channels below = )

1 Like

Hi @erickv ,

I can confirm that your Edge driver works OK with TS004F scene switch! Good job! :+1:

I installed the Lua driver from your channel, then removed the device that was using the old Groovy DHT, removed the battery, waited 5 minutes, paired it again, “Button-battery-v.1.0.1” driver was assigned. Created a simple routine to control an Edge controlled bulb - and the long-awaited ‘Home’ icon is there! :slight_smile:

I will further comment on your thread, congratulations again!

2 Likes

Thanks for such positive feedback, @Trakker2 :raised_hands:t3: =’’]

1 Like

Hi guys, I have connected this 4 scene button to ST https://smile.amazon.co.uk/yagusmart-Wireless-Switch-Battery-Control/dp/B08J3TMGJH/ref=pd_day0_1/262-6377440-9452037?pd_rd_w=43eLE&pf_rd_p=8ec13b8a-30d2-48fc-8503-84c56766370d&pf_rd_r=HMN5HZK7KWPE0WQRKHD1&pd_rd_r=00979419-e099-4b91-835c-87cd1a588452&pd_rd_wg=qsAYo&pd_rd_i=B08J3TMGJH&psc=1
Connected like so:

However I am having one issue Home Assistant is only able to respond to the Button 1 event:
image

If I try to add 1/2/3/4 after Button nothing comes through but it does get logged on the API so it does work ok.


I tried adding - or _ between and no luck, it is not accepting any of the button numbers
Anyone know what name it is looking for maybe?