Custom Capability and CLI Developer Preview

@nayelyz Looking for your help once again. I know we spoke earlier about isComponent=true child devices, but today’s question is about the isComponent=false variety. The child is displayed on the dashboard but remains in the offline state, everything grayed out.

I have no problem creating the child device. From the parent, I can sendEvent to the child for attribute “switch”. I know this is working because the I see it in the child event log and if the parent interrogates the child, the new value is returned. All Good. For the child DTH I created a deviceConfig listing just the switch capability. After creating this I added the vid: into the child and saved it. The child shows the controls you would expect for a switch capability, but the switch state shows the cloud icon instead of the on/off state. I will include the child DTH code and the device presentation.

/**

  • Switch Child Device

*/
metadata {
definition (name: “Switch Child Device”, namespace: “futuredance12594”, “vid”: “e92cc1cb-5184-3238-9f49-8703c5d748be”, “mnmn”: “SmartThingsCommunity”) {
capability “Switch”
capability “Refresh”
capability “Configuration”
}
preferences {
input “poolSpa1”, “enum”, title: “Pool or Spa”,
options:[[0:“Pool”],
[1:“Spa”],
[2:“Both”]]
}
}

def updated() {
log.debug("----- updated()")
sendEvent(name: “switch”, value: “off”, displayed: true, descriptionText:“Initial Value”)

}

def List configure() {
log.debug("----- configure()")
sendEvent(name: “switch”, value: “on”, displayed: true, descriptionText:“Initial Value”)

}

void on() {
log.debug("----- on()")
parent.childOn(device.deviceNetworkId)
}

void off() {
log.debug("----- off()")
parent.childOff(device.deviceNetworkId)
}

void refresh() {
log.debug("----- refresh()")
parent.childRefresh(device.deviceNetworkId)
}

and the Device config JSON:

"dashboard": {
    "states": [
        {
            "component": "main",
            "capability": "switch",
            "version": 1,
            "values": [],
            "patch": []
        }
    ],
    "actions": [
        {
            "component": "main",
            "capability": "switch",
            "version": 1,
            "values": [],
            "patch": []
        }
    ]
},
"detailView": [
    {
        "component": "main",
        "capability": "switch",
        "version": 1,
        "values": [],
        "patch": []
    }
],
"automation": {
    "conditions": [
        {
            "component": "main",
            "capability": "switch",
            "version": 1,
            "values": [],
            "patch": []
        }
    ],
    "actions": [
        {
            "component": "main",
            "capability": "switch",
            "version": 1,
            "values": [],
            "patch": []
        }
    ]
},
"type": "dth"

}

The preferences in the child are merely to enable the Settings menu.

and the parent’s child creation:
addChildDevice(namespace=“futuredance12594”,DTH Name=“Switch Child Device”, dni=“37-ep1”, hubId=null,properties=[completedSetup: true, label: “Pool Control - Switch 1”,isComponent: false, componentName: “ep1”, componentLabel: “Pool Control - Switch 1”]

This worked fine in the Legacy App. I’ve done all the usual cache reset tricks and waited days, but no change. I have another child which uses the thermostat capability which has the same issue, correct controls for a thermostat capability, but all disabled. Hopefully the same fix will apply to both.

Any ideas?

Keith