So I can’t find a solid answer but I have done a hack that seems to be working. I started by adding health check to a Z-Wave device and that is working correctly. If it’s offline it does report as such and when it comes back on it clears. Here is what I did for a custom RGBGenie Z-Wave RGB controller DTH:
Add the capability:
capability "Health Check"
Make sure it registers itself whenever installed or updated. The time here is 122 minutes (2 * 60 seconds * 60 seconds + 2 * 60 seconds). I’ve seen some DTH’s use a flat value (7320 seconds) and some use the long format:
def updated() {
initialize()
}
def installed() {
initialize()
}
def initialize() {
sendEvent(name: "checkInterval", value: 2 * 60 * 60 + 2 * 60, displayed: false, data: [protocol: "zwave", hubHardwareId: device.hub.hardwareID, offlinePingable: "1"])
response(refresh())
}
Add a ping function that does something so ST sees a response:
def ping() {
refresh()
}
In the above case the refresh routine reports back some value (dimmer level or something) so ST sees this and is happy. If it doesn’t see it then it gets marked offline after a couple tries.
Now there isn’t much info on the cloud connected devices but I looked at the EcoBee sensor and thermostat DTH’s and came up with this:
At the very beginning of the DTH:
import groovy.json.JsonOutput
Add the capability:
capability "Health Check"
Make sure it registers itself whenever installed or updated:
def updated() {
initialize()
}
def installed() {
initialize()
}
def initialize() {
sendEvent(name: "DeviceWatch-Enroll", value: JsonOutput.toJson([protocol: "cloud", scheme:"untracked"]), displayed: false)
updateDataValue("EnrolledUTDH", "true")
}
Then whenever data is updated make sure to let the cloud know it’s online:
sendEvent(name: "DeviceWatch-DeviceStatus", value: "online")
So now my ST_Anything devices show up correctly in the new app and work great. But if they actually went offline is there anyway of knowing? Again the “cloud” DTH health check is just a copy from ST’s own EcoBee and I don’t see any time outs or anything. In fact the scheme:“untracked” part is pretty worrying. I have a controller with this code right now that’s been in a box for two days offline but show online and I’m assuming that’s why.
What am I missing or is there a better DTH to look at?