You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I have some Zigbee Water Leak sensors (Manufacturer: HOBEIAN, Model: Water leak sensor, Model ID: ZG-222ZA) and the battery voltage/percentage can fluctuate when it begins to get low.
Therefore the battery low event keeps retriggering
Describe the solution you'd like
Add an option per-device to latch the battery low state, perhaps until the battery replaced button is pressed.
Describe alternatives you've considered
Adjusting the low battery threshold, but this is not possible as the level can fluctuate so wildly.
Morning Andrew
I've had a go with Filter Outliers, but unfortunately it's having the opposite effect I'd hoped, as it's locked the battery high rather than low
⬆️Native Battery
⬆️Battery+
These sensors only fluctuate the battery once they are low
It's been a long time since I looked at the outlier code and forgot how it worked, it filters short lows only which is more common.
A high outlier won't work as looking at your data it spends significant time high.
An advanced latch option would be the only way to solve this one, but that would rely on you pressing the battery replaced to clear it, and I'd have to think about whether it would be wise to keep the latch during restarts.
I'll add it as an enhancement but it's quite niche so won't come onto my list that soon.
(I haven't run this integration yet, so grain of salt.)
I have been using the threshold helper for this sort thing: alarms for a value getting out of range. Battery level, temperature, moisture%, derivatives of moisture%, etc. There is code (which is not hard code) to take a threshold A and a tolerance B, and basically latch on >= A+B, and turn off at A-B, and in between no change. I have further modified my local copy to not change the output on unavailable, but I haven't tried to submit it upstream as I suspect it's messy when that's good and when it isn't.
It seems to me like @LewisSpring's problem would be nicely sovled by thresholds, basically turn on saying LOW at 10%, turn off at 70%. I will also say that the battery% reporting for that sensors looks really wonky to me. I am used to jitter across thresholds, but hitting 10 and recovering to 100% seems bizarre.
Activity
andrew-codechimp commentedon May 14, 2026
Hi, have you tried switching on Filter Outliers (in advanced for the battery note on a device) ?
That tries to eliminate these fluctuations.
LewisSpring commentedon May 14, 2026
Hi Andrew, no, I hadn't tried that because I had thought it wasn't applicable to this situation - let me give that a go and let you know if it helps.
Thanks for the quick reply!
LewisSpring commentedon May 15, 2026
Morning Andrew
I've had a go with Filter Outliers, but unfortunately it's having the opposite effect I'd hoped, as it's locked the battery high rather than low
⬆️Native Battery
⬆️Battery+
These sensors only fluctuate the battery once they are low
andrew-codechimp commentedon May 15, 2026
It's been a long time since I looked at the outlier code and forgot how it worked, it filters short lows only which is more common.
A high outlier won't work as looking at your data it spends significant time high.
An advanced latch option would be the only way to solve this one, but that would rely on you pressing the battery replaced to clear it, and I'd have to think about whether it would be wise to keep the latch during restarts.
I'll add it as an enhancement but it's quite niche so won't come onto my list that soon.
LewisSpring commentedon May 18, 2026
Hey Andrew - that's understandable and thank you for the consideration!
gdt commentedon Aug 15, 2026
(I haven't run this integration yet, so grain of salt.)
I have been using the threshold helper for this sort thing: alarms for a value getting out of range. Battery level, temperature, moisture%, derivatives of moisture%, etc. There is code (which is not hard code) to take a threshold A and a tolerance B, and basically latch on >= A+B, and turn off at A-B, and in between no change. I have further modified my local copy to not change the output on unavailable, but I haven't tried to submit it upstream as I suspect it's messy when that's good and when it isn't.
It seems to me like @LewisSpring's problem would be nicely sovled by thresholds, basically turn on saying LOW at 10%, turn off at 70%. I will also say that the battery% reporting for that sensors looks really wonky to me. I am used to jitter across thresholds, but hitting 10 and recovering to 100% seems bizarre.