How to show a user-friendly message when entity is unavailable?

I have a panel which includes some entity cards, which rely on external services that are not always available. When the entity is unavailable, the entity card displays a message that is fairly long and so causes the panel layout to break. It also looks off-putting to other family members who I need to trust in HA :wink:

This is mostly a problem with entities that rely on external services, such as the current CO2 levels in local electricity supply, or weather forecast.

I guess I could create a helper/variable for each entity that traps and errors, and then display that, but that feels clunky and likely to cause problems further down the line. So, is there a way to configure an entity card so that it has a fallback state, possibly displaying a different icon or being greyed out?

Thanks for your help with this,

Phil

you can use conditional cards in horizontal-stack