Hi,
I have a ZigBee device that can control other devices via a different RF protocol. And the number of devices connected to my ZigBee device may vary. When I pair my ZigBee device to ST, I want the number of RF devices to reflect how many tiles will show on the “tiles” screen. For example, if I have 2 RF devices, then 2 tiles should appear on the “tiles” screen like this:
You’ll need to use a Composite Device Handler design to achieve this. One Parent Device Handler and Child Device Handler(s). The Parent will create the child devices so they are exposed as individual devices to all other SmartApps.
Here’s an example of a DTH that demonstrates the design.
If you additional examples, you can look at my ST_Anything DTHs.
Cool. I also want to group channels together - like a scene. So, if I have 20 channels in the ZigBee device, is there a way to group these channels - 10 channels in group1 and 10 channels in group2?
Controlling groups of child devices is absolutely no different than controlling a group of independent physical devices. Most people use Routines or webCoRE Pistons to control a group of devices.
You can programmatically call them anything you like when creating them. If the child devices are created with “isComponent: false”, then each child can have its label changed from within the ST Mobile App (at least it works on iOS.)
It works. I see all 5 separate channels now. However, I see the parent show up too. Is there a way to prevent the parent from showing up in the things view?
@ogiewon So I’ve been trying to use a child device to control the parent. However, when I try the below code in the parent handler, the parent doesn’t turn on. Why is this so?