Page 1 of 1
Forum

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!



How to hide empty c...
 
Share:
Notifications
Clear all

[Solved] How to hide empty cards ...

1 Posts
1 Users
0 Reactions
170 Views
 Hans
(@hans)
Famed Member Admin
Joined: 11 years ago
Posts: 2705
Topic starter  

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.


   
ReplyQuote
Share: