Entity-filter card several state_filters

Greetings,

I have a problem with the entity-filter card. I want to use several state_filters. In easier explanation I want it to “show” on the card if the entity has any of the following states.

  - type: entity-filter
    entities:
      - entity: timer.alarmactivatedelay 
      - entity: sensor.larmonmessage
      - entity: sensor.panik           
        secondary_info: last-changed
    state_filter: 
      - 'AKTIVERAT'   
      - '30'
      - '25'
      - '20'      
    show_empty: false
    card:
      title: Larm

Kind regards,

That’s how the card works. I don’t think your timer will show though because it’s a timer. 30 isn’t a state for a timer. Timers show time, not a single number. I’m guessing you have a similar problem with the other 2 entities. You need to get the EXACT state and place it into the state_filter. It’s EXACT or nothing. For example '30:00' does not equal '30', and '00:30:00' does not equal '30', and 'AKTIVERAT' does not equal 'Aktivrat'.

The timer does count down and the state is a number atleast in the “states” tab in home assistant.

Right, but it’s a timer. I can guarentee it doesn’t say “1.5 minutes” on a 1 minute and 30 second timer. It would have a time state of "01:30" or "00:01:30". This will make a difference for your filter state card.

Not to mention, if you do actually get this to appear, it will only show up for 1 second… Is that really what you want?

It counts down from 30 to 0 and then the event triggers, I want it to show every second IF its counting down (between 30-0) I just put out a few of the numbers though as an example here on the forum

The problem is that mostly it stay as “Idle” and then I dont want to show it. I only want to show it IF its actually counting down.

what does the state look like when it’s off. What does the state look like when it’s on? Take a screenshot of the entity inside the states page during these 2 states and post it here.

My timers show states either active (when counting down) or idle (when finish), try state: ‘active’ for timer if you want to show when counting down?

Capture

See what I mean? State is “Idle” right now, and as soon as It starts it counts down from “30” to “0” then goes to “finished”, then “idle”

Hmm, my timer is active when counting down:

And I use some automation based on that.

Capture

Here you can see a printscreen on my “home assistant/states” webpage (the old UI) and it shows time. On the picture it is 22, but it counts down every second. I just want this to show in my lovelace card

I can also put it right into a card and I actually see the countdown, but as soon as I try to use entity-filter card it doesn’t show up. Is the actual countdown maybe an attribute and not a state?

Hover on the little pink area and see what the state is:

image

If it’s active like @JTPublic says, then this is what you should have in your config:

  - type: entity-filter
    entities:
      - entity: timer.alarmactivatedelay 
      - entity: sensor.larmonmessage
      - entity: sensor.panik           
        secondary_info: last-changed
    state_filter: 
      - 'AKTIVERAT'   
      - 'active'     
    show_empty: false
    card:
      title: Larm
1 Like

Actually, I debugged into the code and it 100% should be ‘active’ when not ‘idle’ as @JTPublic said. So the configuration I posted above should show your timers. I do not know if it will show your other items. For your other items to show, you need to verify that the state’s are what you expect them to be. Do not look in the place you are looking, you should be looking in the states page for this information:

You guys were completely right, when I put active as state filter the countdown show up, thanks a lot guys!