@tom_l @SgtBatten So I chose one of the easier ones to review in detail. It is entity “light.desk_lamp”. It was a hue bulb that I had to throw away because it was defective. 2 screenshots are below GUI entity list (no filters applied other than “desk” and automated lovelace.)
I also made sure when I went to integrations/ hue, it doesn’t show up there either.
Lastly, I went to Visual studio code and searched for “light.desk_lamp”
It does show up in a package called “package_unavailable_entities” and in a group called “ignored_unavailable_entities” so @SgtBatten. It sounds like you hit the nail on the head in my instance also. This is a package that I’ve not played cleanup with as well as many of my others.
Package pasted below:
###################################################################################################
## 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