From d864c5e3b3d4735133876cada6e256a7c082b473 Mon Sep 17 00:00:00 2001 From: Donald Kirker Date: Fri, 26 May 2017 01:18:02 -0700 Subject: [PATCH] ICP-1076 Fix Aeon Door/Window Sensor 6 initial value of null --- .../zwave-door-window-sensor.groovy | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/devicetypes/smartthings/zwave-door-window-sensor.src/zwave-door-window-sensor.groovy b/devicetypes/smartthings/zwave-door-window-sensor.src/zwave-door-window-sensor.groovy index 0cf6d46..835d7af 100644 --- a/devicetypes/smartthings/zwave-door-window-sensor.src/zwave-door-window-sensor.groovy +++ b/devicetypes/smartthings/zwave-door-window-sensor.src/zwave-door-window-sensor.groovy @@ -113,9 +113,9 @@ def updated() { def configure() { commands([ - zwave.manufacturerSpecificV2.manufacturerSpecificGet(), - zwave.batteryV1.batteryGet() - ], 6000) + zwave.sensorBinaryV2.sensorBinaryGet(sensorType: zwave.sensorBinaryV2.SENSOR_TYPE_DOOR_WINDOW), + zwave.manufacturerSpecificV2.manufacturerSpecificGet() + ], 1000) } def sensorValueEvent(value) { @@ -190,11 +190,17 @@ def zwaveEvent(physicalgraph.zwave.commands.wakeupv1.WakeUpNotification cmd) cmds << command(zwave.manufacturerSpecificV2.manufacturerSpecificGet()) cmds << "delay 1200" } + + if (device.currentValue("contact") == null) { // Incase our initial request didn't make it + cmds << command(zwave.sensorBinaryV2.sensorBinaryGet(sensorType: zwave.sensorBinaryV2.SENSOR_TYPE_DOOR_WINDOW)) + } + if (!state.lastbat || now() - state.lastbat > 53*60*60*1000) { cmds << command(zwave.batteryV1.batteryGet()) - } else { + } else { // If we check the battery state we will send NoMoreInfo in the handler for BatteryReport so that we definitely get the report cmds << zwave.wakeUpV1.wakeUpNoMoreInformation().format() } + [event, response(cmds)] }