Lovelace - alerts card and toggles

I migrated my setup to lovelace but the alerts used to look like that (only showing when it on, offering me the choice to toggle it off
alerts3

now, this is how it’s setup:

cards:
  - type: entity-filter
    title: Alertes
    show_header_toggle: true
    entities:
      - alert.nest_protect_1er_smoke_detected
      - alert.sonos_one_bureau
      - alert.porte_entree_open
      - alert.nest_protect_1er_online
      - alert.sfap
      - alert.porte_patio_open
      - alert.hdhomerun
      - alert.sfserver
      - alert.nest_protect_1er_smoke_severity
      - alert.sfpfsense_down
      - alert.nest_protect_1er_co_detected
      - alert.sfn_nvr
      - alert.hp_printer_down
      - alert.nest_protect_1er_co_severity
    state_filter:
      - on     

but when an alert is on, it doesn’t appear in the UI at all (I check the state is really “on”) plus, if I change the type to “entities”, no more toggle:
alerts

I need to click on it to see the toggle:
alerts2

I feel it’s a configuration issue but I’m unsure.
Should I use conditional?

PS. when no alert is on, it still show the card, can I avoid that when there is no alert showing?
alerts4

I beleive you need quotes around your states, you have

 - on

try

  - "on"
1 Like

You can use the conditional card to hide it when empty as well.

You can hide the empty card with show_empty: false in the entity-filter card.

2 Likes

yes, thanks that worked
needed the quotes
- "on"

Perfect, show_empty: false is what was missing to hide the empty card.
Thanks!

What about the toggles directly in card instead of having to go in it?
I thought show_header_toggle: true was for this but it doesn’t change a thing…

show header toggle is only for lights. It will turn on/off all the lights inside a card.

You aren’t getting your toggles because you haven’t cleared your cache and reloaded your page. CTRL+F5. I’ve never put a light/toggle in that card. It’s also possible that it does not display the toggles.

Not sure I follow… I understand what header toggle is for, thanks for the explanations.
But those aren’t lights, they are alerts.
Before lovelace, alerts, when added in UI, automatically set themselves with toggles (to turn them off if the alert annoys you if still on) but now, it just shows “idle” / “on” and not toggle when on (the toggle is only accessible when I actually go in the alert detail screen…
Not a big deal, just curious of my options in lovelace, still learning :slight_smile:

I’ve never used alerts, so I have no idea how they behave. If they have toggles they should appear. If they aren’t appearing, then the behavior hasn’t been added into lovelace yet. It’s quite possible that they haven’t been added.

CTRL+F5 should clear the cache and reload the page. If that doesn’t make the ‘on’ turn to a toggle, then alerts haven’t been added yet.

ok thanks for you help, I appreciate it

My alerts don’t have toggles either. But, if you click on the name of the alert in the card, you’ll get the state card popup and the toggle is available there.

I’m guessing this just isn’t handled in lovelace yet.

1 Like