🪫 Low Battery Notifications & Actions

@IdiotTryingToFindWay

It is not broken you just need to know what to do.

  1. Why are you using a Custom Group? Looks like you are including all of your batteries. Custom group is if you have a few to check or you would like a different % to monitor.
  2. In your custom action you need to do it correctly and it will work. Look in the text were I got the ā€œā€ and you may have to define your response don’t push the run action to test. I don’t use AI but you could try something like this.
    custom_actions:
      - if:
          - condition: template
            value_template: "{{ not sensors_names_custom_group == '' }}"
        then:
          - action: media_player.volume_mute
            metadata: {}
            target:
              entity_id: media_player.arc_ultra
            data:
              is_volume_muted: true
          - action: conversation.process
            metadata: {}
            data:
              text: >-
                "You seem to have low batteries, here they are
                {{sensors_names_custom_group}}"
            response_variable: response1
          - variables:
              ai_message: >-
                {{ response1.data if response1 is defined else
                'Batteries require attention, sir.' }}
          - action: assist_satellite.announce
            metadata: {}
            target:
              entity_id: assist_satellite.voice_pe_assist_satellite
            data:
              message: "{{ ai_message.response.speech.plain.speech}}"
              preannounce: false
      - if:
          - condition: template
            value_template: "{{ sensors_names_custom_group == '' }}"
        then:
          - action: media_player.volume_mute
            metadata: {}
            target:
              entity_id: media_player.arc_ultra
            data:
              is_volume_muted: true
          - action: conversation.process
            metadata: {}
            data:
              text: Im not seeing any low batteries, your all good to go
            response_variable: response2
          - action: assist_satellite.announce
            metadata: {}
            target:
              entity_id: assist_satellite.voice_pe_assist_satellite
            data:
              message: "{{ response2.response.speech.plain.speech}}"
              preannounce: false

I don’t use AI so you will need to know what your doing in your custom action.

I don’t think this is correct but your call

message: "{{ ai_message.response.speech.plain.speech}}"

HA documentation click here

Blacky :grinning:

ā€œ{{ ai_message.response.speech.plain.speech}}ā€ was my fault in posting. i was messing with the code and forgot to post the updated. but i was using the correct response variable from the conversation process into the assist satellite action, should have checked that before posting.

i use custom group because i have a lot of zwave sensors and really theres only certain ones that need to be checked. that list isn’t all of my batteries, just the ones i want notified for. i currently have the automation working using standard tts. However i have spotted another problem.

If i send a tts and a phone notification, only the tts sends. if i disable custom actions, then the phone notification sends. it’s not sending both. Would it be better to just send the phone notification in the custom action as well?

alias: Low Batteries
description: ""
use_blueprint:
  path: Blackshome/low-battery-notifications-and-actions.yaml
  input:
    weekday_options:
      - wed
      - mon
      - fri
      - sun
    time: "09:49:00"
    include_time: time_enabled
    custom_group:
      entity_id:
        - sensor.front_door_battery_level
        - sensor.fold_7_battery_level
        - sensor.node_19_battery_level
        - sensor.foyer_smoke_battery_level
        - sensor.galaxy_watch_ultra_battery_level
        - sensor.guest_smoke_battery_level
        - sensor.guest_window_battery_level
        - sensor.zcombo_g_smoke_co_alarm_battery_level
        - sensor.keypad_v2_battery_level
        - sensor.kitchen_door_battery_level
        - sensor.kitchen_window_battery_level
        - sensor.laura_s_iphone_battery_level
        - sensor.left_master_battery_level
        - sensor.master_smoke_battery_level
        - sensor.right_master_battery_level_2
        - sensor.left_office_battery_level
        - sensor.middle_office_battery_level
        - sensor.office_smoke_battery_level
        - sensor.right_office_battery_level
        - sensor.barn_door_battery_level
        - sensor.left_window_battery_level
        - sensor.middle_window_battery_level
        - sensor.right_window_battery_level
        - sensor.open_close_xs_sensor_battery_level_5
        - sensor.ac_drain_battery
        - sensor.hue_motion_sensor_1_battery
        - sensor.hue_dimmer_switch_1_battery
        - sensor.guest_bathroom_sink_battery
        - sensor.guest_bathroom_toilet_battery
        - sensor.blind_tilt_5a0e_battery
        - sensor.curtain_3_52b1_battery
        - sensor.curtain_3_216e_battery
        - sensor.dishwasher_battery
        - sensor.kitchen_sink_battery
        - sensor.refrigerator_battery
        - sensor.washing_machine_battery
        - sensor.master_bath_sink_battery
        - sensor.master_bath_toilet_battery
        - sensor.blind_tilt_53c1_battery
        - sensor.blind_tilt_bda4_battery
        - sensor.hue_dimmer_switch_2_battery
        - sensor.master_bedroom_battery
        - sensor.office_battery
        - sensor.cutoff_valve_battery
        - sensor.drain_down_valve_battery
        - sensor.laura_s_iphone_watch_battery_level
    include_easy_notify: enable_easy_notify
    sensor_selection: enable_battery_sensors_custom_group
    notify_device:
      - 3227ffd8fc39183b377ab061201ddf5a
    notify_message: sensors
    notify_interruption_level: critical
    notify_data:
      - high_priority
    include_custom_actions: enable_custom_actions
    custom_actions:
      - if:
          - condition: template
            value_template: "{{ all_sensors == '' }}"
        then:
          - action: media_player.volume_mute
            metadata: {}
            target:
              entity_id: media_player.arc_ultra
            data:
              is_volume_muted: true
          - action: assist_satellite.announce
            metadata: {}
            data:
              message: I'm not detecting any low batteries. You're good to go human.
              preannounce: false
            target:
              entity_id:
                - assist_satellite.voice_pe_assist_satellite
          - wait_for_trigger:
              - trigger: state
                entity_id:
                  - assist_satellite.voice_pe_assist_satellite
                to:
                  - idle
          - action: media_player.volume_mute
            metadata: {}
            target:
              entity_id: media_player.arc_ultra
            data:
              is_volume_muted: false
        else:
          - action: media_player.volume_mute
            metadata: {}
            target:
              entity_id: media_player.arc_ultra
            data:
              is_volume_muted: true
          - action: assist_satellite.announce
            metadata: {}
            data:
              message: >-
                I've detected low batteries, i'll also send you a list of them
                as well to each device. Here they are,
                "{{sensors_custom_group}}"
              preannounce: false
            target:
              entity_id:
                - assist_satellite.voice_pe_assist_satellite
          - wait_for_trigger:
              - trigger: state
                entity_id:
                  - assist_satellite.voice_pe_assist_satellite
                to:
                  - idle
          - action: media_player.volume_mute
            metadata: {}
            target:
              entity_id: media_player.arc_ultra
            data:
              is_volume_muted: false
    battery_sensor_report_fields:
      - friendly_name
    notify_okay_message: You have NO low batteries! :)
    notify_title: 🪫Low Battery Notification🪫

@IdiotTryingToFindWay

The custom actions are the first thing that happens in the action. If there is something wrong with the custom action it will fail and the automation will stop so the rest of the actions (phone notification) will be stopped.

You shouldn’t have to and it easier to use the blueprint UI. I do have a idea were I will run the custom action in parallel with the rest of the actions. This should resolve your bug in your custom action.

New update out for this.

Blacky :grinning:

New Update 3.4

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

:toolbox: Maintenance

Custom actions now run in parallel to prevent the entire automation from failing if a custom action is misconfigured.


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

Missed your reply! Yeah, the notify groups have to be right now. configuration.yaml

notify:
  - name: notify-person1-phone
    platform: group
    services:
      - service: mobile_app_person1_pixel_10
  - name: notify-person2-phone
    platform: group
    services:
      - service: mobile_app_person2_pixel_9
  - name: notify-person1-watch
    platform: group
    services:
      - service: mobile_app_person1_pixel_watch_3

And then each of those names is available as a notification option in automations. So I have a crap-tonne of automations to send notifications using them. Get a new phone or watch, and I just have to change the device in configuration.yaml rather than each automation.

It would be way cooler if this was made available in the gui instead of having to do this, but for now it’s not

2 Likes

Yes, notify groups would be a nice option to have with this Blueprint (for updating new phones).

Hi Blacky,
your blueprint works well for most of my devices.
But I have some (homematic sensors, thermostats) that report unavailable for most of the time. While usually their last reported battery status is just a few hours ago.
Due to this my notification is filled with ā€œLOWBAT unavailableā€ for these sensors, although some hours ago they all reported being fine.
I don’t want to completely exclude them from notifications.
Would it be possible to report their latest status and only treat them as unavailable if it’s longer then 24 hours?

1 Like

Hi Blacky!
I just added a new device that doesn’t report batterylevel in percent but battery state as low/medium/high, could this be added to the blueprint?

Maybe just use a template to read that sensor, and create a sensor that puts out 100%, 50%, 20%…
Feed that into the blueprint…

first time user and think the idea is great, but I can’t get past setting a helper. I added a button helper and it didn’t show here so I tried creating a new one from the dropdown you have for button helper and none work.

I must be missing something obvious!

of course, my original button that I created and the one created using the dropdown in your form are now visible. sunspots are heavy today!

Do you have input_button enabled in your configuration.yaml?

Be sure to restart Home Assistant after you edit that file or the change won’t be loaded into memory.

1 Like

@KarstenG

I will put it on my list to look at.

Blacky :grinning:

@michael.miz.ziegler

If you battery reports low then it should show up in you notification when the happens.

Blacky :grinning:

@kevinleequinn

Glad you worked it out

Blacky :grinning:

1 Like

Hello,

This is a great blueprint! Thank you so much! It’s somewhat surprising there isn’t already a built-in solution for that, but you did great work!

I’ve noticed the Dashboard helper isn’t quite that useful because the only thing I can see on the Dashboard is, essentially, the date & time of the last run (especially on the smartphone app).

I’m not sure this is that Helpful. Especially since we easily have access to the history of the helper, and can therefore easily know when it was last updated.

Can I suggest:

  1. Adding a new blueprint input to remove the Date & Time from the input_helper (maybe for other forms of notifications as well? I’m not quite convinced about that yet…)
  2. Making the ā€œA-OKā€ message input multiple and cycle through the values when the report remains at ā€œA-OKā€ (this will trigger a value change and an entry in the history, if people want to track each run).

If you’d like, I can fork and try to implement these changes myself. But I don’t think we can submit PRs against a gist…

@mlemoine

Thanks!

Something must be wrong on your end. I can see all the batteries that are low and if all of them are okay I see the okay confirmation message. I also just tested it on the android app as I use iOS. Here is the FAQ on how to set it up, click here

Blacky :grinning:

@Blacky I meant the text_helper is set properly, I can see the whole report if I open it and go check its full value, but there is not enough ā€œscreen real estateā€ to read the text from the dashboard (which only display the first few characters).

So I can’t tell at a glance whether I have low batteries or not, because the dashboard always display the date and time only (essentially, maybe I have one or two characters left before the ellipsis, but that’s not really a visually distinctive UI).

Just found this amazing blueprint! Thanks for sharing.

One question, would it also be psoble to use groups for notification which are configured in configuration.yaml?

Spook is finding an error in this BP in the last few days:

This is on HA 2026.4.2

I can’t see how to fix this via the automation BP editor.

1 Like