Show one entity until another entity state change?

I’m looking for a solution / card where I can show one entity, (eg. A picture or slideshow), until another entity changes, (eg. Motion detected), where then I want to show the second entity, (eg. Camera).

Is this somehow doable with native or pre built functions or would this be a new card that is yet to be developed?

Thanks

Take a look at the Conditional Card - Home Assistant (home-assistant.io)

I’m showing one card when the entity: media_player.allhome is in the state: playing
And onother set of cards when the entity: media_player.allhome is in the state_not: playing

type: vertical-stack
cards:
  - card:
      type: custom:mod-card
      style:
        .: |
          ha-card {
            overflow: hidden;
            width: 58%;
            margin: 0 auto;
            padding-top: 0px;
          }
      card:
        type: horizontal-stack
        cards:
          - type: custom:mini-media-player
            entity: media_player.allhome
            group: false
            volume_stateless: false
            toggle_power: true
            artwork: full-cover
            sound_mode: full
            info: scroll
    conditions:
      - entity: media_player.allhome
        state: playing
    type: conditional
  - type: conditional
    conditions:
      - entity: media_player.allhome
        state_not: playing
    card:
1 Like