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

If you haven’t already looked through this thread, it might be worthwhile if you’re going to be digging in to custom code. It’s pretty buggy right now.

Thanks a lot, Steven! Any help is very welcome, once I imagine that I’ll spend some nights without sleep in order to make this device work! I think that firstly I must found a way to make the device work, but in the sequence the adaptation to the new standarts will be necessary. :upside_down_face:

Hy guys! The EcoSmart 4-button Remote DHT partially works with the device, once just the “pushed” value is recognized through this DHT, and the buttons 2,3 and 4 don’t answer to the commands assigned, but if I don’t assign a command to it they reproduce the command assigned to button 1.

I downloaded its code from SmartThings GitHub, and now I just need to find a way to activate the values “double” and “held”, and perhaps use some tweak to reduce the delay beetwen the command given by the button and the action desired, but it is secondary. The main objective now is to make all the buttons responsive and make they accept the other values.

Some tip to help a noobie without coding skills?

Hi. I was looking for this DTH and found the information on a youtube video:

SMARTTHINGS - Instalando e Configurando o Interruptor sem fio Zigbee 4 botões

Here is the link to the Device handler. It works very well for the 3 states for the four buttons.

Device Handler Zemismart 4 button


Hi Emilio!

Thanks a lot, it is working flawlessly!


1 Like

Some input on this, that you might find helpful:

First feedback: The device handler link above (=“Zemismart 4 button”) works perfectly with the Tuya Sceneswitch 4-button device. It detects the 4 buttons individually.

The more advanced functionality (double-press or hold) is however not supported by the dev. handler. But this is only a little drawback, as the 4 buttons basically work.

Now some tips/tricks:

If you need to trigger a routine in Alexa follow this procedure:
a) Create a virtual switch in SmartThings (use the web interface and not the app) and use the device handler “Alexa Simulated Switch” (code is easily found on github).
b) Alexa will discover/“see” the virtual switch instantly and you can now base a routine on that switch going on/open (or off/closed). (In this way you build a “bridge” between SmartThings and Alexa that otherwise is not there.)
c) In SmartThings you assign this virtual switch to one of the 4 buttons, so this virtual switch changes from “closed” to “open” when the relevant button is pressed.
d) In SmartThings you also create an automation that resets the virtual switch with a delay of 10 secs. Then the virtual switch will always be ready for another press on the button.

Repeat steps a) through d) for all 4 buttons, so you have 4 virtual switches each corresponding to a separate button. Voila!

1 Like

Hello guys and thanks for providing the DH. Got an issue here: i can see the device in smartthings app and shows when a key is pressed but i dont get to assign the keys. When i open the device i just see a message that is connected.

1 Like

Got it guys. I just removed and readded the devices and it works


Has anyone tried to use 2 separate switches so you can use more buttons?

4 Gang Tuya ZigBee Wireless 12 Scene Switch Push Button Controller By battery 2MQTT Setup Automation Scenario for Tuya Devices|Switches| - AliExpress

bought this and it just doesnt seem to want to pair up in the Smartthings app at all - isnt even found ? How did others get it to pair ? I tried the bottom left button to get into pairing mode and the lights flash after 10 seconds


magically just paired all of a sudden - and works on each button as single, double and held - great little buy !

I found this DH works really well for 3 of the 4 buttons. Has this ever been updated to make all 4 buttoins work?

Hi, I have installed this device driver and it works for all 4 buttons with all 3 press types.

BUT - when I set ‘button 1 press’ to ‘turn on lamp 1’ it turns it off, and vice versa.

Does anyone have any idea how I correct this? I’ve read the device handler guide but can’t see how the actions you select are controlled by the device handler.

Thank you

hello everyone
i have installed one of these switches onto smartthings. it worked great the first time every button controlled as it said. Had to reinstall it again ,now the buttons 1-2 control everything for the four switches? buttons 3-4 will not work even though the device has function in every output Press/D press/and hold. Has anyone else had this problem ,if so how was it rectified
any advice would be appreciated. Thanks

What to do next? Where can i config the Buttons correctly? Tried Webcore, shows 32 Buttons … tested it, but it doens’t work. ABController … no reaction


I don’t know very well what you want to do and if you only want to use webcore, but you can use the quick controls, directly by pressing an action and you can control devices and scenes.

You can schedule automations with each of the button and actions.

To delete a quick control schedule, you have to go to automations and they appear at the end of the list. Select the one you want to delete and press delete

I just wanted to toggle some Plugs (Speaker, Lights etc) in my Kitchen.
I don’t use Webcore often, just tried it out.
Where can I choose which button to execute the corresponding scene?
There is no Option like: Button #1 press: …; hold: …; Button #2 press … and so on.
Do not find the menu to link the buttons to the scenes/rules.

To use quick controls:

To delete a quick control schedule, you have to go to automations and they appear at the end of the list. Select the one you want to delete and press delete

To use it with automation:

  • click on “+” at the top right and click on Automatic Action.
  • In the “If” part, press “+” and choose the device, remote control
  • Choose the button and type of button action.
  • you can add more devices with the OR or AND condition.
  • In the “then” part, press “+” and choose the actions you want to execute

Did anyone have any luck getting this to work?
If i add it to Smartthings, it still just picks it up as a “Thing”. If i try to re-add, it still only ever detects as a “Thing”.
If i go to the IDE and change it to the Zemismart button, it only shows up 1 button with a heap of possible events (pressed, double pressed, held, standby, pressed 2 times, pressed 3 times, etc)
When i press the 1st button, nothing is registered as an event…
I’ve tried re-adding it many times but no luck. Nothing seems to be detected when i press any of the buttons.

Go to Smartthings Brasil. It has a link to the needed DTH for the 4 button remotes (scene switches).


1 Like