Welcome to the Tweaking4All community forums!
When participating, please keep the Forum Rules in mind!
Topics for particular software or systems: Start your topic link with the name of the application or system.
For example “MacOS X – Your question“, or “MS Word – Your Tip or Trick“.
Please note that switching to another language when reading a post will not bring you to the same post, in Dutch, as there is no translation for that post!
[Solved] How to hide empty cards ...
(@hans)
Famed Member Admin
Joined: 12 years ago
Posts: 2859
Topic starter
April 27, 2024 9:24 AM
Sometimes we have cards that we only want to show when data is available. Or in other words: we like to hide those where data is unavailable (in my case: my QNAP NAS that may be a sleep).
Took me some effort to find how that works. Short version:
type: conditional
conditions:
- entity: sensor.my_entity_status
state_not: unavailable
card:
...
In an example:
type: conditional
conditions:
- entity: sensor.qnap_status
state_not: unavailable
card:
type: horizontal-stack
cards:
- type: gauge
entity: sensor.qnap_cpu_usage
name: CPU
- type: gauge
entity: sensor.qnap_memory_usage
name: MEMORY
- type: gauge
entity: sensor.qnap_volume_used_datavol1
name: DISK
The horizontal-stack card will only show (the 3 gauges) when the entity sensor.qnap_status is available.