Best way to handle a multi-channel device for ST integration

Hello All,

I’m in the middle of writing a Device Handler for the FortrezZ MIMO, which is a multi-channel device (it has two inputs and two outputs). I can communicate with the device without any trouble, where I am having some trouble is figuring out what events to send to the ST system so that potential SmartApps can consume the data.

Here’s the question: How can I send events from the device handler using the standard capabilities whilst differentiating between Signal 1 and Signal 2? Similarly, how can I receive standard events (on/off) and determine which relay to turn on and off? I would like to avoid a situation where every SmartApp using the second channel needs to be hard coded to accept the right events.

Thanks for your help!

Dan Kurin

Unless I’m missing something, the typical way to handle this is to use a Virtual Device (or child devices) to represent the second channel (and keep it in sync with a SmartApp).

One excellent example is Hue Bulbs via the Hue Bridge. Technically the Hue Bridge is a single “Device”, but the Hue (Connect) SmartApp spawns and maintains sync with all the lightbulbs connected to the Bridge.

You can use the quick browse list in the community created wiki and view device type handlers in the “miscellaneous” category and you’ll see several multi end point devices there. There are also some in the relay category. As @tgauchat said, it’s usually done with virtual child devices.

1 Like

I wasn’t even aware of Child Devices, so I’ll check that out. Is this the best documentation of this feature?

@JDRoberts Thanks, I wasn’t aware of this wiki either. I guess I need to spend more time on the forums rather than just reading the official docs.

1 Like

As you noted… the “best” documentation is likely in this Community or Wiki or whatever.

But, if in doubt, I always go back to the official and moan and complain if they are out of date.

1 Like