Getting a sensor BATTERY LOW as an event instead of a warning

Using openhab 1.8.3, I am getting battery level events from a PIR using this config
Number BatteryDownstairs “Motion Sensor1 Battery” { zwave=“7:command=BATTERY,refresh_interval=86400”}
I recently got an event of the form
2017-07-26 15:16:51 - BatteryDownstairs state updated to 0
I note in the openhab.log (not the events log), that there was a more user friendly
2017-07-26 15:17:42.874 [WARN ] [i.p.c.ZWaveBatteryCommandClass] - NODE 7: BATTERY LOW!
OK, I’m getting a notification, but is there any way I can get the BATTERY LOW warning as an event as well?
The reason I ask is that it seems to me that some of these sensors (especially the older ones) are not very good at monitoring battery levels, so when it reports 40% battery, what it really means is that it’s nearly gone and will fall fast now.
Whereas (I’d like to think), a BATTERY LOW event is a more consistent indicator of “i’m nearly gone” than any number.

I’ve got a listener subscribing to mosquitto so it also ‘sees’ the state change to 0 but can I get a BATTERY LOW event published as well?

Thanks in advance


From a ZWave perspective, it’s the same thing. The device reports a value of 100 to 0, and then it goes to 255 to say “BATTERY LOW”. So the information arrives in the same way as the battery percentage. If the device reports 255, then I report this as 0% - so if you’re checking against 0%, then you are doing exactly the same as checking for the battery low.

Thanks for a quick response Chris - I had a suspicion that the sensor (Everspring SP103) would occasionally just stop before it reported low values of battery. If this was the case (and I’d have to go back through my logs to validate it), what you’re saying is that I wouldn’t have seen a BATTERY LOW anyway, since you would only report BATTERY LOW at 0%. If the sensor just goes off at (say) 30% then that’s the end of that. Is that right?

I’m not sure I understand the question - sorry…

If the device reports the BATTERY LOW condition, then you will see a value of 0%. If the device doesn’t report the battery low condition, and stops at 30%, then no, you won’t get this report.

If you set a rule to report a battery low alarm at 0% (or, let’s say <10%), then it will definitely trigger under this condition - so long as the device reports it.

Does that makes sense? Or maybe I misunderstood the question?

Yeah - thanks Chris