[Release] Tuya 1-gang and 2-gang dimmer module driver

Hi all, this is my first attempt at writing a driver for Hubitat. Hope it is of use to others out there.

It supports Tuya 1-gang and 2-gang (1 and 2 channel) dimmer modules which are sold white-label under many other brand names, or none at all (I got mine via eBay!). Specifically this driver currently supports these devices:

Model What Identifies via Zigbee as
QS-Zigbee-D02-TRIAC-LN 1 channel (1-gang) dimmer module TS110F
_TYZB01_qezuin6k
QS-Zigbee-D02-TRIAC-2C-LN 2 channel (2-gang) dimmer module TS110F
_TYZB01_v8gtiaed

Install in the usual way via the Hubitat Elevation web based interface:

  1. Click "Drivers Code" then click "New Driver" then "Import"

  2. Enter this Import URL then click "Import"
    https://raw.githubusercontent.com/matt-hammond-001/hubitat-code/master/drivers/tuya-zigbee-dimmer-module.groovy

  3. Click "Save"

See the README for more details/documentation on how to use the driver

This driver and any others I write in future are available here on GitHub under the BSD 3-clause open source licence. Any suggestions/feedback from more seasoned driver authors will be gratefully received.

3 Likes

Which ones did you buy? I'm in the market for just such a device and there are many listed! :slight_smile:

1 Like

This is the eBay listing that I purchased from:

1 Like

these are the ones I bought myself
hope that they work with these drivers or that it won't be too difficult to to modify the drivers in case my ones are a bit different

Looks like it might be the same one. Let me know if it works!

Will definitely post an update when they do. It might take another month before they get here.

from doing a good bit of research the only alternative I found for UK/Ireland 2-gang are the Aurora AU-A1ZB2WDM2P
They have the advantage that you can still control the dimming at the wall, but they're very expensive and they don't have a neutral wire so they will potentially have issues with lights not fully turning off.

Tuya, Xiaomi Sonoff and other Chinese companies are really impressive at coming out with cheap smart products, some with features that are hard to find at a reasonable price in US or EU products.

Out of curiosity because I'm looking to start writing device drivers, how did you write these drivers? Did you reverse engineer them from scratch and if yes what tools did you use? Or did you find the information in a driver for another platform and just ported it to HE?

Writing drivers - these dimmers use standard ZigBee protocols for dimmers. So actually the biggest challenge was learning how to write a driver for hubitat. In fact I'll be honest and say the learning curve was a bit of a struggle. I looked at other drivers written by people and shared here as well as the examples that hubitat share publicly.

Hubitat's developer documentation frankly leaves a lot to be desired in my opinion. It's largely incomplete and contains virtually no explanations that I could find. I ended up relying on Samsung smartthings developer documentation primarily.

Finally, I also ended up looking at the ZigBee cluster library spec.

Then an awful lot of trial and error.

I don't know if there is a better way, or some better references out there. Would love if anyone can point me anything useful.

I've not come across that Aurora dimmer - looks good. But it's expensive! Especially compared to the Tuya option!!

Thanks very much for the reply. I was afraid your answer was going to be along those lines.

I'll personally wait until my Xbee and CC2531 sniffer arrive and hopefully that will make it somewhat easier for me. Thanks for some of the pointers to some of the things that are useful to read

Ah interesting. Will be good to hear how you get on with it. I've not got any sniffer kit and only have a rudimentary understanding of the protocols thus far.