From 45da8e9feefb42119ec8d33f144c787f55cc9e8b Mon Sep 17 00:00:00 2001 From: larsfinander Date: Sat, 29 Aug 2015 20:26:44 -0700 Subject: [PATCH] Smart outlet heartbeat fix -Readded heartbeat calls that were accidentally removed. --- .../smartpower-outlet.src/smartpower-outlet.groovy | 4 ++++ 1 file changed, 4 insertions(+) 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") }