-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Request to add support for immediate alert on low battery #3
Comments
Something tells me that you've got the alert threshold too low in that case. I run my thresholds at 40% for my house and 60% for my short-term rental properties. That gives me the alert that I need to know that the device is almost out of power and the time to make sure I've got the battery on hand. Trying to run your monitoring alerts too close to the actual power drain point isn't a really good idea! I've been bitten many times by pretty much exactly what you're talking about. I'll see if I can figure out how to do it, but I'm not actually the original author. All I did was reflow and yamllint the blueprint because the original author's version wouldn't work for me! If you have some critical devices that you need immediate alerting on when their battery hits certain levels I would also suggest setting up some dedicated alerts on just those. Finally, and this is from my experience of dealing with IoT batteries for 4+ years, there are many times I've encountered were I'll get an alert at my 60% threshold and the next day the device will be out of juice. Battery estimation, especially in these devices, tends to not be very precise. Additionally, the conditions of where the device are can affect it greatly too. |
I understand your position, although the further your writing progresses, the more you supported my point of the need for instant alerting :) |
I've been looking into this request off and on for a bit. Mostly in conjunction with some work I've been doing for an integration. Unfortunately, there is no way (that I can find) to setup a trigger condition on a variable amount of sensors. Templates used in trigger conditions are only evaluated during automation load. After that, they're set until the next reload. This would make the automation not work as expected if you have a long running HA that you add a new battery powered sensor to without restarting as it would not be monitored for the instant alerting. Having done some additional looking at this particular issue, there is a forum post related to what you're wanting here: https://community.home-assistant.io/t/automation-trigger-list-of-devices/212254/2 It's a bit old as it's from July - Aug of 2020. I played a little bit with some templates to work on it a bit and you might want to consider setting up a template sensor that does something with the following logic (I've written this so you can stick it in the dev tools templating section)
With a template sensor like that you would be able to write a notification automation if the state of the sensor has any entries in the array. Unfortunately blueprints don't allow you to define additional entities that are not part of the automation itself, outside of the inputs. So there is no way to create a blueprint based template sensor. In any case, I'll keep this open for a bit longer to see if I can noodle up a way to do what you want, but it's still escaping me on how to do it via a blueprint without requiring folks to also create a special template sensor which sort of defeats the intent behind blueprints! |
I'm using your low battery blueprint, thank you.
I'd like to request an option for immediate notification vs. scheduled.
By the time the level is tested the device may no longer have power, and this is critical for e.g. leak sensors.
The text was updated successfully, but these errors were encountered: