Catching a low battery notification

Hi,

I have a couple of Aeotec zw112 door/contact sensors, they seem to have some issue reporting battery level. However it does have some sort of low battery alarm but I don’t know how to get this in a channel or trigged in a rule?

The only indication I get is in the Z-wave log like this:

2017-07-06 10:03:52.872 [ZWaveBatteryCommandClass ] - NODE 64: BATTERY LOW!

ZW112 data sheet link

Anyone?

The low battery warning is the same channel as the battery reading. If the device reports a level of 255 (from memory) then the battery is considered in alarm. This isn’t reported as a separate channel - it’s reported as a 0% battery so you should trigger any rules off the battery level.

1 Like

Oh I see! Thanks, I’ll try updating my rules based on that :smiley:

Just be aware that once you cross your low battery threshold the rule will keep firing. The approach I took was to do a daily battery check and only report if below my threshold (I have it at 20%). You could also use a fire once until back above threhold system variable / check

Hi,

would it be possible to post the rule you implemented here because I want to have a better implementation for this. My current implementation simply checks for every battery item on change if it is 0.

@chris: Would be great to have an option to activate a push notification via myopenhab ore something like this if you trigger the Log message ("logger.warn(“NODE {}: BATTERY LOW!”, this.getNode().getNodeId());). Because it’s a really central problem if you have a lot of battery devices. What do yout think.

Christian

Of course you can do this if you want. The battery level is provided as an item - from this you can generate whatever notification you like. As I say above, the battery low notification is exactly the same as the battery voltage.

Sorry - I’m obviously missing something - what is the “central problem”?

I use this:
All my battery items are in the group Batteries:
Rule fires every day at 10:55 and sends me an email

rule "Battery Monitor"
when
    Time cron "0 55 10 * * ?"
then
    if (!Batteries.allMembers.filter( [ battery | (battery.state as Number) <= (lowBatteryThreshold) ] ).empty) {
        val String report = Batteries.allMembers.filter( [ (state as Number) <= (lowBatteryThreshold) ] ).sortBy( [ state as Number ] ).map[ name + ": " + state.toString ].join("\n")
        val message = "Battery levels:\n\n" + report + "\n\nRegards,\n\nOur House"
        sendMail("myemail@provider.com", "Low battery alert !", message)
    }
end

I had a rule similar to vzorglub’s.

Many Thanks

A central problem for me is the monitoring of the battery level because it feels like one of the devices always wants a n new one. So no central problem of the Z-wave implementation. I was thinking about having something hardcoded for battery alerts in the binding. But after thinking one more time about it it makes no sense because it contradicts the general paradigm of openHAB. I will do it with the rule provided by vzorglub.

1 Like

Quick disclaimer
This rule was plucked out of the old 1.8 wiki
It has changed a bit since then due to OH version changes but not much
Credit where it’s due