First attempt with a custom card returns "Required key 'entities.0.entity' is missing"

I am trying to make a custom card that shows just devices with low batteries. I have this script:

type: entities
title: Low Battery Devices
show_header_toggle: false
entities:
  - domain: sensor
    state_filter: null
  - attribute: battery_level
    below: 85

The editor returns:
Configuration errors detected:

  • Required key ‘entities.0.entity’ is missing.
  • Required key ‘entities.1.entity’ is missing.

What am I doing wrong ?

hi… how much experience do you have in home assistant? don’t want to insult you if you’re experienced… but at the same time, maybe you’re totally new?

reason i ask is that the code you posted isn’t close to working unless there’s some magic i don’t know about (which wouldn’t be the first time). so my answer to “what am i doing wrong” is pretty much “it’s all wrong”. but if there was something that led you to that, could you point me to it? either i’ll learn something from it and maybe can figure out what was intended, or there’s some doc or something that needs to get corrected…

to point you in the right direction…

  1. here’s how you post code here:
    How to format your code in forum posts

  2. auto-entities may be what you want:
    🔹 Auto-entities - Automatically fill cards with entities

Could your answer be any more arrogant / condescending ?
This is the first time I post a proper question on the forum and this is the answer I get. Congrats on turning me off the platform.

Where on earth did you get the impression I was experienced ? Clearly I’m not and I even said that in the subject of my message in effect.

was a genuine question to know what level to calibrate answers to. wasn’t intended to be insulting… and home assistant is so vast that sometimes someone posts something that looks wacky to me and it turns out legit.

tone is always hard to read on these forums… but you were quick quick to assume the worst interpretation.

regardless, my two points to get you going in the right direction i believe are still the most helpful two things i can give you… i think the auto-entities does exactly what you want…

A code from the 1st post LOOKS like made based on auto-entities card.
Suggest to go to auto-entities GitHub repo and read Docs with examples.
After you can try making your own code based on this card.
Then you can go to a dedicated huge auto-entities thread for consulting.

1 Like