JMack89427:
I've been messing around with the 3.0 DTH and my main issue revolves around the creation of the child devices, as mentioned previously. I can get them created if I change this line:
addChildDevice("erocm123", "Switch Child Device", dni, null, [completedSetup: true, label: "${name}", isComponent: false, componentName: "ep${childNo}", componentLabel: "Switch ${childNo}"])
to this:
addChildDevice("erocm123", "Switch Child Device", dni, null)
Otherwise I get this error:
addChildDevice failed: groovy.lang.MissingMethodException: No signature of method: dev1531023368173126233545.addChildDevice() is applicable for argument types: (java.lang.String, java.lang.String, org.codehaus.groovy.runtime.GStringImpl, null, java.util.LinkedHashMap) values: [erocm123, Switch Child Device, 07-ep5, null, [label:Switch 5]]
Given my lack of experience with groovy, any help would be appreciated.
Give this a try:
addChildDevice("erocm123", "Switch Child Device", dni, [isComponent: false, name: "ep${childNo}", label: "Switch ${childNo}"])
Here is the documentation regarding Hubitat's implementation of Composite Device Drivers. You should be able to make some minor tweaks to the original code to make it work with Hubitat.
Hubitat now supports devices having child devices. The methods that are available are as follows:
Parent Device Methods:
ChildDeviceWrapper addChildDevice(String namespace, String typeName, String deviceNetworkId, Map properties = [:])
ChildDeviceWrapper addChildDevice(String typeName, String deviceNetworkId, Map properties = [:])
Creates a new child device and returns that device from the method call.
Parameters:
Type
Parameter
description
String
namespace
The namespace of the chi…
1 Like