Which card(s) are you using? If they are custom cards, please provide a link to their repos… many custom cards and integrations have similar names, so it’s best to be specific.
Most cards do not support templating. You may need to create a Template sensor that extracts the attribute value, then use that sensor in your card.
Also, please follow Community Questions Guidelines by posting your properly-formatted, current card configuration so we can see what you are trying to do.
When you ask a bullshit engine a question, don’t be surprised when you get a bunch of bullshit.
state_attr() is an HA template function… I don’t see anything in the card’s repo that say they support it. All of their attribute examples use the state object method pattern…
states['ENTITY_ID'].attributes.ATTRIBUTE_ID
… so that’s the way the developer of that custom card programmed it to work and that’s what you have to use in that card.
OK Thanks, guess I never found the card’s repo examples. This inconsistency between bits of HA continues to annoy me (and the ChatGPT explanation was purest mush).
You are using a custom card. Complain to the developer of that card. It has nothing to do with the home assistant developers. The custom card developer is free to make their own system as they see fit.
So stop wasting your time with it and read the documentation instead.