lovelace-auto-entities icon indicating copy to clipboard operation
lovelace-auto-entities copied to clipboard

Alter state: "unknown" to 0

Open shanelord01 opened this issue 5 months ago • 1 comments

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.

shanelord01 avatar Jan 09 '24 07:01 shanelord01

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

ildar170975 avatar Jan 09 '24 19:01 ildar170975