ogiewon
September 4, 2017, 1:29am
2
Dan,
I don’t believe you can reference another device from within a traditional DH. Only a SmartApp can do that.
However, SmartThings recently released a new type of Device Handler called the Composite Device Handler (or Parent/Child Device Handler.) http://docs.smartthings.com/en/latest/composite-devices/index.html
I have written an Arduino Library and associated Device Handler which takes advantage of the Composite Device Handler design. This allows a single parent device handler to create multiple child devices (even of the same Device Capability) and have them all readily accessible to “normal” SmartApps (i.e. no custom attributes are required at all!)
Take a look at TS_Anything below:
UPDATE 2022-08-17 - Per this recent SmartThings announcement, the Groovy IDE will disabled on September 30, 2022 . My best guess is that any existing ST_Anything devices will probably cease to operate at this time, or shortly thereafter. It has been a good 7+ year run for ST_Anything users. I want to thank you all for making ST_Anything a successful project! My son and I really had a lot of fun creating it together, and have enjoyed hearing how you have all used it in so many creative ways.
As many of you probably already know, I have moved on from ST and have ported ST_Anything over to Hubitat as “HubDuino” . If you have devices running ST_Anything that you ‘can’t live without,’ at least you know you have options. Another option for ESP8266/ESP32 users would be to use ESPHome along …
Dan