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%â
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
New Feature
- 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 button in the top post
If you like my blueprints, and would like to show your support or just say thank you? Click Here
Enjoy
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 ?
Firstly welcome to the community
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
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
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 == '' }}
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.
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 == '' }}
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.
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
Back to FAQ: Click Here
Please update without delay ASAP
Bugs Fixes
- 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 button in the top post
If you like my blueprints, and would like to show your support or just say thank you? Click Here
Enjoy
Blacky
@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
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
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.
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
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
-
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 button in the top post
If you like my blueprints, and would like to show your support or just say thank you? Click Here
Enjoy
Blacky
@Blacky it seems the import of this blueprint isnt working anymore?
the link: https://gist.github.com/Blackshome/4010fb83bb8c19b5fa1425526c6ff0e2
gives a 404: