Unavailable / Unknown Entity Monitoring - Template Sensor

Ok Jason. I’ve had a little breather and I hope you have had a bit of one also. Can you or someone here help me get the below to display friendly names in the notifications? I’m still learning this stuff and afraid I’m going to mess up the progress we’ve already made.

###################################################################################################
## Package - Unavailable Entities Sensor
## Count and list entities with a state of unavailable, unknown, or none (null)
## See README for customization options.
## https://github.com/jazzyisj/unavailable-entities-sensor/blob/main/README.md
###################################################################################################

# NOTE: Home Assistant v2021.12 required.  For older versions please see README
# REQUIRED - This is the template sensor
template:
  - sensor:
      - name: "Unavailable Entities"
        unique_id: unavailable_entities
        icon: "{{ 'mdi:alert-circle' if states('sensor.unavailable_entities')|int(0) > 0 else 'mdi:check-circle' }}"
        unit_of_measurement: entities
        state: >
          {% if state_attr('sensor.unavailable_entities','entity_id') != none %}
            {{ state_attr('sensor.unavailable_entities','entity_id')|count }}
          {% endif %}
        attributes:
          entity_id: >
            {% if state_attr('group.ignored_unavailable_entities','entity_id') != none %}
              {% set ignore_seconds = 300 %}
              {% set ignore_ts = (now().timestamp() - ignore_seconds)|as_datetime %}
              {% set entities = states|rejectattr('domain','in',['group','button','automation','scene'])|selectattr('state','in',['unavailable','unknown','none'])|list %}
              {% set buttons = states.button|selectattr('state','eq','unavailable')|list %}
              {{ (entities + buttons)
                |rejectattr('entity_id','in',state_attr('group.ignored_unavailable_entities','entity_id'))
                |rejectattr('entity_id','search','sensor.weatherbit')
                |rejectattr('entity_id','search','keymaster')
                |rejectattr('entity_id','search','media_player')
                |rejectattr('last_changed','ge',ignore_ts)
                |map(attribute='entity id')|list }}
            {% endif %}

# REQUIRED - Add any entities you do not wish to monitor in this group.
# IMPORTANT - This group MUST exist even if empty for sensor template to render.
group:
  ignored_unavailable_entities:
    entities:
      - sensor.unavailable_entities # prevent template loop warnings?
      - binary_sensor.back_porch_outlet_heat_alarm_overheat_detected
      - binary_sensor.garage_door_access_control_barrier_sensor_low_battery_warning
      - binary_sensor.garage_door_access_control_barrier_sensor_not_detected_supervisory_error
      - binary_sensor.garage_door_access_control_barrier_unattended_operation_has_been_disabled_per_ul_requirements
      - binary_sensor.garage_door_home_security_tampering_product_cover_removed
      - binary_sensor.garage_door_low_battery_level
      - light.desk_lamp
      - sensor.clarice_charger_type

# OPTIONAL - filter template loop warnings from the Home Assistant log.
logger:
  filters:
    homeassistant.components.template.template_entity:
      - "Template loop detected while processing event"
# OPTIONAL Example automation to demonstrate how you can utilize this sensor
# SEE Automation.yaml

Automation:

automation:
  - id: unavailable_entities_notification
    alias: 'Unavailable Entities Notification'
    description: 'Create persistent notification if there are unavailable entities, dismiss if none.'
    mode: restart
    trigger:
      - platform: state
        entity_id: sensor.unavailable_entities
        to: ~
    condition:
      - condition: template
        value_template: >
          {{ is_number(trigger.from_state.state)
              and is_number(trigger.to_state.state) }}
    action:
      - if:
          - condition: numeric_state
            entity_id: sensor.unavailable_entities
            below: 1
        then:
          - service: persistent_notification.dismiss
            data:
              notification_id: unavailable_entities
        else:
          - service: persistent_notification.create
            data:
              title: Unavailable Devices
              message: |-
                - {{ expand(state_attr('sensor.unavailable_entities','entity_id'))
                      |map(attribute='entity_id')|join('\n- ') }}
              notification_id: unavailable_entities
          - service: notify.mobile_app_weston
            data:
              title: Unavailable Devices
              message: |-
                - {{ expand(state_attr('sensor.unavailable_entities','entity_id'))
                      |map(attribute='entity_id')|join('\n- ') }}

EDITED: Automation Code

I think something messed up with your copy and paste again. Always right click and paste as plain text here. The newlines rendered here as actual newlines instead of the escaped character (’\n’).

Anyway, I think this is what you are looking for. You should be able to copy an paste this into your automation yaml. Compare what I wrote for you here to see the difference and go back and read my previous comments. This is where you need to “expand” the entity id list back into a states object so you can relist them by their name instead of the entity id. (A join automatically creates a list object)

      - service: persistent_notification.create
        data:
          title: Unavailable Devices
          message: |-
            - {{ expand(state_attr('sensor.unavailable_entities','entity_id'))
                  |map(attribute='name')|join('\n- ') }}
          notification_id: unavailable_entities
      - service: notify.mobile_app_weston
        data:
          title: Unavailable Devices
          message: |-
            - {{ expand(state_attr('sensor.unavailable_entities','entity_id'))
                  |map(attribute='name')|join('\n- ') }}

Yeah, for some reason, I didn’t have any of those characters in the original code. I went back in and adjusted and edited my code post from earlier. I apologize for that. One day, I will get it right, haha. Yeah, I was reading that last night and didn’t fully understand what was going on. But now I think I do after this conversation.

So I’m noticing a simiar “map” list creation in the actual package also, but the attribute used there is “entity_id”. Is the reason we don’t “map” that to “name” at that point is because we want to keep everything in terms of entity_id until the very end as those are where all the states are object (entity) states are stored. I’m sorry, I know I’m probably not using the right terminology but I’m trying to understand the overall concept. I guess this is “object oriented programming”? So, where can I go to learn what all the attributes are for an sensor I guess is how I should ask it? Also, what is the significance of the “|map(attribute)” portion and lastly what is the purpose of piping the expand into the map. And Maybe, the best question of all is, where can I go to get a waterhose teaching on getting functional in this stuff?

Thank you for helping me Jason. I really appreciate everything you have shown me. I believe your package and the way you laid it out in your repo could help alot of people understand this stuff quicker than usual.

I promise you, these will be the last questions related to this stuff. I feel like a massive pita.

Can you copy and pasted this into the Template tool (in Developer Tools)?

{{ states('sensor.gym_active_app_id') }}

And reply with this screenshot.

I deleted that post. Sorry for the false alarm, definitely still learning.

@jazzyisj
Hello,

Random question, is there a method to use this and it be able to pick out an integration that is not connecting properly. I guess, if the integration connecting/ working properly, by proxy it will result in “broken” entities (unknown etc.) more than likely. So maybe this is a mute point. I’ll give you a little background from where this is stemming from.

In the past, you helped me modify your package to send friendly names and we added to the automation, the ability for it to send a push notification to my phone also. In the meantime, I have learned a few things, it looks like the push notification is limited to 20-30 lines, I have had a weather integration stop working properly, which pushed the notification over the line limitation so I got only a subset of the unknown entities. My thoughts were, if I could reduce the quantity of entities by only reporting the integration name as the issue maybe that would work.

To be honest, I don’t mind any other ideas, I just saw this as a bit of an issue.

As a sidenote: I was trying to be lazy and use this as a dual fold solution-- i.e. also use for automatic notification when a battery device dies (zwave/ zigbee)

Below is my modified package.

###################################################################################################
## Package - Unavailable Entities Sensor
## Count and list entities with a state of unavailable, unknown, or none (null)
## See README for customization options.
## https://github.com/jazzyisj/unavailable-entities-sensor/blob/main/README.md
###################################################################################################

# NOTE: Home Assistant v2021.12 required.  For older versions please see README
# REQUIRED - This is the template sensor
template:
  - sensor:
      - name: "Unavailable Entities"
        unique_id: unavailable_entities
        icon: "{{ 'mdi:alert-circle' if states('sensor.unavailable_entities')|int(0) > 0 else 'mdi:check-circle' }}"
        unit_of_measurement: entities
        state: >
          {% if state_attr('sensor.unavailable_entities','entity_id') != none %}
            {{ state_attr('sensor.unavailable_entities','entity_id')|count }}
          {% endif %}
        attributes:
          entity_id: >
            {% if state_attr('group.ignored_unavailable_entities','entity_id') != none %}
              {% set ignore_seconds = 3600 %}
              {% set ignore_ts = (now().timestamp() - ignore_seconds)|as_datetime %}
              {% set entities = states|rejectattr('domain','in',['group','button','automation','scene'])|selectattr('state','in',['unavailable','unknown','none'])|list %}
              {% set buttons = states.button|selectattr('state','eq','unavailable')|list %}
              {{ (entities + buttons)
                |rejectattr('entity_id','in',state_attr('group.ignored_unavailable_entities','entity_id'))
                |rejectattr('entity_id','search','keymaster')
                |rejectattr('entity_id','search','weatherbit_')
                |rejectattr('entity_id','search','media_player')
                |rejectattr('last_changed','ge',ignore_ts)
                |rejectattr('entity_id','search','search4text')
                |map(attribute='entity_id')|list }}
            {% endif %}

# REQUIRED - Add any entities you do not wish to monitor in this group.
# IMPORTANT - This group MUST exist even if empty for sensor template to render.
group:
  ignored_unavailable_entities:
    entities:
      - sensor.unavailable_entities # prevent template loop warnings?
      - binary_sensor.back_porch_outlet_heat_alarm_overheat_detected
      - binary_sensor.garage_door_access_control_barrier_sensor_low_battery_warning
      - binary_sensor.garage_door_access_control_barrier_sensor_not_detected_supervisory_error
      - binary_sensor.garage_door_access_control_barrier_unattended_operation_has_been_disabled_per_ul_requirements
      - binary_sensor.garage_door_home_security_tampering_product_cover_removed
      - binary_sensor.garage_door_low_battery_level
      - light.desk_lamp
      - sensor.clarice_charger_type
      - sensor.gym_active_app
      - sensor.gym_active_app_id
      - sensor.living_room_active_app
      - sensor.living_room_active_app_id
      - sensor.master_bedroom_active_app
      - sensor.master_bedroom_active_app_id
      - select.living_room_channel
      - select.gym_channel
      - select.master_bedroom_channel
      - sensor.activewindowsensor
      - binary_sensor.namedwindowsensorretrobat
      - sensor.holiday
      - sensor.weatheralerts_alert_3_last_changed
      - sensor.weatheralerts_alert_4_last_changed
      - sensor.weatheralerts_alert_5_last_changed
      - sensor.weatheralerts_alert_3_most_recent_active_alert
      - sensor.weatheralerts_alert_4_most_recent_active_alert
      - sensor.weatheralerts_alert_5_most_recent_active_alert
      - sensor.washer_last_complete
      - sensor.pirateweather_precip
      - sensor.front_door_motion_away_count
      - sensor.lightning_near_home_lightning_azimuth
      - sensor.lightning_near_home_lightning_distance
# OPTIONAL - filter template loop warnings from the Home Assistant log.
logger:
  filters:
    homeassistant.components.template.template_entity:
      - "Template loop detected while processing event"
# OPTIONAL Example automation to demonstrate how you can utilize this sensor
# SEE Automation.yaml

I should add that the persistent notification that shows within the home assistant dashboard is working flawlessly.

EDIT: And for others visiting this thread. My updated automation including the phone push notification:

alias: (ACTION- AUTOMATIC- SECURITY- NOTIFICATION) Unavailable Entities Notification
description: >-
  Create persistent notification if there are unavailable entities, dismiss if
  none.
trigger:
  - platform: state
    entity_id: sensor.unavailable_entities
    to: null
condition:
  - condition: template
    value_template: |
      {{ is_number(trigger.from_state.state)
          and is_number(trigger.to_state.state) }}
action:
  - if:
      - condition: numeric_state
        entity_id: sensor.unavailable_entities
        below: 1
    then:
      - service: persistent_notification.dismiss
        data:
          notification_id: unavailable_entities
    else:
      - service: persistent_notification.create
        data:
          title: Unavailable Devices
          message: |-
            - {{ expand(state_attr('sensor.unavailable_entities','entity_id'))
                  |map(attribute='name')|join('\n- ') }}
          notification_id: unavailable_entities
      - service: notify.mobile_app_weston
        data:
          title: Unavailable Devices
          message: >-
            {{
            expand(state_attr('sensor.unavailable_entities','entity_id'))|map(attribute='name')|join('\n')
            }}

Not really. I have done something similar in my own config though, and it works in a similar way. As matter of fact I don’t really pay much attention to my “unavailable entities” sensor for the reason you pointed out (you don’t need to know about multiple entities because usually if one isn’t working they all aren’t) unless I’m debugging something in particular.

Anyway, this is how I have HA let me know that something hasn’t connected or isn’t working, There might actually be a better way to do this. It’s something I’ve always meant to inquire about myself but never got around to it because this works just fine. It would be nice if integrations created their own “hey I’m connected and working” sensors but they don’t.

So basically, for every integration I want to monitor, I pick a primary entity of the integration (one that should always have a value) and create a template binary sensor that indicates the state of that entity.

This is the template binary sensor for my Environment Canada integration.

template:
  - binary_sensor:
      - name: "EnvCan Connected"
        unique_id: envcan_connected
        icon: mdi:weather-partly-snowy-rainy
        device_class: connectivity
        state: "{{ states('weather.windsor') not in ['unknown','unavailable'] }}"

Next I created a group that contains all of my integration monitor binary sensors. Any time I add (or remove an integration I just add the sensor I have created for it to this group.

group:
  integration_connected_sensors:
    all: true
    entities:
      - binary_sensor.balboa_connected
      - binary_sensor.tomorrow_io_connected
      - binary_sensor.dark_sky_connected
      - binary_sensor.envcan_connected
      - binary_sensor.google_calendar_connected
      - etc. etc.

Then finally I created another template sensor to use as the trigger (if it turns off) for the notification that an integration is not connected.

template:
  - binary_sensor:
      - name: "Integrations Connected"
        unique_id: integrations_connected
        icon: "{{ iif(is_state(this.entity_id,'on'),'mdi:api','mdi:api-off') }}"
        device_class: connectivity
        delay_on: 300
        state: "{{ is_state('group.integration_connected_sensors','on') }}"

This is the template that lists the integrations that are offline in my notification (which is actually an alert)

- {{ expand('group.integration_connected_sensors')
      |selectattr('state','eq','off')|map(attribute='name')|join('<br>- ') }}

BTW there is a simplified updated version of the unavailable entities sensor available on the git.

1 Like

This is all great and I believe I follow it fully. Thank you for explaining all of this in the detail of which I can more than likely follow sometime soon. I believe this will be very helpful for others also visiting this thread also. Thank you again Jason!!

Ahhh, I see. I appreciate that!

Hello all,

Could someone help me figure out why I would be getting push notifications that have a title but body has no entities in it?

Essentially, what is happening is that I’ll get a notification of a device being an issue and it is correct. However, after I go fix the device which takes the unavailable entities sensor to 0, I get another notification that has no entities in it. (So a blank one)

Below is my automation. I haven’t been able to look at the persistent notification just yet so I’m not sure if it is doing the same thing or if it still looks fine. I just noticed this behavior on my phone recently.

Below is the automation I am using to call the sensor.—> I have verified that the sensor does have a value of 0.

alias: (ACTION- AUTOMATIC- SECURITY- NOTIFICATION) Unavailable Entities Notification
description: >-
  Create persistent notification if there are unavailable entities, dismiss if
  none.
trigger:
  - platform: state
    entity_id: sensor.unavailable_entities
    to: null
condition:
  - condition: template
    value_template: |
      {{ is_number(trigger.from_state.state)
          and is_number(trigger.to_state.state) }}
action:
  - if:
      - condition: numeric_state
        entity_id: sensor.unavailable_entities
        below: 1
    then:
      - service: persistent_notification.dismiss
        data:
          notification_id: unavailable_entities
    else:
      - service: persistent_notification.create
        data:
          title: Unavailable Devices
          message: |-
            - {{ expand(state_attr('sensor.unavailable_entities','entity_id'))
                  |map(attribute='name')|join('\n- ') }}
          notification_id: unavailable_entities
  - service: script.text_notify
    data:
      who: parents
      title: Unavailable Devices
      message: >-
        {{
        expand(state_attr('sensor.unavailable_entities','entity_id'))|map(attribute='name')|join('\n')
        }}
      group: null
      tag: null

Additionally, here is my package where I have only made changes to the individual entity area and select attr filters.

###################################################################################################
## Package - Unavailable Entities Sensor
## Count and list entities with a state of unavailable, unknown, or none (null)
## See README for customization options.
## https://github.com/jazzyisj/unavailable-entities-sensor/blob/main/README.md
###################################################################################################

# NOTE: Home Assistant v2021.12 required.  For older versions please see README
# REQUIRED - This is the template sensor
template:
  - sensor:
      - name: "Unavailable Entities"
        unique_id: unavailable_entities
        icon: "{{ 'mdi:alert-circle' if states('sensor.unavailable_entities')|int(0) > 0 else 'mdi:check-circle' }}"
        unit_of_measurement: entities
        state: >
          {% if state_attr('sensor.unavailable_entities','entity_id') != none %}
            {{ state_attr('sensor.unavailable_entities','entity_id')|count }}
          {% endif %}
        attributes:
          entity_id: >
            {% if state_attr('group.ignored_unavailable_entities','entity_id') != none %}
              {% set ignore_seconds = 3600 %}
              {% set ignore_ts = (now().timestamp() - ignore_seconds)|as_datetime %}
              {% set entities = states|rejectattr('domain','in',['group','button','automation','scene','script'])|selectattr('state','in',['unavailable','unknown','none'])|list %}
              {% set buttons = states.button|selectattr('state','eq','unavailable')|list %}
              {{ (entities + buttons)
                |rejectattr('entity_id','in',state_attr('group.ignored_unavailable_entities','entity_id'))
                |rejectattr('entity_id','search','keymaster')
                |rejectattr('entity_id','search','weatherbit_')
                |rejectattr('entity_id','search','media_player')
                |rejectattr('last_changed','ge',ignore_ts)
                |rejectattr('entity_id','search','weatheralerts_')
                |rejectattr('entity_id','search','octoprint_')
                |rejectattr('entity_id','search','westonspc_')
                |map(attribute='entity_id')|list }}
            {% endif %}

# REQUIRED - Add any entities you do not wish to monitor in this group.
# IMPORTANT - This group MUST exist even if empty for sensor template to render.
group:
  ignored_unavailable_entities:
    entities:
      - sensor.unavailable_entities # prevent template loop warnings?
      - binary_sensor.garage_door_access_control_barrier_sensor_low_battery_warning
      - binary_sensor.garage_door_access_control_barrier_sensor_not_detected_supervisory_error
      - binary_sensor.garage_door_access_control_barrier_unattended_operation_has_been_disabled_per_ul_requirements
      - binary_sensor.garage_door_home_security_tampering_product_cover_removed
      - binary_sensor.garage_door_low_battery_level
      - light.desk_lamp
      - sensor.gym_active_app
      - sensor.gym_active_app_id
      - sensor.living_room_active_app
      - sensor.living_room_active_app_id
      - sensor.master_bedroom_active_app
      - sensor.master_bedroom_active_app_id
      - select.living_room_channel
      - select.gym_channel
      - select.master_bedroom_channel
      - sensor.weatheralerts_alert_3_last_changed
      - sensor.weatheralerts_alert_4_last_changed
      - sensor.weatheralerts_alert_5_last_changed
      - sensor.weatheralerts_alert_3_most_recent_active_alert
      - sensor.weatheralerts_alert_4_most_recent_active_alert
      - sensor.weatheralerts_alert_5_most_recent_active_alert
      - sensor.washer_last_complete
      - sensor.pirateweather_precip
      - sensor.front_door_motion_away_count
      - sensor.lightning_near_home_lightning_azimuth
      - sensor.lightning_near_home_lightning_distance
      - sensor.holiday
# OPTIONAL - filter template loop warnings from the Home Assistant log.
logger:
  filters:
    homeassistant.components.template.template_entity:
      - "Template loop detected while processing event"
# OPTIONAL Example automation to demonstrate how you can utilize this sensor
# SEE Automation.yaml

If I have an entity or rejectattr (i.e. deleted entities and this file hasn’t been updated to match) that isn’t in my home assistant setup anymore, could that be causing this issue?

You need to indent the second service call code under the else block. Right now script.text_notify is not part if the if/else block and is running every time the automation runs even if there are no unavailable entities (so you get a blank list in your notifcation).

action:
  - if:
      - condition: numeric_state
        entity_id: sensor.unavailable_entities
        below: 1
    then:
      - service: persistent_notification.dismiss
        data:
          notification_id: unavailable_entities
    else:
      - service: persistent_notification.create
        data:
          title: Unavailable Devices
          message: |-
            - {{ expand(state_attr('sensor.unavailable_entities','entity_id'))
                  |map(attribute='name')|join('\n- ') }}
          notification_id: unavailable_entities

      - service: script.text_notify
        data:
          who: parents
          title: Unavailable Devices
          message: >-
            {{
            expand(state_attr('sensor.unavailable_entities','entity_id'))|map(attribute='name')|join('\n')
            }}
          group: null
          tag: null

If you add a tag to your push notification you could also add some code under the if block to automatically dismiss the push notifications when there are no unavailable entities similar to the persistent notification if you want.

1 Like

Geeze. Thank you Jason. I didn’t even realize my indention was wrong. Thank you so much for catching that.

Whaaaaatttttt??? Tell me more please, or possibly shhoowww me more if you happen to have a code sample around of this. That is a great idea. I had no idea you could do that. So you can make the push notification disappear off of your phone automatically when the device is corrected? Yeah, definitely would like to know more about this.

The more I use HA, the more I realize just how much better it is than other things out there. I must admit, you have to spend time in the trenches but once you get everything pretty well setup the way you want it, it’s really nice.

Thank you again Jason for alway being so helpful. Eventually I’ll get this thing figured out.

EDIT: For anyone stumbling upon this thread and looking for the concept (automatically clearing iOS notification) @jazzyisj was explaining above. Here is the completed automation.

The link to documentation for feature is: Notification Cleared | Home Assistant Companion Docs

alias: (ACTION- AUTOMATIC- SECURITY- NOTIFICATION) Unavailable Entities Notification
description: >-
  Create persistent notification if there are unavailable entities, dismiss if
  none.
trigger:
  - platform: state
    entity_id: sensor.unavailable_entities
    to: null
condition:
  - condition: template
    value_template: |
      {{ is_number(trigger.from_state.state)
          and is_number(trigger.to_state.state) }}
action:
  - if:
      - condition: numeric_state
        entity_id: sensor.unavailable_entities
        below: 1
    then:
      - service: persistent_notification.dismiss
        data:
          notification_id: unavailable_entities
      - service: script.text_notify
        data:
          who: parents
          title: Unavailable Devices
          message: clear_notification
          group: null
          tag: unavailable_entities
    else:
      - service: persistent_notification.create
        data:
          title: Unavailable Devices
          message: |-
            - {{ expand(state_attr('sensor.unavailable_entities','entity_id'))
                  |map(attribute='name')|join('\n- ') }}
          notification_id: unavailable_entities
      - service: script.text_notify
        data:
          who: parents
          title: Unavailable Devices
          message: >-
            {{
            expand(state_attr('sensor.unavailable_entities','entity_id'))|map(attribute='name')|join('\n')
            }}
          group: null
          tag: unavailable_entities
1 Like

Sorry I was away for a few days. Glad you got it figured out. Sounds like your config is really coming along :slight_smile:

No, your fine. Yeah, I’m very happy with it. HA makes all other stuff look so horrible. haha.

Def no master like yourself but I do have it doing everything I would want and it’s so customizable that you can literally make it “exactly” like you would want most of the time.

Thank you for all of the help you have given me Jason. You are very helpful.

@jazzyisj I’m sorry I keep coming back with more odd questions every little bit but the more I learn about things, things creep into my mind and I’ll be honest, you’re an expert on this stuff for sure. I’ve been reading about dead zwave nodes. If I had a “dead” zwave node would this essentially catch it by proxy? Or not at all?

My question stems from just general research about how HA works.

Thank you @jazzyisj if you or someone else can expand on this situation. Very appreciative again of everything you’ve taught me.

you’re an expert on this stuff for sure

Thank you, but I am far from that. I’ve just been at it a while.

If I had a “dead” zwave node would this essentially catch it by proxy? Or not at all?

If any of the entities for the zwave device have the state of unknown or unavailable after the node goes dead (they likely will) and you have not excluded them in the template or added them to your ignored entities group they will be reported by this sensor.

I forced a zwave node go dead and here the entities that get reported for this device.

@jazzyisj thank you for replying to this one Jason. Very helpful. I was hoping that was the case.

I’ve been using a version of this script since almost the time this thread was created. I recently decided to update to the newest version of the template sensor and noticed something different almost immediately. In the past when a sensor failed I would receive a notification (pushover) and at the same time when a sensor went back online, I would get a notification showing the updated list (minus any that were no longer unavailable).

With this new version, it doesn’t seem to send a notification when an entity is subtracted from the unavailable list. Is that the case, or am I doing something wrong?

To have your automation to trigger every time an entity becomes available/unavailable change your automation trigger to the entity_id attribute of the unavailable sensor, rather than the state.

      - platform: state
        entity_id: sensor.unavailable_entities
        attribute: entity_id
        to: ~
1 Like

I didn’t see this asked, but is there a way to add to the group a wildcard. like I don’t want to track anything that is a device_tracker. So instead of listing all of them, i would just add device_tracker.*. Also anything that is named a certain way, i.e. if there are a bunch of entities with the name master, I would like to add *master*

Is there a way to add this coding to the unavailble_entities yaml?

there a way to add to the group a wildcard

You build both of those right into the template, not in the ignore group. Group is for individual entities only. It’s thoroughly documented in the README on the git.