Zemismart Zigbee 2 gang light switches

driver

#1

I bought this Zemismart Zigbee 2 gang light switch: Tuya Zigbee Hub Smart Home PIR Sensor Door Sensor Temperature and Humidity Sensor Home Automation Scene Security Alarm Kit-in Smart Remote Control from Consumer Electronics on Aliexpress.com | Alibaba Group
These look good and are responsive (they toggle the light as soon as i touch the switch instead of when i release the touch). And the price tag is attractive.

I have registered it as a Generic Zigbee Switch and it controls the first button. The other button is not exposed of course.

I have tried other drivers for 2 gang switches like these ones:


They have "on/off" controls for all gangs which work (switch on or off both switches at once). They also have individual on/off controls, however they don't work at all.

How do I go about customising the driver to make the individual switches work? I'm a programmer by trade, so coding won't be a problem, however i don't understand how get started. I mean how do I get the codes that the switch supports in the first place? Is there some kind of tool that allows to inspect device capabilities? Any help how to get started with writing Zigbee device drivers is appreciated.

UPDATE 2019-08-21: I ended up making the driver work. Here's the code:


#2

There's the data that i got from the switch when adding it to Hubitat:

ID: 7F3B
Manufacturer: _TYZB01_f97aljaj
Product Name:
Model Number: TS0002
deviceTypeId: 290
manufacturer : _TYZB01_f97aljaj
idAsInt : 1
inClusters : 0000,0003,0004,0005,0006
endpointId : 01
profileId : 0104
application : 42
outClusters : 0019
initialized : true
model : TS0002
stage : 4
manufacturer :
idAsInt : 2
inClusters : 0000,0003,0004,0005,0006
endpointId : 02
profileId : 0104
application :
outClusters : 0019
initialized : true
model :
stage : 4

#3

Platform version 2.1.4 will have a built in driver for for the Nue multi gang switches, it may work with this switch.
I might give that a shot, it will require rejoining the switch.
2.1.4 should be out in a few days.


#4

Thanks for the update.

After digging around and a bit of guess work I figured it out and made the switch work. This was my first attempt at Zigbee driver for Hubitat.
What I did was enable logging in parse method to see Zigbee data received when I manually press the button to figure out which endpoint each switch corresponds to. Then I could adjust the Nue driver accordingly.
Here's the driver code:

It would be nice to have a page "How to get started with writing Zigbee drivers" to avoid having to do guess work and collect bits of information from different posts in this forum. I know that maintaining documentation is a lot of work, however I think it's a really important part to grow the overall ecosystem of drivers with the help of the community.


#5

Agree with @mike.maxwell. You may find that the recently released Nue Zigbee Switch Hubitat drivers will work with these. You will need to remove and rejoin then change the driver to Nue Zigbee Switch and it should also then add the additional switches too.


#6

I have tried this switch with the built-in Nue Zigbee Switch driver and it works great! Individual switches are configured as 2 child devices that can be controller independently, and the parent switch controls both switches at the same time.


#7

I'll add the fingerprint to the nue driver.


#9

When I asked seller whether this switch works as a Zigbee router the response was "no".

However when I opened /hub/zigbee/getChildAndRouteInfo I saw this switch in the list under Neighbor Table Entry. Does this mean it actually works as a router?