Lovelace - Media-control filter?

HI,

trying to setup the media_players in Lovelace, I can’t find a way to ‘filter’ the players without a state yet? In regular Hassio these simply wouldn’t show up, but in Lovelace now shoe this:

36

@ciotlosm: is the -filter option to be expected anytime soon on media-control or is it to be configured otherwise?
secondly:

reading the docs are we forced to have each player configured with the

- title: Media
    icon: mdi:theater
    id: Media
    cards:
      - type: media-control
        entity: media_player.player1
      - type: media-control
        entity: media_player.player2
      - type: media-control
        entity: media_player.player3

or would a shorter notation be allowed too:

- title: Media
    icon: mdi:theater
    id: Media
    cards:
      - type: media-control
        entities: 
          - media_player.player1
          - media_player.player2
          - media_player.player3

thx,
Marius

1 Like

This will probably work best with a combination of entity-filter, but there is a PR in progress for this.
You can’t work with shorter notation because media-control supports just 1 entity, not a list of entities.

exactly that’s what i tried but didn’t work, will wait for the PR then.
thanks for your swift response, I take it you are over-taxed at the moment …:wink:
stay calm and relax!

HI @fabaff,

i get a notification you’ve written me a note (a pencil) but can’t seem to find it? 25
anything I missed, or need to know? see the same appear in another thread on a question about the side_panel and Lovelace… :wink:
cheers,
Marius

Hi @ciotlosm,
has this ever been resolved? I still see the same behavior with the default settings:

  - type: media-control
    entity: media_player.apple_tv_library

11

Give the monster-card from @ciotlosm a try

great idea!

not as evident though for me yet…

trying:

  - type: "custom:monster-card"
    card:
      title: Monster media players
      type: entities
    filter:
      include:
        - domain: media_player
          state:  'idle'
        - domain: media_player
          state:  'paused'
        - domain: media_player
          state:  'off'

since I couldn’t get

  - type: "custom:monster-card"
    card:
      title: Monster media players
      type: entities
    filter:
      include:
        - domain: media_player
          state: in [ 'idle', 'paused', 'off']

to work. Are templates of a kind available here?
still this results in:

09

  - type: "custom:monster-card"
    card:
      title: Monster media players
      type: entities
    filter:
      include:
        - entity_id: media_player.*

rsults in the same listing, albeit also with the unavailable ones, nicely listed, no yellow unavailable entities line.

I tried the above with type: media-control, but think I made mistakes, or that isn’t possible, since the page wouldn’t load any more.

How can I show all (as in ., not listing them separately) available media_players, in state [‘playing’, ‘idle’, ‘paused’, 'stopped, ‘off’], on a card: media-control ?

Looking for this as well.

I’d love to reproduce the magic from /states where media cards are shown for all known media players.

34

I did have this:

- cards:
  - card:
      entity: media_player.family_room_speaker
      type: media-control
    conditions:
      - entity: media_player.family_room_speaker
        state_not: unavailable
    type: conditional
  - card:
      entity: media_player.milo
      type: media-control
    conditions:
      - entity: media_player.milo
        state_not: unavailable
    type: conditional
  - card:
      entity: media_player.emby_emby_for_ios
      type: media-control
    conditions:
      - entity: media_player.emby_emby_for_ios
        state_not: unavailable
    type: conditional
  - card:
      entity: media_player.xboxone
      type: media-control
    conditions:
      - entity: media_player.xboxone
        state_not: unavailable
    type: conditional
  - card:
      entity: media_player.plexamp_milo
      type: media-control
    conditions:
      - entity: media_player.plexamp_milo
        state_not: unavailable
    type: conditional
  - card:
      entity: media_player.plex_web_firefox_2
      type: media-control
    conditions:
      - entity: media_player.plex_web_firefox_2
        state_not: unavailable
    type: conditional
type: vertical-stack

Which does work
But it’s a lot of hassle to keep in-sync.

I have tried lovelace-auto-entities, but it doesn’t seem to support the media card.