Simple and Effective Alerting

You might get more answers, if you would actually show, what is not working, ie. the code from the dashboard where the notification should show. :slight_smile: You showed only the things that work. :slight_smile:

Sorry, I missed this reply.

I don’t know what code to do in the dashboard to show alerts. I have none. I don’t think I saw it in the instructions.

There isn’t anything that automatically shows those alerts on the dashboards, you have to manually build your lovelace dashboards using yaml and custom cards to get this effect. See link to instructions above.

I explain,

Putting it all together, this regular expression pattern matches entity IDs that:

  • Start with “alert.”
  • Have any characters (or none) after “alert.”
  • End with “_warn_alert_active.”

So, it will match entity IDs like “alert_something_warn_alert_active,” “alert_warn_alert_active,” “alert_x_warn_alert_active,” and so on, as long as they follow this pattern. It’s a way to dynamically match multiple entities with similar names that follow a certain naming convention.

look this example in the post:

alert:
  garage_door_info_alert_active:
    name: Garage Door Alert Active
    entity_id: binary_sensor.garage_door_alert_active
    state: "on"
    repeat:
      - 180
    can_acknowledge: true
    skip_first: true
    title: "7580 Info - Garage Door Open"
    message: >
      Garage Door open for {{ relative_time(states.binary_sensor.garage_door_alert_active.last_changed) }} \  
      Alerts on: {{ expand('group.garage_doors') | selectattr('state', 'eq', 'on') | map(attribute='attributes.friendly_name') | list | join(', ') }} \ 
      Triggered: {{ as_timestamp(states.binary_sensor.garage_door_alert_active.last_changed) | timestamp_custom('%A %I:%M%p (%d-%b-%Y)') }}
    done_message: "Garage Door Alert RESOLVED at {{ as_timestamp(states.binary_sensor.garage_door_alert_active.last_changed) | timestamp_custom('%A %I:%M%p (%d-%b-%Y)') }}"
    notifiers:
      - STD_Information

Try something like this :slight_smile:

alert:
  cold_plunge_low_flow_info_alert_active:
    name: Cold plunge low flow Alert Active
    entity_id: binary_sensor.cold_plunge_low_flow_info_alert_active   #YOUR BINARY or NORMAL SENSOR  that shows ON/OFF state for TRIGGER this ALERT
    state: "on"
    repeat:
      - 600
    can_acknowledge: true
    skip_first: true
    title: "7580 Info - Garage Door Open"
    message: 
      Cold plunge flow is low. Cold plunge chiller disabled. Change filter if needed, check valves open, and restart cold plunge chiller.
    notifiers:
      - STD_Information  #Your notifier as in notify.YOURID
2 Likes
    title: "7580 Info - Garage Door Open"
    message: >
      Garage Door open for {{ relative_time(states.binary_sensor.garage_door_alert_active.last_changed) }} \  
      Alerts on: {{ expand('group.garage_doors') | selectattr('state', 'eq', 'on') | map(attribute='attributes.friendly_name') | list | join(', ') }} \ 
      Triggered: {{ as_timestamp(states.binary_sensor.garage_door_alert_active.last_changed) | timestamp_custom('%A %I:%M%p (%d-%b-%Y)') }}
    done_message: "Garage Door Alert RESOLVED at {{ as_timestamp(states.binary_sensor.garage_door_alert_active.last_changed) | timestamp_custom('%A %I:%M%p (%d-%b-%Y)') }}"

only title title: title: “7580 Info - Garage Door Open”`works

Very nice and really usefull, thank you !!

I’m just wonder one thing.
Once the notification is displayed, we can acknoledge it using the input_boolean.
But then, you have to “rearm” the input_boolean for the next alert of the same category.
The best moment to do it is probably when the new alert is triggered.
One approach would be to create an automation that reset any notification input_boolean when an alert with the same name is triggered (using a regexp).

Your code look really clean so I guess you found a very nice way to do it.
Can you please share it ?
Thanks :slight_smile:

The input_boolean I added was as an additional condition the binary_sensor is monitoring the effectively allows me to enable or disable the alert.

That is different than the state of the alert. Take a closer look at the alert entity and you’ll see there are 3 states:
Idle - alert is not active
on - alert is active
off - alert is active, but acknowledged

So when you “acknowledge” an alert, you are doing that to the alert entity, not the input Boolean. Once the conditions that triggered the alert have gone away, the alert automatically goes back to idle, so no automation required.

I knew there was a good reason why you didn’t share a dedicated automation :slight_smile:
Thank you that’s very clear!
And it makes ‘alert’ even more interesting! (sorry I never used it before).

This amazing work — very elegantly done.

This is near perfect for me, and would even improve a few things.

The one thing I do that’s different though, is that I display a countdown timer (normal HA timer) as an indicator of urgency.

1 Like

Pics? :laughing: Seriously, I’m very interested in seeing how others do that. :wink:

For now I’m working with “mushroom-cards” just to show if there’s an active alert, but I’d love to see the messages, that get send with the alert. Still trying… :laughing:

Ah, I’m happy to share.

I built this using the custom button card years ago (so before the mushroom cards existed).

Here my gate has just been opened and the garage has been open for the maximum time. A yellow garage icon means it’s occupied (i.e. there’s a car parked inside). Red means it needs attention (i.e. open for too long).

These are my notifications. The time accumulates until it’s closed.

PS: Home Assistant saved me from disaster last night.

4 Likes

After the update to 2024.7, the custom:auto-entity card, when there are no elements and it should be hidden, leaves an empty space, here is an example of 3 cards (empty) in a vertical stack, is there any way to fix this?

image

This discussion started with “I avoided notification and alerting for a long time because I couldn’t find a well thought out approach that was simple, robust, and repeatable.”. Exactly my thoughts. Approach in this post seems like a well thought of system, which I might adopt to myself.

Unless…

During my 1 1/2 year experience with HA, one major change has been the development of UI for automations. Nowadays I can “write” quite decent automations in UI with only elementary YAML writing skills.

I have been trying to find if someone had already written a Universal Notification handler for HA. Have not find any thus far. As of now, notifications are not so easy to maintain.

Notification handler? My dream come true would be an approach where i could add a notification in an automation an easy way like

[pseudocode] if flue gas temperature < 200 for 2 minutes, notify “Add firewood to stove” [/pseudocode]

Then there would be a notification handler, where a new row would apper as

[stove monitor] [Add firewood to stove] Send to: [My phone] [wifes phone] [blink lights] Category: [Info/Warning/Critical] [enabled/disabled] [notify only people at home]

etc.; all of the options in Chad’s original post, just centralized.

What I would like to do is to remove notification handling from tens of automations to a centralized place, which would allow configuring options for each alert. Preferably with a GUI :slight_smile:

Auto entities card is new to me. Could this be a way to pick all notifications from all of my automations? But then, there is also the need to be able to set and store parameters for each of them in some kind of data file. And send the notification per set parameters.

Any ideas would be appreciated. Anything new during the years? Would be nice to have the skills to contribute, but so far any solutions to this have been out of my skillset.

1 Like

After the last HA update, the notification background disappeared, maybe there is an update? A solution to this problem?

Jan 2025 Update

I took some time over the last few days to convert the majority of my dashboards to the use of sections and use the UI instead of the yaml files. It was pretty straightforward once I figured out how to paste in yaml to the UI from my existing config and make the minor format changes required.

One of the issues that has cropped up over the past 6 months is the auto-entities cards are not fully hiding the way they should. This means there is additional lines of space at the top of your dashboard which is especially noticeable when you 8 of the cards stacked together the way I do. See issue - show_empty in Sections view · Issue #433 · thomasloven/lovelace-auto-entities

I don’t believe the original author of the auto-entities is active recently, so I decided the easiest thing to do was wrap them in conditional cards which, while not ideal, is working great. The only caveat is that you need to create binary template sensors with the same filter to control the conditional cards. Since many have copied my earlier configuration, I thought I’d update this post to include the new dashboard updates.

Additionally, I made a few style changes to the cards so they work better with themes. For instance, the informational type boxes now used the same background and font colors as the top view bar rather than blue.

image

Updates required to use conditional cards

New sensors required for conditional cards. These give you a count of each alert type. Note that I listed all of mine, but you only need to use those that apply to your build.

- template:
  - sensor:
      ## Note that all these count sensors are a workaround for extra space left between the custom:auto-entities cards when they are empty.  Putting the dashboard alerting in conditional cards.
      - name: "Active Crit Alerts Count"
        state: >
          {% set alerts = states.alert | selectattr('entity_id', 'match', '^alert.*_crit_alert_active$') | list %}
          {{ alerts | rejectattr('state', 'in', ['off', 'idle']) | list | length }}
        attributes:
          active_alerts: >
            {% set alerts = states.alert | selectattr('entity_id', 'match', '^alert.*_crit_alert_active$') | list %}
            {{ alerts | rejectattr('state', 'in', ['off', 'idle']) | map(attribute='entity_id') | list }}
      - name: "Active Warn Alerts Count"
        state: >
          {% set alerts = states.alert | selectattr('entity_id', 'match', '^alert.*_warn_alert_active$') | list %}
          {{ alerts | rejectattr('state', 'in', ['off', 'idle']) | list | length }}
        attributes:
          active_alerts: >
            {% set alerts = states.alert | selectattr('entity_id', 'match', '^alert.*_crit_warn_active$') | list %}
            {{ alerts | rejectattr('state', 'in', ['off', 'idle']) | map(attribute='entity_id') | list }}
      - name: "Active Info Alerts Count"
        state: >
          {% set alerts = states.alert | selectattr('entity_id', 'match', '^alert.*_info_alert_active$') | list %}
          {{ alerts | rejectattr('state', 'in', ['off', 'idle']) | list | length }}
        attributes:
          active_alerts: >
            {% set alerts = states.alert | selectattr('entity_id', 'match', '^alert.*_info_warn_active$') | list %}
            {{ alerts | rejectattr('state', 'in', ['off', 'idle']) | map(attribute='entity_id') | list }}
      - name: "Acknowledged Alerts Count"
        unique_id: acknowledged_alerts_count
        state: >
          {% set alerts = states.alert | list %}
          {{ alerts | rejectattr('state', 'in', ['on', 'idle']) | list | length }}
        attributes:
          acknowledged_alerts: >
            {% set alerts = states.alert | list %}
            {{ alerts | rejectattr('state', 'in', ['on', 'idle']) | map(attribute='entity_id') | list }}
      - name: "Water Issues Count"
        state: >
          {% set sensors = states | selectattr('attributes.device_class', 'eq', 'moisture') | list %}
          {{ sensors | rejectattr('state', 'in', ['off', 'unavailable', 'unknown']) | rejectattr('entity_id', 'search', 'weather') | list | length }}
        attributes:
          water_issues: >
            {% set sensors = states | selectattr('attributes.device_class', 'eq', 'moisture') | list %}
            {{ sensors | rejectattr('state', 'in', ['off', 'unavailable', 'unknown']) | rejectattr('entity_id', 'search', 'weather') | map(attribute='entity_id') | list }}
      - name: "Tech Issues Count"
        state: >
          {% set devices = expand('group.network_devices', 'group.server_devices', 'group.wan_devices') %}
          {{ devices | rejectattr('state', 'in', ['on', 'unavailable']) | list | length }}
        attributes:
          tech_issues: >
            {% set devices = expand('group.network_devices', 'group.server_devices', 'group.wan_devices') %}
            {{ devices | rejectattr('state', 'in', ['on', 'unavailable']) | map(attribute='entity_id') | list }}
      - name: "Information Count"
        state: >
          {% set entities = expand('group.device_uptimes') | selectattr('state', 'match', '[0-9] minutes') | list %}
          {{ entities | length }}
        attributes:
          matching_entities: >
            {% set entities = expand('group.device_uptimes') | selectattr('state', 'match', '[0-9] minutes') | map(attribute='entity_id') | list %}
            {{ entities }}

I also created a manual toggle switch to hide my “Possible issues” card which is a very useful card to quickly spot issues that come up, but sometimes I know what the issue is and don’t want to look at the warning once I know I need to get it fixed.

input_boolean:
  show_possible_issues:
    name: Show Possible Issues
    initial: false

The config I’m providing below is to create a full new section view if you use all of it. The easiest way to do that is by creating a new section view, then edit in yaml as you see in the screenshot. Delete the few lines in the new view, then paste the full text of the config.

title: Home
sections:
  - type: grid
    cards:
      - type: conditional
        conditions:
          - condition: numeric_state
            entity: sensor.active_crit_alerts_count
            above: 0
        card:
          type: custom:auto-entities
          show_empty: true
          card:
            type: entities
            title: Active Critical Alerts
            card_mod:
              style: |
                ha-card {
                  background-color: red;
                  --primary-text-color: white;
                  --secondary-text-color: white;
                  --paper-item-icon-color: white;
                }
          filter:
            include:
              - entity_id: /^alert(.).*_crit_alert_active/
                options:
                  secondary_info: last-changed
            exclude:
              - state: "off"
              - state: idle
          sort:
            method: last_changed
            reverse: true
      - type: conditional
        conditions:
          - condition: numeric_state
            entity: sensor.active_warn_alerts_count
            above: 0
        card:
          type: custom:auto-entities
          show_empty: true
          card:
            type: entities
            title: Active Warning Alerts
            card_mod:
              style: |
                ha-card {
                  background-color: orange;
                  --primary-text-color: white;
                  --secondary-text-color: white;
                  --paper-item-icon-color: white;
                }
          filter:
            include:
              - entity_id: /^alert(.).*_warn_alert_active/
                options:
                  secondary_info: last-changed
            exclude:
              - state: "off"
              - state: idle
          sort:
            method: last_changed
            reverse: true
      - type: conditional
        conditions:
          - condition: numeric_state
            entity: sensor.active_info_alerts_count
            above: 0
        card:
          type: custom:auto-entities
          show_empty: true
          card:
            type: entities
            title: Active Information Alerts
            card_mod:
              style: |
                ha-card {
                  background-color: var(--app-header-background-color);
                  --primary-text-color: var(--app-header-text-color);
                  --secondary-text-color: var(--app-header-text-color);
                  --paper-item-icon-color: var(--app-header-text-color);
                }
          filter:
            include:
              - entity_id: /^alert(.).*_info_alert_active/
                options:
                  secondary_info: last-changed
            exclude:
              - state: "off"
              - state: idle
          sort:
            method: last_changed
            reverse: true
      - type: conditional
        conditions:
          - condition: numeric_state
            entity: sensor.acknowledged_alerts_count
            above: 0
        card:
          type: custom:auto-entities
          show_empty: true
          card:
            type: entities
            title: Acknowledged Alerts
            card_mod:
              style: |
                ha-card {
                  background-color: var(--app-header-background-color);
                  --primary-text-color: var(--app-header-text-color);
                  --secondary-text-color: var(--app-header-text-color);
                  --paper-item-icon-color: var(--app-header-text-color);
                }
          filter:
            include:
              - domain: alert
                options:
                  secondary_info: last-changed
            exclude:
              - state: "on"
              - state: idle
          sort:
            method: last_changed
            reverse: true
      - type: conditional
        conditions:
          - condition: numeric_state
            entity: sensor.water_issues_count
            above: 0
        card:
          type: custom:auto-entities
          show_empty: true
          card:
            type: entities
            title: Water Issues
            card_mod:
              style: |
                ha-card {
                  background-color: red;
                  --primary-text-color: white;
                  --secondary-text-color: white;
                  --paper-item-icon-color: white;
                }
          filter:
            include:
              - attributes:
                  device_class: moisture
                options:
                  secondary_info: last-changed
            exclude:
              - state: "off"
              - state: unavailable
              - state: unknown
              - entity_id: "*weather*"
      - type: conditional
        conditions:
          - condition: numeric_state
            entity: sensor.tech_issues_count
            above: 0
        card:
          type: custom:auto-entities
          show_empty: true
          card:
            type: entities
            title: Tech Issues
            card_mod:
              style: |
                ha-card {
                  background-color: orange;
                  --primary-text-color: white;
                  --secondary-text-color: white;
                  --paper-item-icon-color: white;
                }
          filter:
            include:
              - group: group.network_devices
                options:
                  secondary_info: last-changed
              - group: group.server_devices
                options:
                  secondary_info: last-changed
              - group: group.wan_devices
                options:
                  secondary_info: last-changed
            exclude:
              - state: "on"
              - state: unavailable
      - type: conditional
        conditions:
          - condition: numeric_state
            entity: sensor.information_count
            above: 0
        card:
          type: custom:auto-entities
          show_empty: true
          card:
            type: entities
            title: Information
            card_mod:
              style: |
                ha-card {
                  background-color: var(--app-header-background-color);
                  --primary-text-color: var(--app-header-text-color);
                  --secondary-text-color: var(--app-header-text-color);
                  --paper-item-icon-color: var(--app-header-text-color);
                }
          filter:
            template: |
              {{
                expand('group.device_uptimes') 
                | selectattr('state', 'match', '[0-9] '[0-9] [Mm]inutes') 
                | map(attribute='entity_id') 
                | list 
              }}
      - type: conditional
        conditions:
          - condition: state
            entity: input_boolean.show_possible_issues
            state: "on"
        card:
          type: custom:auto-entities
          show_empty: false
          card:
            type: entities
            title: Possible Issues
            show_header_toggle: false
            card_mod:
              style: |
                ha-card {
                  background-color: var(--app-header-background-color);
                  --primary-text-color: var(--app-header-text-color);
                  --secondary-text-color: var(--app-header-text-color);
                  --paper-item-icon-color: var(--app-header-text-color);
                }
          filter:
            include:
              - state: unknown
              - state: unavailable
            exclude:
              - entity_id: device_tracker.*
              - entity_id: person.*
              - entity_id: group.*
              - entity_id: scene.*
              - entity_id: update.*
              - entity_id: event.*
              - entity_id: sensor.stokerbbq*
              - entity_id: sensor.auto_backup_last_failure
              - entity_id: sensor.*_last_ding
              - entity_id: switch.wall*_dimmer*
              - entity_id: button.*
              - entity_id: sensor.weatherflow_wind_*
              - entity_id: sensor.weatherflow_feels_*
              - entity_id: number.*_effect_speed
              - entity_id: binary_sensor.updater
              - integration: twinkly
              - entity_id: vacuum.vacuum_fairy
              - entity_id: "*alarm*"
              - entity_id: "*timer*"
              - entity_id: "*reminder*"
              - entity_id: "*shuffle*"
              - entity_id: "*repeat*"
              - entity_id: "*do_not_disturb*"
              - entity_id: media_player.*
              - entity_id: select.gaming*
              - entity_id: "*t*.home_assistant*"
              - entity_id: sensor.*last_seen
              - entity_id: sensor.*spotify*
              - entity_id: sensor.meater*
              - entity_id: "*.speedtest_wan_two_*"
              - integration: mqtt

Obviously, your configuration will be different than mine, so you can also just pick and choose the individual cards and sensors you need from the config above and paste them in directly, as necessary.

FYI - @andrewjswan

Also @vesar, I don’t know of any universal notification handler like you mention, however I did recently start using the :round_pushpin: State Notifications & Actions - Blueprints Exchange - Home Assistant Community which meets the majority of my needs, and they are pretty easy to maintain. Combine that with some of the new categorization and labels, and it can even be organized pretty well.

4 Likes

I had a same problem. You have to downgrade card-mod to version 3.4.4.

@ccpk1
… did you try @Anacron suggestion to use card-mod v3.4.4?
… are you combining 📍 State Notifications & Actions with your code to send the alerts as Notifications to mobile devices? Would love to see how you are doing this? It would be great to have a single 📍 State Notifications & Actions per type of alert (Critical, Warning, Info, etc)… making them actionable so they could be dismissed everywhere via the mobile device.

Hi!

So in general I love the alerts thank you for the work, but I just can’t get the dashboard to work.
Here’s a raw copy of my testing dashboard (it should just be the same as yours for fault finding).

views:
  - title: Home
title: Home
sections:
  - type: grid
    cards:
      - type: conditional
        conditions:
          - condition: numeric_state
            entity: sensor.active_crit_alerts_count
            above: 0
        card:
          type: custom:auto-entities
          show_empty: true
          card:
            type: entities
            title: Active Critical Alerts
            card_mod:
              style: |
                ha-card {
                  background-color: red;
                  --primary-text-color: white;
                  --secondary-text-color: white;
                  --paper-item-icon-color: white;
                }
          filter:
            include:
              - entity_id: /^alert(.).*_crit_alert_active/
                options:
                  secondary_info: last-changed
            exclude:
              - state: 'off'
              - state: idle
          sort:
            method: last_changed
            reverse: true
      - type: conditional
        conditions:
          - condition: numeric_state
            entity: sensor.active_warn_alerts_count
            above: 0
        card:
          type: custom:auto-entities
          show_empty: true
          card:
            type: entities
            title: Active Warning Alerts
            card_mod:
              style: |
                ha-card {
                  background-color: orange;
                  --primary-text-color: white;
                  --secondary-text-color: white;
                  --paper-item-icon-color: white;
                }
          filter:
            include:
              - entity_id: /^alert(.).*_warn_alert_active/
                options:
                  secondary_info: last-changed
            exclude:
              - state: 'off'
              - state: idle
          sort:
            method: last_changed
            reverse: true
      - type: conditional
        conditions:
          - condition: numeric_state
            entity: sensor.active_info_alerts_count
            above: 0
        card:
          type: custom:auto-entities
          show_empty: true
          card:
            type: entities
            title: Active Information Alerts
            card_mod:
              style: |
                ha-card {
                  background-color: var(--app-header-background-color);
                  --primary-text-color: var(--app-header-text-color);
                  --secondary-text-color: var(--app-header-text-color);
                  --paper-item-icon-color: var(--app-header-text-color);
                }
          filter:
            include:
              - entity_id: /^alert(.).*_info_alert_active/
                options:
                  secondary_info: last-changed
            exclude:
              - state: 'off'
              - state: idle
          sort:
            method: last_changed
            reverse: true
      - type: conditional
        conditions:
          - condition: numeric_state
            entity: sensor.acknowledged_alerts_count
            above: 0
        card:
          type: custom:auto-entities
          show_empty: true
          card:
            type: entities
            title: Acknowledged Alerts
            card_mod:
              style: |
                ha-card {
                  background-color: var(--app-header-background-color);
                  --primary-text-color: var(--app-header-text-color);
                  --secondary-text-color: var(--app-header-text-color);
                  --paper-item-icon-color: var(--app-header-text-color);
                }
          filter:
            include:
              - domain: alert
                options:
                  secondary_info: last-changed
            exclude:
              - state: 'on'
              - state: idle
          sort:
            method: last_changed
            reverse: true
      - type: conditional
        conditions:
          - condition: numeric_state
            entity: sensor.water_issues_count
            above: 0
        card:
          type: custom:auto-entities
          show_empty: true
          card:
            type: entities
            title: Water Issues
            card_mod:
              style: |
                ha-card {
                  background-color: red;
                  --primary-text-color: white;
                  --secondary-text-color: white;
                  --paper-item-icon-color: white;
                }
          filter:
            include:
              - attributes:
                  device_class: moisture
                options:
                  secondary_info: last-changed
            exclude:
              - state: 'off'
              - state: unavailable
              - state: unknown
              - entity_id: '*weather*'
      - type: conditional
        conditions:
          - condition: numeric_state
            entity: sensor.tech_issues_count
            above: 0
        card:
          type: custom:auto-entities
          show_empty: true
          card:
            type: entities
            title: Tech Issues
            card_mod:
              style: |
                ha-card {
                  background-color: orange;
                  --primary-text-color: white;
                  --secondary-text-color: white;
                  --paper-item-icon-color: white;
                }
          filter:
            include:
              - group: group.network_devices
                options:
                  secondary_info: last-changed
              - group: group.server_devices
                options:
                  secondary_info: last-changed
              - group: group.wan_devices
                options:
                  secondary_info: last-changed
            exclude:
              - state: 'on'
              - state: unavailable
      - type: conditional
        conditions:
          - condition: numeric_state
            entity: sensor.information_count
            above: 0
        card:
          type: custom:auto-entities
          show_empty: true
          card:
            type: entities
            title: Information
            card_mod:
              style: |
                ha-card {
                  background-color: var(--app-header-background-color);
                  --primary-text-color: var(--app-header-text-color);
                  --secondary-text-color: var(--app-header-text-color);
                  --paper-item-icon-color: var(--app-header-text-color);
                }
          filter:
            template: |
              {{
                expand('group.device_uptimes') 
                | selectattr('state', 'match', '[0-9] '[0-9] [Mm]inutes') 
                | map(attribute='entity_id') 
                | list 
              }}
      - type: conditional
        conditions:
          - condition: state
            entity: input_boolean.show_possible_issues
            state: 'on'
        card:
          type: custom:auto-entities
          show_empty: false
          card:
            type: entities
            title: Possible Issues
            show_header_toggle: false
            card_mod:
              style: |
                ha-card {
                  background-color: var(--app-header-background-color);
                  --primary-text-color: var(--app-header-text-color);
                  --secondary-text-color: var(--app-header-text-color);
                  --paper-item-icon-color: var(--app-header-text-color);
                }
          filter:
            include:
              - state: unknown
              - state: unavailable
            exclude:
              - entity_id: device_tracker.*
              - entity_id: person.*
              - entity_id: group.*
              - entity_id: scene.*
              - entity_id: update.*
              - entity_id: event.*
              - entity_id: sensor.stokerbbq*
              - entity_id: sensor.auto_backup_last_failure
              - entity_id: sensor.*_last_ding
              - entity_id: switch.wall*_dimmer*
              - entity_id: button.*
              - entity_id: sensor.weatherflow_wind_*
              - entity_id: sensor.weatherflow_feels_*
              - entity_id: number.*_effect_speed
              - entity_id: binary_sensor.updater
              - integration: twinkly
              - entity_id: vacuum.vacuum_fairy
              - entity_id: '*alarm*'
              - entity_id: '*timer*'
              - entity_id: '*reminder*'
              - entity_id: '*shuffle*'
              - entity_id: '*repeat*'
              - entity_id: '*do_not_disturb*'
              - entity_id: media_player.*
              - entity_id: select.gaming*
              - entity_id: '*t*.home_assistant*'
              - entity_id: sensor.*last_seen
              - entity_id: sensor.*spotify*
              - entity_id: sensor.meater*
              - entity_id: '*.speedtest_wan_two_*'
              - integration: mqtt


And in my config


# Loads default set of integrations. Do not remove.
default_config:

# Load frontend themes from the themes folder
frontend:
  themes: !include_dir_merge_named themes
  extra_module_url:
    - /www/community/lovelace-auto-entities/auto-entities.js
    - /www/community/lovelace-card-mod/card-mod.js

automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml

#################################  Notify  ###################################
notify:
  - name: STD_Information
    platform: group
    services:
      - service: mobile_app_bens_iphone
      - service: mobile_app_bens_ipad_air
  - name: STD_Warning
    platform: group
    services:
      - service: mobile_app_bens_iphone
      - service: mobile_app_iphone
      - service: mobile_app_bens_ipad_air
  - name: STD_Critical
    platform: group
    services:
      - service: mobile_app_bens_iphone
      - service: mobile_app_iphone
      - service: mobile_app_bens_ipad_air
      
## Inputs ##
input_boolean:
  amina_humidity_notify:
    name: Amina Humidity Notify
    icon: mdi:alert

  amina_temperature_notify:
    name: Amina Temperature Notify
    icon: mdi:alert

  fridge_temperature_notify:
    name: Fridge Temperature Notify
    icon: mdi:alert

## Binary sensor ##
template:
  - binary_sensor:
      - name: Amina Humidity Alert Trigger
        state: >
          {{ 
            (states('sensor.tp357s_0b57_humidity') | float(0) < 50 or 
            states('sensor.tp357s_0b57_humidity') | float(0) > 90) and 
            is_state('input_boolean.amina_humidity_notify', 'on') 
          }}
        availability: >
          {{ states('sensor.tp357s_0b57_humidity') not in ['unavailable', 'unknown', 'none'] }}

      - name: Amina Ambient Temperature Alert Trigger
        state: >
          {{ 
            (states('sensor.tp357s_0b57_temperature') | float(0) < 19 or 
            states('sensor.tp357s_0b57_temperature') | float(0) > 33) and 
            is_state('input_boolean.amina_temperature_notify', 'on') 
          }}
        availability: >
          {{ states('sensor.tp357s_0b57_temperature') not in ['unavailable', 'unknown', 'none'] }}

      - name: Amina Basking Temperature Alert Trigger
        state: >
          {{ 
            (states('sensor.sonoff_10018d0948_temperature') | float(0) < 19 or 
            states('sensor.sonoff_10018d0948_temperature') | float(0) > 33) and 
            is_state('input_boolean.amina_temperature_notify', 'on') 
          }}
        availability: >
          {{ states('sensor.sonoff_10018d0948_temperature') not in ['unavailable', 'unknown', 'none'] }}

      - name: Fridge Temperature Alert Trigger
        state: >
          {{ 
            (states('sensor.h5074_f3ac_temperature') | float(0) < 2 or 
            states('sensor.h5074_f3ac_temperature') | float(0) > 6) and 
            is_state('input_boolean.fridge_temperature_notify', 'on') 
          }}
        availability: >
          {{ states('sensor.h5074_f3ac_temperature') not in ['unavailable', 'unknown', 'none'] }}

      - name: Amina Plug Alert Trigger
        state: >
          {{ 
            states('switch.amina_s_plug_localbytes_plug_pm_67d9c4') in ['off', 'unavailable', 'unknown'] 
          }}
        availability: >
          {{ states('switch.amina_s_plug_localbytes_plug_pm_67d9c4') not in ['none'] }}
          
      - name: Amina Sensor Unavailable
        state: >
          {{ states('sensor.tp357s_0b57_temperature') in ['unavailable', 'unknown', 'none'] or
              states('sensor.sonoff_10018d0948_temperature') in ['unavailable', 'unknown', 'none']
          }}
          

## Alerts ##
alert:
  amina_humidity_alert_active:
    name: Amina Humidity Alert Active
    entity_id: binary_sensor.amina_humidity_alert_trigger
    state: "on"
    repeat:
      - 15
      - 30
      - 60
      - 120
    can_acknowledge: true
    skip_first: true
    title: "7580 Critical Alert - Amina Vivarium Humidity"
    message: >
      Humidity is {{ states('sensor.tp357s_0b57_humidity') }}% \
      Triggered: {{ as_timestamp(states.binary_sensor.amina_humidity_alert_trigger.last_changed) | timestamp_custom('%A %I:%M%p (%d-%b-%Y)') }}
    done_message: >
      Amina Vivarium Humidity RESOLVED at \
      {{ as_timestamp(states.binary_sensor.amina_humidity_alert_trigger.last_changed) | timestamp_custom('%A %I:%M%p (%d-%b-%Y)') }}
    notifiers:
      - STD_Critical
      
  amina_basking_temp_alert_active:
    name: Amina Basking Temperature Alert Active
    entity_id: binary_sensor.amina_basking_temperature_alert_trigger
    state: "on"
    repeat:
      - 15
      - 30
      - 60
      - 120
    can_acknowledge: true
    skip_first: true
    title: "7580 Critical Alert - Amina Vivarium Basking Temperature"
    message: >
      Temperature is {{ states('sensor.sonoff_10018d0948_temperature') }}°C \
      Triggered: {{ as_timestamp(states.binary_sensor.amina_basking_temperature_alert_trigger.last_changed) | timestamp_custom('%A %I:%M%p (%d-%b-%Y)') }}
    done_message: >
      Amina Vivarium Temperature RESOLVED at \
      {{ as_timestamp(states.binary_sensor.amina_basking_temperature_alert_trigger.last_changed) | timestamp_custom('%A %I:%M%p (%d-%b-%Y)') }}
    notifiers:
      - STD_Critical
      
  amina_ambient_temp_alert_active:
    name: Amina Ambient Temperature Alert Active
    entity_id: binary_sensor.amina_ambient_temperature_alert_trigger
    state: "on"
    repeat:
      - 15
      - 30
      - 60
      - 120
    can_acknowledge: true
    skip_first: true
    title: "7580 Critical Alert - Amina Vivarium Basking Temperature"
    message: >
      Temperature is {{ states('sensor.tp357s_0b57_temperature') }}°C \
      Triggered: {{ as_timestamp(states.binary_sensor.amina_ambient_temperature_alert_trigger.last_changed) | timestamp_custom('%A %I:%M%p (%d-%b-%Y)') }}
    done_message: >
      Amina Vivarium Temperature RESOLVED at \
      {{ as_timestamp(states.binary_sensor.amina_ambient_temperature_alert_trigger.last_changed) | timestamp_custom('%A %I:%M%p (%d-%b-%Y)') }}
    notifiers:
      - STD_Critical
     
  fridge_temp_alert_active:
    name: Fridge Temperature Alert Active
    entity_id: binary_sensor.fridge_temperature_alert_trigger
    state: "on"
    repeat:
      - 15
      - 30
      - 60
      - 120
    can_acknowledge: true
    skip_first: true
    title: "7580 Critical Alert - Fridge Temperature"
    message: >
      Temperature is {{ states('sensor.h5074_f3ac_temperature') }}°C \
      Triggered: {{ as_timestamp(states.binary_sensor.fridge_temperature_alert_trigger.last_changed) | timestamp_custom('%A %I:%M%p (%d-%b-%Y)') }}
    done_message: >
      Fridge Temperature RESOLVED at \
      {{ as_timestamp(states.binary_sensor.fridge_temperature_alert_trigger.last_changed) | timestamp_custom('%A %I:%M%p (%d-%b-%Y)') }}
    notifiers:
      - STD_Critical

  amina_plug_alert_active:
    name: Amina Plug Alert Active
    entity_id: binary_sensor.amina_plug_alert_trigger
    state: "on"
    repeat:
      - 5
      - 15
      - 30
      - 60
    can_acknowledge: true
    skip_first: true
    title: "7580 Critical Alert - Amina Vivarium Plug"
    message: >
      Amina's plug is {{ states('switch.amina_s_plug_localbytes_plug_pm_67d9c4') }} \
      Triggered: {{ as_timestamp(states.binary_sensor.amina_plug_alert_trigger.last_changed) | timestamp_custom('%A %I:%M%p (%d-%b-%Y)') }}
    done_message: >
      Amina Vivarium Plug RESOLVED at \
      {{ as_timestamp(states.binary_sensor.amina_plug_alert_trigger.last_changed) | timestamp_custom('%A %I:%M%p (%d-%b-%Y)') }}
    notifiers:
      - STD_Critical

  amina_availability_alert_active:
    name: Amina Availability Alert Active
    entity_id: binary_sensor.amina_sensor_unavailable
    state: "on"
    repeat:
      - 5
      - 15
      - 30
      - 60
    can_acknowledge: true
    skip_first: true
    title: "7580 Warning - Amina Sensor Unavailable"
    message: >
      Amina's ambient sensor is {{ states('sensor.tp357s_0b57_temperature') | default('Unknown') }}°C \
      Amina's basking sensor is {{ states('sensor.sonoff_10018d0948_temperature') | default('Unknown') }}°C \
      Triggered: {{ as_timestamp(states.binary_sensor.amina_sensor_unavailable.last_changed) | timestamp_custom('%A %I:%M%p (%d-%b-%Y)') }}
    done_message: >
      Amina Sensor Unavailable RESOLVED at \ 
      {{ as_timestamp(states.binary_sensor.amina_sensor_unavailable.last_changed) | timestamp_custom('%A %I:%M%p (%d-%b-%Y)') }}
    notifiers:
      - STD_Warning
      
  joke_weekday_alert_active:
    name: Weekday Alert Active
    entity_id: binary_sensor.workday_sensor
    state: "on"
    repeat:
      - 15
      - 30
      - 60
      - 120
    can_acknowledge: true
    skip_first: true
    title: "7580 Info - It's a Weekday"
    message: >
      The weekday sensor was triggered at 
      {{ as_timestamp(states.binary_sensor.workday_sensor.last_changed) | timestamp_custom('%A, %I:%M %p (%d-%b-%Y)') }}.
    done_message: >
      Weekday status resolved at 
      {{ as_timestamp(states.binary_sensor.workday_sensor.last_changed) | timestamp_custom('%A, %I:%M %p (%d-%b-%Y)') }}.
    notifiers:
      - STD_Information
      
  weekend_alert_active:
    name: Weekend Alert Active
    entity_id: binary_sensor.workday_sensor
    state: "off"
    repeat:
    - 15
    - 30
    - 60
    - 120
    can_acknowledge: true
    skip_first: true
    title: "7580 Info - It's the Weekend"
    message: >
      The weekend sensor was triggered at 
      {{ as_timestamp(states.binary_sensor.workday_sensor.last_changed) | timestamp_custom('%A, %I:%M %p (%d-%b-%Y)') }}.
    done_message: >
      Weekend status resolved at 
      {{ as_timestamp(states.binary_sensor.workday_sensor.last_changed) | timestamp_custom('%A, %I:%M %p (%d-%b-%Y)') }}.
    notifiers:
      - STD_Information


I made that alert just for fault finding, and I can see it is active in my Overview dashboard, but just can’t get the cards to show. Any ideas what I’m doing wrong? Presume it’s a noob thing

I’m just looking at this on my phone, but from what I can tell, the naming of your alerts does not match with the intended pattern. For instance, take a look at the critical alert regex criteria in the dashboard card. It is expecting an alert named alert.xxxxxx_crit_alert_active.

Also, I don’t see config for the sensor that counts active critical alerts which is required for the conditional card to display. sensor.active_crit_alerts_count Can you confirm in the developer tools that it is there and showing a count of 1 or more when an alert is active?

It’s a good suggestion, but I haven’t tried reverting it because I already made all the other config changes to work around it, so wasn’t worth it to me.

As for the state notification blueprint, I think it’s great, but I haven’t tried to integrate it into what I put together for alerting yet.

*** Update, I remember this was asked previously and it doesn’t look like blueprints can create the required entities. Simple and Effective Alerting - #7 by LordMike