Low battery level detection & notification for all battery sensors

@Sbyx Thanks for this awesome blueprint! I just set it up and it was a piece of cake.

These are brilliant, thanks!

Feature request

I like the blueprint, but the reason why I cannot fully use it for my battery powered devices is because I have devices which does not show the battery status in percentage but with an entity “battery_low” = true entity.

Would be great if the blueprint would also cover battery_low entities.

This works well thanks. I think it should also check for unavailable too in case battery has aleardy died.

Just use the Battery Notes integration and monitor the battery low entities with a template.

I’d second the Battery Notes suggestion. This thread is full with great lovelace configs:

And here are some automations you might find useful:
https://andrew-codechimp.github.io/HA-Battery-Notes/community/

2 Likes

I forked this blueprint and updated it so now you can use labels, areas, and devices in the “Excluded Sensors” input.

Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

I wrote a little blog post about the fix Home Assistant: using target in blueprints - Evan Moses

7 Likes

AH YEAH! This seems to work really well and should be merged.

Hey im trying to use this but rather than checking daily i want it to get sent into a To-Do list where each device with a low battery instantly goes into the list and the list automatically update the battery percentage of the devices as it goes down, as to also delete them from the list once they have been fixed, does anyone have any idea how to do this?

1 Like

Have a look at the Battery Notes integration.

2 Likes

Suddenly, the below no longer provides the name of the sensor and its battery state. It’s just blank after "Low battery warning for: " – Any idea why this would stop working?

  message: "Low battery warning for: {{sensors}}"

Thank you for sharing this. How do I modify the Battery Threshold Blueprint to send a message to my phone with the device name that has a low battery?

You won’t need to modify the the blueprint, you can use the actions section to create a custom notification. Something like this (but fix the indents, the forums have removed them)

alias: Battery Notes - Battery Threshold
description: “”
use_blueprint:
path: andrew-codechimp/battery_notes_battery_threshold.yaml
input:
excluded_devices:
- null
on_low_actions:
- service: notify.andrew_phone
metadata: {}
data:
message: “{{ trigger.event.data.device_name}} is low”

The trigger.event data fields are documented here

I was using this:

alias: Battery Notes - Battery Threshold
description: ""
use_blueprint:
  path: andrew-codechimp/battery_notes_battery_threshold.yaml
  input:
    excluded_devices:
      - 1addd51fcb98a16c83cd43c53b7e09ac
      - db8a15efa71ecf634a8f88a39c4181d0
      - b5b311c2fddff02f5714a9c75f02bd64
    on_low_actions:
      - service: notify.mobile_app_michaels_iphone
        metadata: {}
        data:
          message: “{{ trigger.event.data.device_name}} is low”

But it results in this error message if I click run:

Error rendering data template: UndefinedError: 'trigger' is undefined

I’m unclear what is needed to define the trigger.

The “Run” action essentially bypasses the trigger, hence the error. In essence, it runs the “Actions” but in this case the action needs the trigger information to function correctly.

In order to test, you should pick a battery entity in Developer Tools and set the state lower than your trigger threshold. Or simply wait for an entity to get below the threshold.

2 Likes

Has anyone managed to add the battery_type (and quantity) to the results? I’m using Battery Notes integration which also reports the type and quantity of the battery used in de sensor/device and would like to add this information :slight_smile:

1 Like

you’re a life saver!

Do you know if there is a way to get all of the batteries into some kind of dashboard that I look at to see the charge status of all of my batteries?

I discovered that I can go into settings->Devices and then filter to see Hue Motion Sensors and their batter status, but I’d prefer quick access from a Dashboard.

Also, alerts would be nice. I haven’t worked with alerts in HA , so I’m started from the ground floor there.

If you just want a dashboard to show you all of your batteries that are at X% or lower then you should look into the auto-entities card.

I have a dashboard configured to show me all of the batteries and then on my primary dashboard one that only shows batteries that are <= 40% or unavailable (in case a battery device dropped below 40% rapidly and then disappeared)

1 Like

I’ll try the card you linked out. I was hoping to make a card using the battery notes integration that I installed yesterday. But I don’t have any experience with making cards, yet. I’ll learn it eventually, but I have a lot of other tasks in front of it atm.

Thank you for the advice!