Create a tile dedicated to the batteries of the sensors

My aim was to:

  • That the tile updates itself (e.g. when adding new sensors)
  • Ignore sensors that are not on battery or remain blocked at 100%
  • To have a rather understandable sensor name
  • Have colors so that weak or dead batteries are easily identified
  • Classify batteries in order of "fatigue"

tile code


Type: custom:auto-entities
card:
Type: entities
title: Control of batteries
state_color:
green: '#00FF00'
yellow: '#FFFF00'
red: '#FF0000'
filter:
include:
- entity_id: _battery
state: <100
Output:
Method: state

In the event of an error ‘Custom element doesn’t exist: auto-entities", think about installing auto-entities in HACS