Howto create battery alert without creating a template for every device

Post 650 has all of the Lovelace configs.

2 Likes

So for my understandig. If your not already having a history integration added you should add the one you posted or add it to it correct?

But I think in my situation I should also need to modify recorder settings because I tried to get rid of all logging available with below recorder config:

recorder:
  purge_keep_days: 5
  purge_interval: 1
  exclude:
    domains:
      - automation
      - binary_sensor
      - camera
      - calendar
      - cloud
      - device_tracker
      - group    
      - kodi
      - light
      - media_player
      - mqtt
      - notify
      - sensor
      - script
      - stream
      - sun
      - switch
      - timer
      - updater
      - weblink
      - yeelight
      - zone

And my last question. When using the build in Mosquitto broker HassIO addon and the automaticly added MQTT integration should you still need to make that MQTT config changes in your configuration.yaml? Discovery is already enabled, not sure about the prefix but not sure if i need it becasue iā€™m already seeing corret battery levels.

##  2. Enable MQTT Discovery by adding `discovery: true` and
##     `discovery_prefix: homeassistant` under the `mqtt:` section
##     of your configuration.yaml
##
##     mqtt:
##       discovery: true
##       discovery_prefix: homeassistant

Hey
To start a discussion about: battery_alert_disabled: trueā€¦

Everything work except excluding theese two sensors from alerting. Why?

My code (within the package):

homeassistant:
  customize:
    #To disable alerts for a specific entity
    sensor.saras_batteri:
      battery_alert_disabled: true
    sensor.hugos_batteri:
      battery_alert_disabled: true

I dont want alert from phonebatteriesā€¦ :neutral_face:

@NotoriousBDG

This might be answered alreadyā€¦ Please guide to the right solution :slight_smile:
Since the majority of entities comes with an additional battery level entity I wonā€™t to create a simple automation that tracks all the

sensor.xxxxxxxxx_battery_level

and triggers when one of them is below a given value.

Is there a simple way to track these? Have briefly looked through the posts but I canā€™t make an overview of the most correct way of doing this at the moment - could someone please help me? :slight_smile:

Is there a reason why text notifications are only sent at 10AM and 6PM or when the thresholds are adjusted? Any suggestions on triggers to send a notification as soon as a battery gets below the set threshold or am I missing something?

it setup in the automation called ā€œbattery_notification_defaultā€


- alias: battery_notification_default
  initial_state: 'on'
  trigger:
    - platform: time
      at: '10:00:00'
    - platform: time
      at: '18:00:00'
    - platform: state
      entity_id:
        - input_number.battery_alert_threshold_min
        - input_number.battery_alert_threshold_max
  action:

Fairly new to HA, but tracking battery status was a top item on my list so this was implemented pretty quickly in my setup. Pretty easy to setup and does a great job @NotoriousBDG! Thanks for all the work on this!

Last night I decided that I wanted to monitor the battery level on my boysā€™ ipads. So I install the IOS app on each of them. Unfortunately it appears that the current version of the app creates a handful of sensors for each device, see below.

The code to update group.battery_status now picks up sensor.battery_level and sensor.battery_state, see below.

For now, Iā€™ve decided just to disable these sensors by going Configuration > Integrations > Mobile App: {device name} iPad and toggling them disabled in there. Itā€™d be nice if these sensors could be ignored or skipped over. Especially since one of them doesnā€™t even report a percentage, as seen below*

*Yes, the battery levelā€™s donā€™t match perfectly for Calebā€™s ipad, thatā€™s next on my list of things to explore.

I have all my batteries showing 90+ low trigger set to 20 but i am getting notifications all the time. I thought it would notify me only when i got below the set level of 20. Also it checks the battery level constantly can i change that to only check once a day?

thanks great job on this!!

Set your min threshold to 0 and the max threshold to 20.

I donā€™t see the slider or any of the UI after installing this. I think itā€™s working as I see the extra sensors under the MQTT Integration.
Looking at the code I think this is because it is creating a group but as Iā€™m using Lovelace with yaml configuration this isnā€™t being displayed.
Any suggestions for what I should do?

Add the sensors to your lovelace UI.

Sorry, I wasnā€™t very clear, I donā€™t want to add the sensors to the UI. In my overview page I donā€™t get the battery icon at the top right as shown in the image at post 722 (see below).
I want to be able to adjust the Max/Min through the UI if possible. Is there some way to add this drop down battery card with lovelace so that Iā€™m able to change the slider values?

For anyone else with the same problem, Iā€™ve managed to get it working by adding the group-card add on through HACS and then adding this to my ui-lovelace.yaml as well as the resource entry for the group-card.

      - type: 'custom:group-card'
        card:
          type: entities
          title: Battery monitor
        group: group.battery_view

This then shows a Battery Alert which you can click on to display the settings.

This is driving me crazyā€¦
Iā€™m being flooded by alerts abgout low battery status for device named ā€œNone (unavailable)ā€. I donā€™t really know which device is it and I canā€™t find a way to remove it from the monitored devices!
I suspect this could be a smartphone which is not being available anymore, but Iā€™m not sure and I donā€™t know where can I check.
Any suggestions?

Funnily enough, Iā€™ve just started getting this too.

Iā€™ve got a custom card installed which automatically shows all the battery_status entities.

type: 'custom:group-card'
group: group.battery_status

And it just showed an unknown entity - clicking on it gave me option to remove the entity.

All fixed.

Nice tip, thank you :wink:

I havenā€™t really done any digging (yet) but did this stop working for anyone else, presumably post 0.106?

I am/was using the custom:group-card and I know there were some changes to custom cards in 106, so will start there.

EDIT: Yup, card related, fixes on github issues page:

https://github.com/custom-cards/group-card/issues/5

Breaking change in 0.107, changes to groups:

view, control:hidden etc no longer valid

UPDATE: https://github.com/notoriousbdg/Home-AssistantConfig/issues/25

Is this project abandoned?

itā€™s also not necessary. I just went into the file and removed those lines from the code and my battery alert works as expected