Send associationSet to Enerwave Motion on wake only when it isn't already working

This commit is contained in:
Duncan McKee
2016-02-24 18:07:48 -05:00
parent a9c078c0cb
commit 8933510436

View File

@@ -120,7 +120,7 @@ def zwaveEvent(physicalgraph.zwave.commands.wakeupv1.WakeUpNotification cmd)
{
def result = [createEvent(descriptionText: "${device.displayName} woke up", isStateChange: false)]
if (msr == "011A-0601-0901") { // Enerwave motion doesn't always get the associationSet that the hub sends on join
if (state.MSR == "011A-0601-0901" && device.currentState('motion') == null) { // Enerwave motion doesn't always get the associationSet that the hub sends on join
result << response(zwave.associationV1.associationSet(groupingIdentifier:1, nodeId:zwaveHubNodeId))
}
if (!state.lastbat || (new Date().time) - state.lastbat > 53*60*60*1000) {