Auto-entities filter domain in 3 states

HI,

trying to set auto-entities to show all my media_players with state playing, paused, idle.

    filter:
      include:
        - state: 'playing'
        - state: 'idle'
        - state: 'paused'
          domain: media_player

this isn’t working, and maybe I can add the domain to all states, or vv. Can’t we template this somehow:

    filter:
      include:
        - domain
          state:  >
            {{in ['playing', 'idle', 'paused']}}

or any other way?
please have a look, must be an often desired config…

It’s right in the docs!

for and:

    filter:
      include:
        - state 1: 'playing'
          state 2: 'idle'
          state 3: 'paused'
          domain: media_player

for or

    filter:
      include:
        - state: 'playing'
          domain: media_player
        - state: 'idle'
          domain: media_player
        - state: 'paused'
          domain: media_player

well, I must be going blind, have been searching for that the last 20 times Ive read them… please point me to it, because I was already writing a feature request adding templates. Which still might be a great feature…

Any option can be used more than once by appending a number or string to the option name:

filter:
  include:
    - state 1: "> 100"
      state 2: "< 200"
The filter above matches entities where the state is above 100 AND below 200. Compare to the following:

filter:
  include:
    - state: "< 100"
    - state: "> 200"
The two filters above together match entities where the state is below 100 OR above 200.

I think @thomasloven was in the process of adding that already. I vaguely remember him saying that somewhere on these forums. My memory isn’t always great though.

your suggestion seems valid, but doesn’t work in my setup.

Ive found this to do work though:

    filter:
      include:
        - state: /playing|paused|idle/
          domain: media_player

even shorter than templating :wink:

FR has been posted. feature request: templating... · Issue #28 · thomasloven/lovelace-auto-entities · GitHub

if only to support

so cool this is finally entering Lovelace. thanks for your feedback, much appreciated!

as a side note:

I can get the media_players to show up as when configured via a dedicated media-control card, that is, with the larger picture and buttons below that:

29

all auto-entities, monster and entity-filter cards show them as:

16

which is too bad really, because I did like the bigger picture, and now get all red cards, when one of these isn’t available, because not playing.

Would you know how to change that, maybe by adding a type to these auto cards?

bingo: as I search the community again, I find this: Lovelace: Bringing back entity-filter (monster-card) - #89 by thomasloven …!

no, it’s just going to be this card if i remember correctly.

Markdown now natively accepts Jinja, and card-mod accepts it also!