Home Assistant Battery Warning Card Using Auto-entities

Nov 6, 2022 · 2 mins read
Home Assistant Battery Warning Card Using Auto-entities

In the video below, we show how to create a Home Assistant battery warning card using auto-entities to add to a dashboard


Auto-entities is a very useful plugin you can use in Home Assistant to only display entities that meet a certain criteria

So for example, you can create a card using auto-entities which will only display devices with low battery levels

Once you replace or re-charge those batteries, they disappear from the list automatically

This seems better than getting an instant notification because you may not have a spare battery at the time or be nearby to replace the battery immediately making you more likely to forget

Whereas with this card, a regular check of the dashboard serves as a constant reminder until the battery is replaced

Useful links:
https://github.com/thomasloven/lovelace-auto-entities

Steps Taken

  1. Install auto-entities using HACS
    This is an easier method and HACS will also tell you when new upgrades are available and install them

  2. Create a Dashboard
    The default dashboard is more for admin purposes, so create a new one that you can customise

  3. Update Lovelace
    The Lovelace GUI needs to know where to find the plugin
    To do that you need to be in advanced mode and then add the auto-entities URL as a resource
    /hacsfiles/lovelace-auto-entities/auto-entities.js

  4. Control Dashboard
    To edit and customise a new dashboard you have to take control of it
    This is a one off choice and you can choose to turn this into a blank dashboard, rather than contain everything the overview dashboard contains and then have to delete cards

  5. Battery Warning Example
    Add an auto-entities card to the dashboard
    After that configure it with the visual editor or the code editor
    In this example we paste in some example code Brian Coke provided in a forum which is great for only warning of devices that have a low battery level

    type: custom:auto-entities
    card:
    show_header_toggle: false
    title: Battery low
    type: entities
    filter:
    include:
    - attributes:
    device_class: battery
    state: <= 10
    exclude:
    - name: /[Ll]ow/
    - name: /[Ss]tate/
    sort:
    method: state
    numeric: true

Sharing is caring!