yep, expressing the exact same thing. Hope Bdraco and Amelchio will bring back some way of limiting updating templates, the way entity_id did before.
have a challenge myself, which before simply and only was updated by an automation/script (see the commented entity_id)
now, it won’t stop and kill the instance…
- platform: template
sensors:
entities_unavailable:
# entity_id:
# - script.update_entities_uun
# - automation.check_for_unavailable_entities
friendly_name: Entities Unavailable
value_template: >
{% set ignore_list = ['light.driveway_floodlight','light.garden_backyard_floodlight','light.garden_terrace_floodlight',
'light.porch_floodlight','light.parking_light'] if
is_state('binary_sensor.outside_daylight_sensor','on') else [] %}
{% set unavailable = states|selectattr('state','eq','unavailable')
|rejectattr('entity_id','in',state_attr('group.entity_blacklist','entity_id'))
|rejectattr('entity_id','in',ignore_list)
|rejectattr('domain','eq','media_player')
|map(attribute='entity_id')
|list %}
{{unavailable|count}}
# {% if states('sensor.entities_unavailable')|int > 0 %} mdi:thumb-down
# {% else %} mdi:thumb-up
# {% endif %}
entities_uun:
# entity_id:
# - script.update_entities_uun
# - automation.check_for_unavailable_entities
friendly_name: Entities U/U/N
value_template: >
{% set ignore_list = ['light.driveway_floodlight','light.garden_backyard_floodlight','light.garden_terrace_floodlight',
'light.porch_floodlight','light.parking_light'] if
is_state('binary_sensor.outside_daylight_sensor','on') else [] %}
{{states|selectattr('state','in',['unavailable','unknown','none'])
|rejectattr('entity_id','in',ignore_list)
|rejectattr('entity_id','in',state_attr('group.entity_blacklist','entity_id'))
|rejectattr('domain','in',['group','media_player'])
|map(attribute='entity_id')
|list|length}}
attribute_templates:
Unknown: >
{% set unknown = states|selectattr('state','eq','unknown')
|rejectattr('entity_id','in',state_attr('group.entity_blacklist','entity_id'))
|rejectattr('domain','in',['group'])
|map(attribute='entity_id')
|list %}
{% if unknown|count == 0 %} 0
{% else %}
{{unknown|count}}:
{{'\n' + unknown|join(',\n')}}
{% endif %}
Unknown sensors: >
{% set unknown = states.sensor|selectattr('state','eq','unknown')
|rejectattr('entity_id','in',state_attr('group.entity_blacklist','entity_id'))
|map(attribute='entity_id')
|list %}
{% if unknown|count == 0 %} 0
{% else %}
{{unknown|count}}:
{{'\n' + unknown|join(',\n')}}
{% endif %}
Unavailable: >
{% set ignore_list = ['light.driveway_floodlight','light.garden_backyard_floodlight','light.garden_terrace_floodlight',
'light.porch__floodlight','light.parking_light'] if
is_state('binary_sensor.outside_daylight_sensor','on') else [] %}
{% set unavailable = states|selectattr('state','eq','unavailable')
|rejectattr('entity_id','in',state_attr('group.entity_blacklist','entity_id'))
|rejectattr('entity_id','in',ignore_list)
|rejectattr('domain','eq','media_player')
|map(attribute='entity_id')
|list %}
{% if unavailable|count == 0 %} 0
{% else %}
{{unavailable|count}}:
{{'\n'}}{{unavailable|join(',\n')}}
{% endif %}
None: >
{% set none_ = states|selectattr('state','eq','none')
|map(attribute='entity_id')
|list %}
{% if none_|count == 0 %} 0
{% else %}
{{none_|count}}:
{{'\n' + none_|join(',\n')}}
{% endif %}
Full: >
{% set full = states|selectattr('state','in',['unavailable','unknown','none'])
|map(attribute='entity_id')
|list %}
{{full|count}}:
{{'\n' + full|join(',\n')}}