Hi everyone, I have been searching for awhile to find an easy to install and easy to use notification service that would tell me when my devices get low on battery AS WELL AS when they go unavailable, probably due to a dead battery, some devices even though they will show like 40% battery could very well die the next day.
So this is my attempt at combining a few bits of code from others on Github.
Here is the link to the Blueprint, this is my first attempt at this so not sure how to create a cool import link like others
Insane, omw home and figured I’d check if there’s a blueprint that would improve on my already implemented “availability monitor” and here you are, creating one no more than five hours ago
Thank you, I will try this out
It will report battery levels if it finds they are lower then your threshold… if its unavailable obviously no battery level will be reported
Also I just made an update, I removed the entity selection for battery only devices. I had a outlet/switch I only use during Christmas time unplugged so it kept saying unavailable obviously. Now you can select any entity to exclude, not just devices with a battery type. Check the github for the latest update.
How would you set up actions for this?
Ideally I’d only want to e.g. receive a mobile notification once one of the sensors drops below the threshhold or becomes unavailable. I only managed to set up a “generic” notification where the {{sensors}} is empty if none are low/missing.
I create an automation using the blueprint then in the Actions section at the bottom of the automation I just have it email me once a day if it finds any. Works well for me
Hey fellow coders.
I am using this blueprint as well.
But I also have Battery Notes Integration installed. This integration knows which battery types I have in which device.
My goal was to not only get a notification of which device needs a battery replacement, but also what batteries I need to purchase and how many.
For this to work, I have changed one line in the blueprint:
low_battery_notification.yaml
line 95:
sensors: "{% set result = namespace(sensors=[]) %}{% set batteries = namespace(battery=[]) %}{% for state in states.sensor | selectattr('attributes.device_class', '==', 'battery') %}{% if 0 <= state.state | int(-1) < threshold | int and not state.entity_id in exclude.entity_id %}{% for object in states.sensor %}{% if object.attributes.friendly_name == (state.name + ' type') %}{% set result.sensors = result.sensors + [state.name ~ ' (' ~ object.state ~ ' -> ' ~ state.state ~ ' %)'] %}{% set batteries.battery = batteries.battery + [object.state] %}{% endif %}{% endfor %}{% endif %}{% endfor %}{{result.sensors|join(', ')}}"
Thought I want to share this.
What I also still want to create is an automation that adds the required battery to my Home Assistant Shopping list, but only if it is not already on the list (to avoid filling up the shopping list until I actually have purchased the specific battery).
I use this in an automation and send the notification to my phone. It runs daily. Does anyone know what I should put in my automation to have it not notify me if there are not any sensors with low batteries?
Currently I get the notification with the title (the following devices are at or below 20% battery levels:) and of course there is no data. It does work properly when a battery is low but I don’t want notified if there are not any low batteries.