djbrooks022
(Smart Home Sysadmin)
July 6, 2021, 4:43pm
1
I have a conditional card setup that displays a Media Control card when the TV is playing.
type: conditional
conditions:
- entity: media_player.65_tcl_roku_tv
state: playing
card:
type: media-control
entity: media_player.65_tcl_roku_tv
I know I can create a 2nd conditional card that shows state “paused” and a 3rd for “idle”. Is there a way to add an OR condition to 1 conditional card? I was hoping I could do something like:
type: conditional
conditions:
- entity: media_player.65_tcl_roku_tv
state: playing, paused, idle
card:
type: media-control
entity: media_player.65_tcl_roku_tv
or
type: conditional
condition: or
conditions:
- entity: media_player.65_tcl_roku_tv
state: playing
- entity: media_player.65_tcl_roku_tv
state: idle
card:
type: media-control
entity: media_player.65_tcl_roku_tv
but either I am not formatting it correctly or there isn’t a way to do this. Anyone have any ideas on this?
tom_l
July 6, 2021, 4:58pm
2
No. Multiple conditions are treated as AND logic. That’s just the way the card is.
You have a couple of options.
Create a binary template sensor with your OR conditions and use that binary sensor in the conditional card,
or
Use the custom State Switch card.
Ever wanted a lovelace card that’s only shown for certain users?
Ever wanted to show a certain lovelace card in one spot if the door is open, and another one otherwise?
Ever wanted to be able to swap out a part of your layout when you press a button?
Ever wanted to do that only on one device, and not on all of them at once?
Ever wanted to show different cards depending on the size of your window, or on wheter you’re viewing it on a touch enabled device or not?
[image]
[image]
State-sw…
2 Likes
djbrooks022
(Smart Home Sysadmin)
July 6, 2021, 5:39pm
3
Thanks for the help. I think I’ll with Option 1 for now and experiment with the state-switch card later. I’ve never heard of that one but it looks really promising.