🪫 Low Battery Notifications & Actions

Hello Blacky,
Is there a way to also get a notification when a non-battery based device goes offline (ex: switch, plug, …) ?
I noticed some plugs where offline but never got a message as only battery based devices are currently alarmed.
Thanks for your suggestion !

@neoraptor123

If you just got a few entities that you like to keep track of then have a look at my :round_pushpin: State Notifications & Actions blueprint. You can add all the entities you would like to keep track of in one automation. The FAQ in that blueprint shows you how to include the entity name that triggered the automation in the message so you will know what entity is offline.

Blacky :grinning:

1 Like

Hi Blacky, couple of questions for you.

First off, one of my sensors was low battery and I received the notification properly for it. I changed the batteries in it, but I’m still getting the notification once a day when the script fires off that the battery is low. HA is reading the device at 100% battery. I’m not sure what to do to remedy?

Second, I’ve gotten a warning from the Spook add-on of an unknown reference in the script. Can you confirm whether that’s safe to ignore or if there’s something I should tend to?

Thank you!

@Hooterman

If you have battery is low then this is a different entity then the battery reporting %. Look for an entity that has the name battery the is low comes from the blueprint.

For the second one I going to do a FAQ now on it as it gets asked all the time. See below this post.

Blacky :grinning:

FAQ - Why Does Spook Give A Warning For To-Do?

In this blueprint, you have the option to add your low-battery report to a To-Do list using the Easy Notify – Device Action Buttons.

The To-Do integration is provided and maintained by Home Assistant, but it is not installed by default. If you want to use it, you’ll need to add it manually.

You can find the integration here: Home Assistant – To-Do Integration

If you haven’t installed the integration yet, Spook may detect that this blueprint references the todo integration but can’t find it, and will show a warning.

You have two options:

  1. Click Ignore on the warning if you don’t plan to use the To-Do integration.
  2. Install the To-Do integration in your Home Assistant instance.

This is completely safe, the integration is official and maintained by Home Assistant.

Enjoy

Blacky :grinning:

Back to FAQ: Click Here

2 Likes

Ah! There was a ā€œReplace battery soonā€ entity for that device that was stuck on ā€œLowā€ after the battery change. I re-interviewed the device and it kicked it back to Normal.

Thank you!!

2 Likes

I got this working now thanks. But, I had to create another custom group to exclude binary_sensor.*_battery_plus_low sensors, as there is no global option.

Just wondering, any plans to add an option to set custom ā€˜Messages’ instead of the 3 presets for notifications?

@iona

Nice one glad you got it sorted.

You can custom your own message in Custom Actions. You will see the sensor names available to use and also see the new update for Battery Sensors - Report Fields in the Battery Settings section.

In Custom Actions you will also find a link to get you started.

Blacky :grinning:

1 Like

Feature Request @Blacky

As a user I would like to exclude batteries, which are already on maintenance todo list. I am running that BP once per day, but sometimes I am away from home for a couple of days or I cannot replace the battery immediately due to other circumstances. So I would like to be not notified again the upcoming days.
Once maintained aka ticked on that list I would like to include them again.

Dunno if this is possible. Maybe by adding and removing a label to these entities to reflect that? :slightly_smiling_face:

@chris400

You may be able to make a condition that looks at your ToDo list and if the Easy Notify Action Buttons - Task Title is in the ToDo list then it fails.

Blacky :grinning:

1 Like

i saw that in my logs i got the following error:

Template variable warning: 'sensors' is undefined when rendering 'Folgenden GerƤte haben weniger als 10% Batterie:{{' '}}• {{sensors|replace(', ', ' • ')}}'

In general all is working as excepcted but there is a problem with the template any idea?

Automation Config
alias: Low Battery Notification
description: ""
use_blueprint:
  path: Blackshome/low-battery-notifications-and-actions.yaml
  input:
    time: "10:00:00"
    weekday_options:
      - mon
    battery_level: 10
    include_easy_notify: enable_easy_notify
    notify_device: []
    custom_actions:
      - if:
          - condition: template
            value_template: "{{ sensors == '' }}"
        then: []
        else:
          - metadata: {}
            data:
              title: 🪫Batterie unter 10% ⤵
              message: |-
                Folgenden GerƤte haben weniger als 10% Batterie:{{'
                '}}• {{sensors|replace(', ', '
                • ')}}
            action: notify.smtp_gmail
          - metadata: {}
            data:
              title: 🪫Batterie unter 10% ⤵
              data:
                notification_id: batterylow
              message: |-
                Folgenden GerƤte haben weniger als 10% Batterie:{{'
                '}}• {{sensors|replace(', ', '
                • ')}}
            action: notify.persistent_notification
    include_time: time_enabled
    include_custom_actions: enable_custom_actions
    notify_title: 🪫Batterie unter 10% ⤵
    notify_message: sensors

I may have missed it, or be searching for the wrong thing, but is there a way to avoid having two notifications for each entity? One from ā€œbatteryā€ and one from ā€œbattery+ā€?
Thanks!

I believe there may still a notify bug in Core. There was one dealing with notifying more than once. Check the issues…

1 Like

It is probably because you have none. You using ā€œ{{ sensors == ā€˜ā€™ }}ā€. Try it like this as shown in the FAQ point 7

    custom_actions:
      - if:
          - condition: template
            value_template: "{{ not sensors == '' }}"
        then:
          - metadata: {}
            data:
              title: 🪫Batterie unter 10% ⤵
              message: |-
                Folgenden GerƤte haben weniger als 10% Batterie:{{'
                '}}• {{sensors|replace(', ', '
                • ')}}
            action: notify.smtp_gmail
          - metadata: {}
            data:
              title: 🪫Batterie unter 10% ⤵
              data:
                notification_id: batterylow
              message: |-
                Folgenden GerƤte haben weniger als 10% Batterie:{{'
                '}}• {{sensors|replace(', ', '
                • ')}}
            action: notify.persistent_notification

Blacky :grinning:

1 Like

@nate8088

Do you mean that the entity is shown twice. If so you have to hide the battery as document in battery notes and then in Battery Settings use the Exclude Hidden Battery Sensors (Optional).

Blacky :grinning:

i tried this but the warning is still comming up

Hello.

I am seeing the same issue in my log as well with two variant options. The messages and email are correct and well formatted in my case. So mainly wanted to report if helpful.

Version 3.3
HAOS 2025.12.4

Logger: homeassistant.helpers.template
Source: helpers/template/__init__.py:1750
First occurred: 6:05:00 AM (2 occurrences)
Last logged: 10:55:40 AM

Template variable warning: 'all_sensors' is undefined when rendering '{{all_sensors|replace('@ ', '(')|replace('is ', '(')|replace(', ', ')\n')}}'
Template variable warning: 'all_sensors' is undefined when rendering '{{all_sensors}}'

Configuration detail.

alias: Low Battery Notifications & Actions Weekly
description: Weekly battery level check
use_blueprint:
  path: Blackshome/low-battery-notifications-and-actions.yaml
  input:
    include_time: time_enabled
    time: "06:05:00"
    weekday_options:
      - sat
    include_button: enable_button_trigger
    button_entity: input_button.low_battery_check
    include_custom_actions: enable_custom_actions
    custom_actions:
      - action: notify.xxxxx_smtp
        metadata: {}
        data:
          title: 🪫 Battery Status Notification
          message: >-
            {{all_sensors|replace('@ ', '(')|replace('is ', '(')|replace(', ',
            ')\n')}}
    battery_level: 99
    include_persistent_notification: enable_persistent_okay_notification
    notify_title: Battery Status Notification
    battery_sensor_report_fields:
      - friendly_name
      - area

@MikeO3 @Mar1us

I think it could be the new HA with templates in the custom action… not 100% sure though.

Blacky :grinning:

Would it be possible to add Blink cameras ? They are not found by the blueprint. The entity looks like this

Any feedback ?