Low battery level detection & notification for all battery sensors

I’m a little confused by what you are asking for, because when I make the change I posted for line 80, I see all the devices with a battery level below the threshold and their % levels:

Did you reload the Automations so that the blueprint changes take effect?

Sorry, I haven’t made the change in the automation, so if now is like you posted it’s really fantastic.

I will try as soon as I can

Thanks

You will need to make the change. I haven’t yet provided an option to show % values in the version on GitHub.

Hey Stefan, I´m currently facing the same issue with my homematic devices. Therefore i would like to try out your contribution. Unfortunately i´m not sure under which document /where to include your code snippet. A small tutorial or an additional screenshot would be much appreciated.
Thank you very much in advance!

Hi, thanks for your blueprint, useful to know which battery to change. But I only get empy notifications, {{names}} doesn’t seem to return anything. What am I doing wrong?

use_blueprint:
  path: josephquigley/jq-home-assistant-low-battery-blueprint-v1.yaml
  input:
    actions:
      - service: notify.persistent_notification
        data:
          title: Vérifier batterie
          message: '{{names}}'

Hi, this is an amazing blueprint. I just installed it and it works so easy!
Is it possible to extend this one blueprint to also include disconnected devices, even when they are not battery powered (or they are but the battery is not low)?
Or does anyone know of a similar automation/blueprint for disconnected devices?
Kind regards,
Patrick

1 Like

The blueprint states that:

I think this should solve your issue, use {{sensors}} instead of {{names}}.

Before making any changes, note that when manually running the automation, if no battery sensors are below the threshold then no names will be returned. So testing can be confusing if you don’t have any low batteries at the time of test. Manual running automations skips the conditions!

A quick way to check is to adjust the threshold to 100% before running the automation, which should result in all your battery sensors being returned with their levels. Once you are happy this is doing what it should be, turn the threshold down to what you want.

Hi, thanks for the useful blueprint.
However lately I began to receive notifications from an entity with a low battery, however I can’t find which one it is. I added {{sensors}} in the notification but nothing shows up. Is there a way to find out which entity that triggers the automation?

Thanks!

Recommend to add selectattr( “attributes.device_class”, “defined” ) in selection. Some sensors have no device class defined, and cause error

Hi all,

I’ve installed Tykeal’s blueprint, but I got a small problem, despite having new batteries, some zwave devices just keep coming back in the notification as having 5% or less battery left and some zigbee devices just don’t show up, am I missing something in the setup integration of the blueprint and setup of the automation?

Thanks

alias: Low battery level detection & notification for all battery sensors
description: ""
use_blueprint:
  path: tykeal/low-battery.yaml
  input:
    threshold: 5
    actions:
      - service: notify.xxxx_hassiobot
        data:
          title: Notification de(s) pile(s) à remplacer
          message: Les piles de "{{sensors}}" doivent être changés
    exclude:
      entity_id:
        - sensor.iphone_battery_level
        - sensor.ipad_de_al_battery_level
        - sensor.iphone_se_de_battery_level

I can’t really speak towards the devices that aren’t showing up, outside of checking to make sure that they do have a battery attribute.

As for devices that are above a specific threshold but still show up, if the device has a low battery attribute that is reporting that the battery needs to be replaced that could do it. I’ve got a zwave device that doesn’t always clear that bit when I change the batteries and I have to force it to re-interview to get it to clear.

Hi,

Thanks for that, the re-inteview seems to have done the trick, concerning the ones not showing up they do have a battery attribute, I’ll keep digging around to see if I find anything.

Thanks again

i have a lot of devices, (e.g. Sonoff Snzb, mobiles, etc. ) but don´t get any sensor displayed. The message arrives on my mobile, but besides the title all is empty. eben when i set threshold to 100% .

Any idea what i´m doing wrong?

This is what i get as error:
UndefinedError: ‘homeassistant.util.read_only_dict.ReadOnlyDict object’ has no attribute ‘device_class’

But the entity does have a correct device_class:

ok, im a few steps further:

Im getting a response on my mobile, with the title, but no sensors are listed.

The logfile shows that there are some sensors found with the condition. but they are not listed.

Step-Details:

Result:
params:
domain: notify
service: mobile_app_pixel_7_pro
service_data:
message: Batteriestatus
data:
message: |-
Batterie wechseln
⦿ Overview Batterie (0%) in area Buero
⦿ Hue Schalter Battery (22%) in area Wohnzimmer
target: {}
running_script: false

Trace-Timeline is also ok:
triggered manually at 20. August 2023 um 21:22:04
Aufruf eines Dienstes ‘Benachrichtigung: Send a notification via mobile_app_pixel_7_pro’ von
Finished at 20. August 2023 um 21:22:04 (runtime: 0.62 seconds)

OK, got it!

Always tried to call a service with the notify platform, but i had to send a notification to a device.

Did so, it works!

Is there a chance to send it to a group of devices? perhaps “grouping” my mobiles?

Yes, the platform for that is called “group”, you create a group with the devices through yaml file. Has nothing to do with this blueprint.

Why isnt such feature right built in?

1 Like

Because not everybody wants the same exact thing

1 Like

Thanks so much for this Blueprint.
Request: As I have over 100 battery driven devices not named after their location it would be very useful to have the possibility to additionally add the according device’s alias area to the battery low state notification.
Would that be possible?

1 Like