On clearance, they must be moving to a different packaging or different product. Two stores went out of stock in these around me today before I could grab one.
I noticed a similar behavior; Iāve fixed it by customizing the Everspring Flood device type to remove the wakeUpNoMoreInformation() command on the handling of the wakeup notification when asking for battery levels. I have also changed the ātime intervalā check, as I noticed some inconsistent timestamps returned by the default code:
ā¦
if( parsedZwEvent.CMD == "8407" ) {
def nowTime = new Date().time
def ageInMinutes = state.lastBatteryQuery ? (nowTime - state.lastBatteryQuery)/60000 : 600
log.debug "Battery status was last checked ${ageInMinutes} minutes ago"
if (ageInMinutes >= 600) {
state.lastBatteryQuery = nowTime
log.debug "Battery status is outdated, requesting battery report"
result << new physicalgraph.device.HubAction(zwave.batteryV1.batteryGet().format())
} else {
result << new physicalgraph.device.HubAction(zwave.wakeUpV1.wakeUpNoMoreInformation().format())
}
}
ā¦
Apparently the sensor doesnāt like the rapid sequence of āget battery levelā, āgo back to sleepā commands.
Now I get regular battery updates every 10 hours.
Thanks Minollo, Iām having trouble cutting and pasting your code on the device Iām on right now, so do you mind reposting using the CODE button right above the text box for new posts? Thanks! Iām getting an error with the 3rd line in your code and it may be an issue on my end.
Here you go; let me paste the whole function, it may be safer:
def parse(String description) {
def parsedZwEvent = zwave.parse(description, [0x9C: 1, 0x71: 1, 0x84: 2, 0x30: 1])
def zwEvent = zwaveEvent(parsedZwEvent)
def result = []
result << createEvent( zwEvent )
if( parsedZwEvent.CMD == "8407" ) {
def nowTime = new Date().time
def ageInMinutes = state.lastBatteryQuery ? (nowTime - state.lastBatteryQuery)/60000 : 600
log.debug "Battery status was last checked ${ageInMinutes} minutes ago"
if (ageInMinutes >= 600) {
state.lastBatteryQuery = nowTime
log.debug "Battery status is outdated, requesting battery report"
result << new physicalgraph.device.HubAction(zwave.batteryV1.batteryGet().format())
} else {
result << new physicalgraph.device.HubAction(zwave.wakeUpV1.wakeUpNoMoreInformation().format())
}
}
log.debug "Parse returned ${result}"
return result
}
Wow that was fast,thanks!
I tried your change but it didnāt seem to make a difference. Any suggestion what I may have done wrong?
Tough to tell; do you see anything in your logs for the device name you are trying to use? Every hour you should see a message telling you at least when the battery was last checked; maybe change 600 into 60 to make sure the battery report is requested at every hourly wake up during your tests.
Do you see anything in the event list for the device? You should see at least a ā<device name> woke upā event more or less every hour.
I donāt see any event.
I see debug statements in the log.
Maybe Iām missing a capability. What ones should I have checked?
I have Battery, Configuration, (I also have Polling, but itās quite useless for this device), and Water Sensor.
This is the whole code Iām running (a little cleaned up from what I shared above):
metadata {
simulator {
status "dry": "command: 9C02, payload: 00 05 00 00 00"
status "wet": "command: 9C02, payload: 00 05 FF 00 00"
for (int i = 0; i <= 100; i += 20) {
status "battery ${i}%": new physicalgraph.zwave.Zwave().batteryV1.batteryReport(batteryLevel: i).incomingMessage()
}
}
tiles {
standardTile("water", "device.water", width: 2, height: 2) {
state "dry", icon:"st.alarm.water.dry", backgroundColor:"#ffffff"
state "wet", icon:"st.alarm.water.wet", backgroundColor:"#53a7c0"
}
valueTile("battery", "device.battery", decoration: "flat", inactiveLabel: false) {
state "battery", label:'${currentValue}% battery', unit:""/*, backgroundColors:[
[value: 5, color: "#BC2323"],
[value: 10, color: "#D04E00"],
[value: 15, color: "#F1D801"],
[value: 16, color: "#FFFFFF"]
]*/
}
standardTile("configure", "device.configure", inactiveLabel: false, decoration: "flat") {
state "configure", label:'', action:"configuration.configure", icon:"st.secondary.configure"
}
main "water"
details(["water", "battery", "configure"])
}
}
def parse(String description) {
log.debug "parse"
def parsedZwEvent = zwave.parse(description, [0x9C: 1, 0x71: 1, 0x84: 2, 0x30: 1])
def zwEvent = zwaveEvent(parsedZwEvent)
def result = []
result << createEvent( zwEvent )
if( parsedZwEvent.CMD == "8407" ) {
def nowTime = new Date().time
def ageInMinutes = state.lastBatteryQuery ? (nowTime - state.lastBatteryQuery)/60000 : 600
log.debug "Battery status was last checked ${ageInMinutes} minutes ago"
if (ageInMinutes >= 600) {
log.debug "Battery status is outdated, requesting battery report"
result << new physicalgraph.device.HubAction(zwave.batteryV1.batteryGet().format())
} else {
result << new physicalgraph.device.HubAction(zwave.wakeUpV1.wakeUpNoMoreInformation().format())
}
}
log.debug "Parse returned ${result}"
return result
}
def zwaveEvent(physicalgraph.zwave.commands.wakeupv2.WakeUpNotification cmd)
{
log.debug "WakeUpNotification"
[descriptionText: "${device.displayName} woke up", isStateChange: false]
}
def zwaveEvent(physicalgraph.zwave.commands.sensoralarmv1.SensorAlarmReport cmd)
{
log.debug "SensorAlarmReport"
def map = [:]
if (cmd.sensorType == 0x05) {
map.name = "water"
map.value = cmd.sensorState ? "wet" : "dry"
map.descriptionText = "${device.displayName} is ${map.value}"
}
map
}
def zwaveEvent(physicalgraph.zwave.commands.sensorbinaryv1.SensorBinaryReport cmd)
{
log.debug "SensorBinaryReport"
def map = [:]
map.name = "water"
map.value = cmd.sensorValue ? "wet" : "dry"
map.descriptionText = "${device.displayName} is ${map.value}"
map
}
def zwaveEvent(physicalgraph.zwave.commands.alarmv1.AlarmReport cmd)
{
log.debug "AlarmReport"
def map = [:]
if (cmd.alarmType == 1 && cmd.alarmLevel == 0xFF) {
map.descriptionText = "${device.displayName} has a low battery"
map.displayed = true
map
} else if (cmd.alarmType == 2 && cmd.alarmLevel == 1) {
map.descriptionText = "${device.displayName} powered up"
map.displayed = false
map
} else {
log.debug cmd
}
}
def zwaveEvent(physicalgraph.zwave.commands.batteryv1.BatteryReport cmd) {
log.debug "BatteryReport"
def nowTime = new Date().time
state.lastBatteryQuery = nowTime
def map = [:]
if (cmd.batteryLevel == 0xFF) {
map.name = "battery"
map.value = 1
map.descriptionText = "${device.displayName} has a low battery"
map.displayed = true
} else {
map.name = "battery"
map.value = cmd.batteryLevel > 0 ? cmd.batteryLevel.toString() : 1
map.unit = "%"
map.displayed = false
}
map
}
def zwaveEvent(physicalgraph.zwave.Command cmd)
{
log.debug "COMMAND CLASS: $cmd"
}
def configure()
{
zwave.associationV1.associationSet(groupingIdentifier:1, nodeId:[1]).format() // TODO: this nodeId is the hub's node id which isn't necessarily 1
}
def poll() {
log.debug "Polling - no op"
}
Mine just reported the battery todayā¦ Strange
I re-paired mine several times. 4th time or so, the battery level appeared as soon as I paired it.
Iāve tried adding mine, and it definitely detects and reports water in the Activity Feed, but none of the built in SmartThings actions actually work (iOS Push Notification never comes; SMS never gets sent, Damage & Danger always reads āEverything is OKā).
The device itself actually beeps, and my IFTTT recipes trigger, so it seems like the iOS app/hub arenāt holding up their part of the deal. Ideally, itād also trigger my Utilitech Alarm, but that thing hasnāt made one peep since I got it. I replaced the batteries in the water sensor, but not yet in the alarm.
Any ideas?