thomasloven / lovelace-auto-entities

🔹Automatically populate the entities-list of lovelace cards
MIT License
1.18k stars 111 forks source link

Alter state: "unknown" to 0 #414

Open shanelord01 opened 5 months ago

shanelord01 commented 5 months ago

Hi,

I am using this great auto entities card to display battery gauges for my battery devices. Only issue is I have some that when they go flat or have an error report "unknown" instead of a numeric amount.

It would be great to be able to replace the "unknown" state with "0" on the fly so my gauge would show empty instead of an error.

I have tried using value templates but these don't seem to work in the auto-entities card.

"{% if is_state('unknown')%} 0 {% else %} val {% endif %}"

Not sure if this is something that can be do fixed by you or I just have to live with, but if you could help it would be appreciated.

Thanks, Shane.

ildar170975 commented 5 months ago

This is not a bug report or a FR. Suggest to ask similar questions in the dedicated HA community thread. https://community.home-assistant.io/t/auto-entities-automatically-fill-cards-with-entities/147801