Low battery level detection & notification for all battery sensors

Works as designed now :grinning: :+1: Thank you for your support and the improvements!

Does anyone know how I can do this with Homematic ip devices? For the devices, I either specified volts or Low Battery did not specify any percentage. The best thing would be a card in which I can integrate several devices and which pops up when the battery has reached a certain level or simply when the battery is low.

Hi @Bimbo009, what does not work for you with Homematic IP devices? The blueprint detects both battery devices with a threshold below the specifyed percentage and battery devices with low bat turned on.

If you like a card instead you should take a look at Battery State Card

My biggest problem with the whole thing is that I also want to display it in a battery map and Iā€™m somehow stuck on the line. With Homematic devices it is so that 100% - 3 volts and 2.2 volts are already low bat and the devices say goodbye. So I would have to try that either to calculate in % or try as a bar chart with colors where I can see at first glance good or bad and under certain circumstances when a certain critical value is reached that it starts flashing somehow.

Hello,
This blueprint worked fine until July 2022 (last time the automation was triggered), but yesterday, I noticed one of my temperature sensor had no more battery, but I did not receive any notification. This sensor does report its battery level (it has a entity of device_class:battery).
When looking at the automation traces, it says: "Stopped because of unknown reason "null" at (...)"
I have not updated the blueprint since I first downloaded it - Has it been updated ? Has any HA update since July 2022 broken the blueprint ?
Thanks for your help!

As I do not know which Blueprint you are using there is not much I can say. But you can check by yourself if there was an update. Just visit the Github Gist you downloaded the Blueprint and look at the revisions.

I get an empty notification if no batteries are below the threshold (or just the text I use in the message data before the {{sensors}} template).

This is the case with the original blueprint as well as the improvements made recently.

If no batteries are below the threshold the action should not be carried out at all.

Update: Sorry, just realised that the conditions arenā€™t checked when manually running the automation. My bad.

Ok, the latest version of the blueprint fixes the issue. I made a new automation and it works again.
Too bad there isnā€™t a mechanism to notify if a new blueprint version is available ā€¦ :frowning:

@itn3rd77
Maybe as a small improvement can you add date at top of the code showing when the code was last updated?

Then its easier to compare if the used revision is up to date.

Added the used revision and creation date in the description for easy lookup.

2 Likes

Thanks for the great blueprint, this works perfectly! I was wondering if there is a way to run the check multiple times a day?

newbie hereā€¦doing something wrong. Just imported your blueprint. Made UI adjustments - saved/renamed the blueprint - but it does not show in my automations. Refreshed, and restarted HA, still not showing.

Your help pls - what am I doing wrong?

In order to be notified when you update the code i have subscribed to your repository. Is my guess right that i receive an email once you save a new revision of the code?

I gave the repository also a star :star:

@smartmatic I guess a subscription should work.

There is no easy way to handle that via Blueprint. The simplest solution is to create multiple automations with this Blueprint.

@itn3rd77
first of all thank you for this cool blueprint

it works fine, but if i remove the ā€œareaā€ variable from the automation it does not work anymore

in the LOGĀ“s i get this errorā€¦

can you help how to get it to work without the area variable?

Logger: homeassistant.components.telegram_bot
Source: components/telegram_bot/__init__.py:635
Integration: Telegram bot (documentation, issues)
First occurred: 14:13:14 (4 occurrences)
Last logged: 14:18:51

Error sending message: Can't parse entities: can't find end of the entity starting at byte offset 20. Args: (1051552721, 'Batterie LOW\nā¦æ Bad_OG Battery Level (50%)\nā¦æ Datacenter Battery Level (86%)\nā¦æ Office Battery Level (47%)\nā¦æ Schlafzimmer Battery Level (74%)\nā¦æ Werkstatt Battery Level (59%)\nā¦æ Wohnzimmer Battery Level (47%)'), kwargs: {'parse_mode': 'Markdown', 'disable_web_page_preview': None, 'disable_notification': False, 'reply_to_message_id': None, 'reply_markup': None, 'timeout': None}
Error sending message: Can't parse entities: can't find end of the entity starting at byte offset 20. Args: (1051552721, 'Batterie LOW\nā¦æ Bad_OG Battery Level 50\nā¦æ Datacenter Battery Level 86\nā¦æ Office Battery Level 47\nā¦æ Schlafzimmer Battery Level 74\nā¦æ Werkstatt Battery Level 59\nā¦æ Wohnzimmer Battery Level 47'), kwargs: {'parse_mode': 'Markdown', 'disable_web_page_preview': None, 'disable_notification': False, 'reply_to_message_id': None, 'reply_markup': None, 'timeout': None}
Error sending message: Can't parse entities: can't find end of the entity starting at byte offset 20. Args: (1051552721, 'Batterie LOW\nā¦æ Bad_OG Battery Level (50%) Unknown\nā¦æ Datacenter Battery Level (86%) Unknown\nā¦æ Office Battery Level (47%) Unknown\nā¦æ Schlafzimmer Battery Level (74%) Unknown\nā¦æ Werkstatt Battery Level (59%) Unknown\nā¦æ Wohnzimmer Battery Level (47%) Unknown'), kwargs: {'parse_mode': 'Markdown', 'disable_web_page_preview': None, 'disable_notification': False, 'reply_to_message_id': None, 'reply_markup': None, 'timeout': None}
Error sending message: Can't parse entities: can't find end of the entity starting at byte offset 86. Args: (1051552721, 'Batterie LOW\nā¦æ Office Battery Level (47%)\nā¦æ Wohnzimmer Battery Level (47%)\nā¦æ Bad_OG Battery Level (50%)\nā¦æ Werkstatt Battery Level (59%)\nā¦æ Schlafzimmer Battery Level (73%)\nā¦æ Datacenter Battery Level (86%)'), kwargs: {'parse_mode': 'Markdown', 'disable_web_page_preview': None, 'disable_notification': False, 'reply_to_message_id': None, 'reply_markup': None, 'timeout': None}

Please have a look in the logfile an search for anything Blueprint related. Hard to say anything without more Input.

@itn3rd77

i found it, it was my fault:

to trigger the listing of the entities i put the threshold slider to 90% and it stopped working
if i put the threshold slider back to 50% it works again

so the [% area %] was not the problem

if i set the threshold to 20% and i have no battery entities that are below 20% battery state i get this error in the LOG file

Logger: homeassistant.components.automation.low_battery_detection
Source: components/automation/__init__.py:255
Integration: Automatisierung (documentation, issues)
First occurred: 14:44:39 (2 occurrences)
Last logged: 14:46:49

Error while executing automation automation.low_battery_detection: required key not provided @ data['message']
Low battery detection: Error executing script. Invalid data for call_service at pos 1: required key not provided @ data['message']

is this meant to be an error in the logs?

@Horst-Zimmermann
Mmmmh can not reproduce this with an Action ā€œSend persistant notificationā€ (notify.persistent_notification). Can you test if this error also happens to you when using Action ā€œSend persistant notificationā€? If not than this is probably related to the message formatting with Telegram. Btw. what version of Home Assistant are you using?

I am not at home anymore todayā€¦
I will test tomorrow and report here back.

Homeassistant latest updated today