diff --git a/devicetypes/smartthings/smartpower-outlet.src/smartpower-outlet.groovy b/devicetypes/smartthings/smartpower-outlet.src/smartpower-outlet.groovy index e663629..fa9a0e1 100644 --- a/devicetypes/smartthings/smartpower-outlet.src/smartpower-outlet.groovy +++ b/devicetypes/smartthings/smartpower-outlet.src/smartpower-outlet.groovy @@ -69,6 +69,9 @@ metadata { def parse(String description) { log.debug "description is $description" + // save heartbeat (i.e. last time we got a message from device) + state.heartbeat = Calendar.getInstance().getTimeInMillis() + def finalResult = zigbee.getKnownDescription(description) //TODO: Remove this after getKnownDescription can parse it automatically @@ -109,6 +112,7 @@ def on() { } def refresh() { + sendEvent(name: "heartbeat", value: "alive", displayed:false) zigbee.onOffRefresh() + zigbee.refreshData("0x0B04", "0x050B") }