Low battery level detection & notification

This blueprint will run at a specific time and day of the week and will provide you a list of battery devices that have their battery level below a threshold.



Notification action example:

service: notify.home_email
data:
  title: Home Assistant - Battery Monitor
  message: Low battery detected in {{sensors}}.

To use the blueprint use the link below to import it to your Home Assistant installation:
Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

If you want to change something or check the code, go to my git repo: https://github.com/gmlupatelli/blueprints_repo

To do:

  • Figure out a way to expand the devices and areas inside the template. Right now I can only exclude entities :frowning:

Original Code
The original author for the core of the code is Sbxy, my version basically slightly improves the UI for choosing the days the automation should run. Check his version here: Low battery level detection & notification for all battery sensors

34 Likes

This is pretty cool. I like the idea of scheduled notifications being built right into the blueprint.

Hi, great work.

maybe you can add a function, to only “Include Sensors”.

I thought about it, but given that each sensor has its own device class, like opening for windows sensor, the only way to future proof against new sensor types was listing all devices from the battery device_class.

This will also include your cellphone if you have the home assistant app installed, but you can always include it in the exclude list if that bothers you.

1 Like

Thanks! Great job!

Thank you, great automation :+1:

I’d still prefer an include instead of an exclude to define my battery level entities manually.

How would one send an email about the low batteries?

I’m getting an empty notification like

Low battery detected in ⤵ 
-.

every time the automation is scheduled.
As far as I can see this is not intended. Any suggestions how to fix this?

1 Like

How would one send an email about the low batteries?

configure an SMTP integration

1 Like

same here. Really great blueprint, but I also receive those false positives.

Thanks for sharing! email seems to send message ok but if i use app notification(sms) it cuts off message after a couple batteries. kinda weird but email seems to send full list. Thanks again

Humm…I need to have a look at it. This is not happening for me.

Can you share your template YAML?

@axelander, no need to share your yaml. I forgot to update the conditions when I update the sensor list to use line breaks.

@axelander and @da_anton, just delete and re-add the blueprint I just updated it at git.

1 Like

great, thanks for the quick fix @gmlupatelli :+1: - all looks ok now, I tested both cases.

Hello Gus,
I’ve just added your blueprint, and I’m still receiving false positives. Every time I run the automation I receive a notification like this:


Low battery detected in :arrow_heading_down:
-.

Thanks for your support.

Can you have a look at your Trace?

You should see something like this in the second test:

If your second test is not testing for this '{{ sensors != "⤵ \n-"}}', please delete and re-add it.

Just in case here is the link to it: blueprints_repo/low_battery_notification.yaml at ff26cebe9ed8a3f99298fa34d4725341ed92bd60 · gmlupatelli/blueprints_repo · GitHub

1 Like

Hello Gus,
thank you very much for your followup.
In the automation traces, it would appear that the second set of conditions matches the one you mentioned, however I keep getting a message every time I launch the automation.

I don’t know exactly why, but if you manually run the automation it will not evaluate the template conditions.

I can see from your trace info that it is what you are doing as the * in the beginning is grayed out.

If the automation is triggered by the schedule it will evaluate the conditions and stop executing when there is nothing to report.

Works great for me.
As mentioned before, if you want to test it manually you get weird results but it gives correct results on the time and day i have set it to report.