šŸŖ« Low Battery Notifications & Actions

Iā€™m so appreciative of your work and generosity, is there somewhere I can make a small donation to you?

@Gurulee

Yes I do have a link, Click Here :smiling_face_with_three_hearts:

Thanks for your support!

Blacky :smiley:

Just imported and set-up. Havenā€™t had a chance to run it yet; however, Spook is throwing an error.

@troyboy27

Yes Spook will do this and we are aware of it.

What Spook is doing is looking for the TODO integration. The TODO integration is a Home Assistant integration supported and designed by HA.

In the blueprint when it sends a notification you can have an option to add your low batteries to a TODO task this way you can follow up replacing the batteries and crossing it off your TODO task.

To remove this warning from Spook all you need to do is install the integration or you can just ignore the warning.

To add the TODO integration go to Settings > Device & Services > click add integration and search for Local To-Do and follow the steps.

Blacky :smiley:

New Update 2.6

Stay Charged, Stay Smart! Customize it your way and letā€™s automate your battery maintenance! :battery::zap:

Maintenance :toolbox:

  • From time to time, Home Assistant updates their YAML standards and coding practices. To align with their roadmap, weā€™ve updated the code accordingly. We will continue to apply these updates across all our blueprints as they are revised.

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:

saw this discussion in a other topic aswell. This was fixed with a template.
https://community.home-assistant.io/t/advanced-heating-control/469873/1836

Thanks for the info.

Blacky :smiley:

The blueprint is wonderful and powerful; I am quite new to HA and this is the first blueprint that I can import. All is ok and the blueprint works (>Automation>RUN Automation>notification is ok). Then I created a Low Battery Button (as per the FAQ) and created a Button card including the entity Low Battery Button. When I click on it nothing happensā€¦ where am I wrongā€¦ :frowning:

Just checking, is it still not possible to use wildcards?

Hi, congratulations on the project, Iā€™m using custom actions to receive notifications on Telegram, it only reports sensors with battery below the threshold but not unavailable sensors. on UI Notification are reported regularly. this yaml custom actions

if:
  - condition: template
    value_template: "{{ not all_sensors == '' }}"
then:
  - action: notify.telegram
    metadata: {}
    data:
      title: šŸŖ«Batterie Scariche
      message: |-
        ā€¢ {{all_sensors|replace(', ', '
        ā€¢ ')}}
else:
  - action: notify.telegram
    metadata: {}
    data:
      message: Tutte le Batterie sono OK
enabled: true

@asalvatico

Welcome to the community and thanks for your kind words.

I cant see what you have selected but maybe you need to select the option to use it :thinking:

If this is not it then could you please provide us your YAML of the automation? This YAML code are the settings you have selected in the automation so I can help. To do this go into your automation, top right 3 dots, Edit in YAML, copy all the code, come back to the forum and in your reply at the top tool bar click on ā€œ</>ā€ and paste code in there.

Blacky :smiley:

No still not possible.

Blacky :smiley:

@tux

Thanks for kind wordsā€¦ try the code below.

if:
  - condition: template
    value_template: "{{ all_sensors == '' }}"
then:
  - action: notify.telegram
    metadata: {}
    data:
      message: Tutte le Batterie sono OK
else:
  - action: notify.telegram
    metadata: {}
    data:
      title: šŸŖ«Batterie Scariche
      message: |-
        ā€¢ {{all_sensors|replace(', ', '
        ā€¢ ')}}

Blacky :smiley:

@Blacky
thanks for your quick response.
I had already tried without the not, tried again with the code you sent but nothing. even the sensors with battery below the set threshold do not arrive. if I send to Google ad it works regularly. Even with simple:

action: notify.telegram
data:
  message: ...Battery "{{all_sensors}}".

or

action: notify.telegram
data:
  title: Low Battery Notification
  message: "{{all_sensors}}"

I only receive a messageā€¦ Battery without the names of the sensors.
I believe that ā€œ{{all_sensors}}ā€ is not valued in the telegram in other automations I receive values ā€‹ā€‹of a single sensor in the telegram with

  message: >-
    Alert Temperatura Acqua {{
    states.sensor.sonoff_acquario_ds18b20_temperature.state }} CĀ°

@tux

Maybe try it without the bullet point.

if:
  - condition: template
    value_template: "{{ all_sensors == '' }}"
then:
  - action: notify.telegram
    metadata: {}
    data:
      message: Tutte le Batterie sono OK
else:
  - action: notify.telegram
    metadata: {}
    data:
      title: šŸŖ«Batterie Scariche
      message: |-
        {{all_sensors|replace(', ', '
        ')}}

or the emoji

if:
  - condition: template
    value_template: "{{ all_sensors == '' }}"
then:
  - action: notify.telegram
    metadata: {}
    data:
      message: Tutte le Batterie sono OK
else:
  - action: notify.telegram
    metadata: {}
    data:
      title: Batterie Scariche
      message: |-
        ā€¢ {{all_sensors|replace(', ', '
        ā€¢ ')}}

or both

if:
  - condition: template
    value_template: "{{ all_sensors == '' }}"
then:
  - action: notify.telegram
    metadata: {}
    data:
      message: Tutte le Batterie sono OK
else:
  - action: notify.telegram
    metadata: {}
    data:
      title: Batterie Scariche
      message: |-
        {{all_sensors|replace(', ', '
        ')}}

or this one :crossed_fingers:

"{{all_sensors|replace("_"," ")}}"

Let us know if any work as I donā€™t have telegram and once we work it out I will put it into the FAQ.

Blacky :smiley:

:smiley:ok by modifying code you sent I was able to make it work with code

if:
  - condition: template
    value_template: "{{ all_sensors == '' }}"
then:
  - action: notify.telegram
    metadata: {}
    data:
      message: Tutte le Batterie sono OK
else:
  - action: notify.telegram
    metadata: {}
    data:
      title: šŸŖ«Batterie Scariche
      message: |
        ā€¢"{{all_sensors|replace("_"," 
        ā€¢ ")}}"

but I canā€™t fix the lines these are sensors in the Notification UI
Schermata del 2024-12-01 15-14-14

this is what I see on telegram
Schermata del 2024-12-01 15-14-49

@tux

We are getting there. Could you try this as it not really listing them correctly.

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

If you go into a sensor you will find your friendly names have all the ā€œ_ā€. If you look at this post you can edit the names that suits you better and you just may find that it works better. Try one that is in the notification and see if it works better.

Blacky :smiley:

@Blacky
by entering this

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

mi da errore "template value should be a string for dictionary value @ data[0][ā€˜dataā€™] " quindi modificato come segue

  message: >
    "{{ all_sensors|replace("_", " ")|replace(",", "n") }}"

this is how I get it now
Schermata del 2024-12-02 14-21-41

I also changed the names of the sensors by shortening them even if they didnā€™t have ā€œā€

@tux

Try this.

message: >
    {{ all_sensors|replace("_", " ")|replace(",", "\n") }}

And also this

      message: |
        ā€¢ {{all_sensors|replace("_"," ")|replace(",", "
        ā€¢ ")}}

@Blacky

:smiley: ok here we go but with this code

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

the " " beginning and end of the instruction are necessarily required otherwise they will cause an error
this is the result
Schermata del 2024-12-02 15-40-40

while this works better and without touching anything

message: |
        ā€¢ {{all_sensors|replace("_"," ")|replace(",", "
        ā€¢ ")}}

this is the result
Schermata del 2024-12-02 15-54-39

now it works correctly with telegram
here is the complete code

if:
  - condition: template
    value_template: "{{ all_sensors == '' }}"
then:
  - action: notify.telegram
    metadata: {}
    data:
      message: šŸ”‹Tutte le Batterie sono OK
else:
  - action: notify.telegram
    metadata: {}
    data:
      title: šŸŖ«Batterie Scariche
      message: |
        ā€¢ {{all_sensors|replace("_"," ")|replace(",", "
        ā€¢ ")}}

action notify.telegram it must be replaced with the name of your Telegram notification
It would be interesting to insert directly into to-do from Instagram with Telegramā€™s callback function. Iā€™ll do some tests for this.
Thank you for the work you do and for your help