How to deal with capabilities with overlapping commands?

Yes, the best practice is to use a Composite Driver (i.e. Parent/Child). The Parent Driver could implement the Switch Capability for normal On/Off functionality. The Parent would also programatically create a Child device that implements the Alarm Capability. This will allow Apps to reference the Ring Camera as two separate devices.

You could also have a single Parent Device that only creates child devices (one Switch for each Ring Camera, and one Alarm for each Ring Camera (if needed)). The Parent would handle ALL communications to the Ring system, and all of the cameras would be created as child devices.

My HubDuino Arduino integration follows this design, allowing users to have many "Switch", "Contact Sensor", "Motion Sensor", etc... devices all attached to a single Arduino or ESP8266. Feel free to take a look at that groovy code to get some ideas if you like.

1 Like