đŸȘ« Low Battery Notifications & Actions

looking at your code, it might be easier to split the labels up into sections then build the output from those, instead of duplicating the lists for each option?

You have to link them together so they don’t get scrambled and I would like to keep it as “Easy Notify”.

sorry, i mean the list create a dictionary that you can call to assemble your outputs, then it is only created once.

i’ll have a play with your code tomorrow, see of i can simply it, and show you what I mean.

This is cool, but why time of day, and not just “when battery is less than 10%”

@Cactus_J

Hi Jeremy, glade you like it.

If we use “when battery is less than 10%”, I don’t think everyone would like messages when sleeping, yes you can put in a condition but
 A lot of the time these batteries are not critical and to just get a report once a week is nice
 you can also check every day if you like, but once a week works for me. Some batteries can also fluctuate so I don’t want 10 notify messages a day.

Blacky :smiley:

2 Likes

New Update 1.4

New Feature :new:

  • Battery Sensors - Custom Group - You can select a custom group of battery sensors to use for your notification. This allows you to create a list of battery sensors that you would like to be notified of when the battery levels are below your warning level or if they are unavailable.

If you like this blueprint? Consider hitting the :heart: button in the top post :+1:

If you like my blueprints, and would like to show your support or just say thank you? Click Here :smiling_face_with_three_hearts:

Enjoy

Blacky :grinning:

2 Likes

@Blacky

Hello,
Thank you very much for this great blueprint.
I have some actors that do not report percentages but give a “false” when the battery level is low.
Are these actors also included in this blueprint?

Thank you in advance.

Hello Blacky,
Thanks for this great blueprint.
I’m trying to get the custom actions only if the battery level is low, but I can’t see how to do this. Whenever the automation is running, the custom action also runs.
Did i miss something ?

@andrebnc

Firstly welcome to the community :wave:

Your welcome.

Normally when the battery goes low the state is ON. Yes this is included but I have just found a bug that would not allow the automation to run when your battery was low. It has been fixed and updated now. Please update the blueprint to version 1.5 and let us know if this has resolved the problem.

Blacky :smiley:

1 Like

@Murada99

There was a bug in the blueprint, please update it and if you like you can now use the easy notify. I will do a FAQ on how to use the custom actions.

Blacky :smiley:

1 Like

FAQ - How do I use the sensors in custom actions

Below are some examples on how to use the custom actions to send a message. To do this add action / call service / start typing “Notifications” in the service text box and select your mobile device. Add a title and in the message copy one of the sensors an paste it in. Then keep editing.

1 - Use of sensors names in a message.

You just replace the sensor name to the one you would like to use.

service: notify.mobile_app_blacky_iphone
data:
  title: Low Battery Notification
  message: "{{sensors_names}} all have a low battery level and it is time to replace them"

2 - This will report the sensors one after the other

You just replace the sensor name to the one you would like to use.

service: notify.mobile_app_blacky_iphone
data:
  title: Low Battery Notification
  message: "{{all_sensors}}"

They will be like this in your message;

sensor 1, sensor 2, sensor 3, etc

3 - This will use a new line per sensor

You just replace the sensor name to the one you would like to use.

service: notify.mobile_app_blacky_iphone
data:
  title: Low Battery Notification
  message: "{{all_sensors|replace(', ', '\n')}}"

They will be like this in your message;

sensor 1
sensor 2
sensor 3
etc

4 - This will use a new line per sensor using two sensors

You just replace the sensor name to the one you would like to use.

  message: "{{all_sensors|replace(', ', '\n')}}{{'\n'}}{{all_sensors_custom_group|replace(', ', '\n')}}"

They will be like this in your message;

all_sensor 1
all_sensor 2
all_sensor 3
etc
all_sensors_custom_group 1
all_sensors_custom_group 2
etc

5 - These are conditions for checking if there are any sensors to report

You just replace the sensor name to the one you would like to use.

This one will check if there are any sensors and if none then it will be true.

{{ all_sensors == '' }}

This one will check if there are any sensors and if there are some to report then it will be true.

{{ not all_sensors == '' }}

6 - This is an “if / then + else” action

This example is if you would like to receive a okay confirmation message if there are no batteries to report and if there are batteries to report it will list them.

You just replace the sensor name to the one you would like to use.

First we select a ‘If-then’ action. Click ‘+ ADD ACTION’, then start typing ‘If-then’ and the action will pop up
 select it.

Then add the condition by adding in a template condition to check if there are any sensors to notify. Click ‘+ ADD CONDITION’, then type ‘template’ and select it. Then add the code below.

Note: See example 5 above for condition explanation.

{{ all_sensors == '' }}

2

If the condition was true (no sensors to report) then we send this okay confirmation message. In ‘Then’, Click on ‘+ ADD ACTION’, then type ‘notification’ and select the notification you would like.

If the condition was false (sensors to report) then we send this message with all the sensors that have low battery level. Click on ‘Add else’ then ‘+ ADD ACTION’, then type ‘notification’ and select the notification you would like.

4

7 - This is an “if / then” action

This example is if you would like to receive a message only when there are low battery sensors to report.

You just replace the sensor name to the one you would like to use.

First we select a ‘If-then’ action. Click ‘+ ADD ACTION’, then start typing ‘If-then’ and the action will pop up
 select it.

Then add the condition by adding in a template condition to check if there are any sensors to notify. Click ‘+ ADD CONDITION’, then type ‘template’ and select it. Then add the code below.

Note: See example 5 above for condition explanation.

{{ not all_sensors == '' }}

6

If the condition was true (sensors to report) then we send this message with all the sensors. In ‘Then’, Click on ‘+ ADD ACTION’, then type ‘notification’ and select the notification you would like.

NOTE: If there was no sensor to report then we wouldn’t get a message.

5

8 - If you would like to have a bullet point or any other symbol before each sensor

You just replace the sensor name to the one you would like to use.

  message: |-
    ‱ {{all_sensors|replace(', ', '
    ‱ ')}}

or

  message: "‱ {{all_sensors|replace(', ', '\n‱ ')}}"

9 - If you would like to have a bracket around the battery %, Low reading and unavailable

You just replace the sensor name to the one you would like to use.

You don’t have to use every “replace” as it just depending on what sensor you are using and how you construct your message, but it will give you some information / guide on what you can do.

  message: "{{all_sensors|replace('@ ', '(')|replace('is ', '(')|replace(', ', ')\\n')}})"

Enjoy

Blacky :grinning:

Back to FAQ: Click Here

3 Likes

New Update 1.5

:warning: Please update without delay ASAP :bangbang:

Bugs Fixes :bug:

  • Fixed bugs in binary sensors that report “Low”. If your sensor went “Low” the automation would not run and never send a notification. Recommend you update without delay.

If you like this blueprint? Consider hitting the :heart: button in the top post :+1:

If you like my blueprints, and would like to show your support or just say thank you? Click Here :smiling_face_with_three_hearts:

Enjoy

Blacky :grinning:

2 Likes

@Blacky
Great your FAQ on how to use the custom actions.
It works really well, I can now turn on my alert button in the dashboard.

Thanks

@Murada99

No problem.

Glad you got it to display your alert button in the dashboard.

Blacky :smiley:

FAQ - How to change the reported battery name in a message

In this example we will add the battery type to the name but you can change it to anything you like that helps you identify the battery entity to your liking.

Go into settings / devices & services / click on the entities tab at the top and search for your batteries. Click on the entity you would like to update and then the cog wheel

Change the name to your liking and click update.

When you receive a message the name will now be reflected as per your liking.

You can also adjust the sensor display precision. If your sensor % is reading 30.001% you can adjust the display precision so it will read 30% by select the drop-down menu in display precision.

Enjoy

Blacky :grinning:

Back to FAQ: Click Here

Thanks for the well thought-out blueprint.
One thing I would suggest is to round battery percent values. I have battery sensors outputting values like 11.9999%. It makes notification bubbles quite cluttered.

@psyko_chewbacca

Thanks for your kind words.

This is all done in HA. In your battery entity look for sensor display precision. For me I dont have any decimal places. Above your post shows you how to get to this area in HA.

Blacky :smiley:

New Update 1.6

:warning: When updating to version 1.6 - If you are using the “Battery Sensors - Custom Group” option then you will need to select and adjust the new input for “Custom Group - Battery Low Warning Level”.

New Feature :new:

  • Battery Sensors - Custom Group - The custom group has its own independent “Battery Low Warning Level” setting.

    Use case: You may have a few batteries that require a different low battery warning level. Some devices may require you to replace / charge your batteries at a higher battery % so it can operate correctly. Some devices can still operate at less than 5% battery. Before you would have to have 2 automations to achieve this. This can now be set up in the one automation using the "“Battery Sensors - Custom Group” with its own independent “Custom Group - Battery Low Warning Level” setting.

  • Easy Notify - Sensor Selection - Easy notify now allows you to select a new option if you would like to use “Use All Battery Sensors Minus Excluded Battery Sensors + Custom Group”

If you like this blueprint? Consider hitting the :heart: button in the top post :+1:

If you like my blueprints, and would like to show your support or just say thank you? Click Here :smiling_face_with_three_hearts:

Enjoy

Blacky :grinning:

1 Like

@Blacky it seems the import of this blueprint isnt working anymore?

the link: https://gist.github.com/Blackshome/4010fb83bb8c19b5fa1425526c6ff0e2
gives a 404:

image

2 Likes

The Blackshome’s gists · GitHub is complete empty.