How to make mediaplayer card optional, only visible when playing

Newbie question I guess. I’ve search but cannot find the answer.

I have HA up and running, Zigbee, rfxcomm. All working fine.
I’m now playing with defining my own interface instead of the default. Using lovelace & default cards.
I have multiple chromecast devices, which all show on the dashboard. How can I configure this so that a device is only visible if playing (or powered on if playing is no option)?

I tried the ‘Conditional Card’ to display the device only when state = on. But then it will never show.
Where can I find all attributes of an entity?

type: conditional

  • entity: media_player.nesthub0343
    state: ‘on’
    type: media-control
    entity: media_player.nesthub0343’

Any help / pointer is appreciated!

Try this in the conditional card:

state_not: "off"
1 Like

Brilliant, it works :slight_smile:
Life can be so simple sometimes. Thanks!

1 Like