I am completely new to ST, but I have still in a few days solved most of my issues, but I can’t find a working Device Handler for a dimmer puck (2 gang dimmer) with manufacturer ID _TYZB01_v8gtiaed model TS110F
One channel is working with the dimmer device handler and I manage to get on/off working with the “integrated ZigBee Switch” device handler:
I think I have figured out a few things, the problem seems to be that there are no device handlers for dimmer child-devices in the standard device handlers. So I must create a child device for dimmers (which should be quite easy based on the code I have parsed), but then I also must take a copy of “zigbee-multi-switch” & “zigbee-dimmer” and merge these figuring out the zigbee clusters that I need to write to to set the dimmer level. That is not as easy for a newbie.
Is there a good template that I can use for child-devices in dimmers? I have found a few devices that may be possible to use, but I have no clue which one to use as a template for this. None of them has worked when I have tried them “out of the box”.
I guess I just have to print out the code for several of them (as well as the device handlers above), compare and use a highlight pen as I used to do back in the days when I was actively coding…
Any help in the right direction would be very helpful. Any help in acknowledging that I am on the right track would also be appreciated.
That dimmer is made by Tuya and sold under many different brand names, including Losonho, yagusmart, and Zemismart. (Zemismart also offers a Z wave version, so make sure the DTH you find is for Zigbee.)
Smartthings has never been very good at multi endpoint devices, and the child device construct was a way around that. However, the way that multi button devices, which is what a two gang looks like in many DTHs, are handled changed significantly a few months ago, so many DTHs older than October 2020 won’t work correctly with the new V3 app. Even if they worked just fine with the classic app.
The Number of Buttons Value
In particular, the old generation used “number of buttons” for multi button devices, and this was also commonly used for a device that had one button with multiple tap patterns like double tap, triple tap, etc. where the DTH would spoof individual buttons for the different tap patterns.
The newest architecture went too far the other way and now you’ll see DTHs for a triple gang switch with a DTH that says there is only one button, but is using 5 tap for the third gang, etc.
It’s all very confusing. so if you are going to use code from a different device, you might want to look up a picture of the device before you start so you understand what the code author was trying to work with.
Anyway… The new platform doesn’t use the “number of buttons“ value, but the official SmartLighting feature and Webcore still do, so you even see some brand new custom DTHs now which are using “number of buttons“ but then only work with smartlighting and Webcore, they don’t work with other automations.
The most common symptom is the only one button works and the others are ignored. But there could be other symptoms as well
So that’s the first thing to be aware of before you start researching, or you might be bringing in bits of code that no longer work.
None of this is clearly documented in any of the official documentation yet, at least not that I’ve seen. Individual community members have worked it out over time, so quite a few DTHs have been updated. But not all, and not even all of the official versions.
And if it all sounds very confusing, it is. So I just wanted to make sure you knew a bit of the history before you get out that yellow highlighter.
I suggest you check the forum for threads on the Tuya or Zemismart Multi gang Zigbee devices and look for posts since October 2020. You should find something useful there. Just be sure to read carefully to determine if the code you were going to look at only works with smartlighting/Webcore or if it has been fully updated for the new automations.
Tagging @johnconstantelo just because he uses a lot of zigbee devices and might have something to add.
And here’s one for a multi gang switch (not dimmer) from this line that just went up today. However, it looks like it’s using number of buttons, so I would expect it to work with Webcore but not with automations using the new rules API. But I might be wrong on that, I’ve asked the author to clarify.
Actually you nailed it. It’s doable, but since there’s no child device for a dimmer, you’ll have to develop that one. I used “zigbee-multi-switch” when developing the DTH for Aqara’s double rocker to include power reporting.
Also, you probably already know this, but just for clarity, smartthings adopted some of the Zigbee terminology and applied it for Z wave devices and some of the Z wave terminology and applied it for Zigbee devices, which can add more confusion.
Anyway, in smartthings a “multilevel switch“ is a dimmer. The levels are the dim percentages like 10%, 50%, 75%, etc. up to 100%. But for many devices are expressed as 0 to 256 to allow for conversion to hex.
I went through the code of the standard zigbee-dimmers, switch child-devices and multi-switch devices yesterday and I think that the codes for these should be possible to merge. It will take me a day or two, but the dimmer child-device is actually already done, that part was simple.
The main thing that worries me is if the child-device commands are going to work as they are supposed to, but I will tell you after the weekend.
It is so difficult to code in a run-time typed programming language.
New errors popping up here and there.
It is not simpler when many of the examples are not working.
Documentation is not helping much either. I am currently stuck at sending a command or writeattribute to the secondary channel for setting the level, I can’t get that working. If it is not complaints about null pointers, it is complaining about the wrong datatype.
Is it possible to get a reference to something similar? I have looked around but I haven’t found any working code doing exactly that. Any pointers? Anyone?