You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thank you SO MUCH for this - I've been looking for this for a long time :-)
I'm beginning to customize it, and the first thing I noticed was that a lot of these unavailable entities all have to do with a few devices. How would I list the devices only, instead of all the entities?
This also list all entities that have a state of unknown. Would it be possible to omit these, thus only listing the unavailable ones? I've tried to look for an "unknown" keyword, but I can't find any...
The text was updated successfully, but these errors were encountered:
Not really. The attribute is a list of entity id's. I suppose one could write a template which tries to identifies any devices that is unavailable, list those devices but not it's entities, and then list any remaining entities that don't belong to a device. But that is well beyond the scope of this sensor. I'll leave this issue open for now and maybe if I get a little time I'll try to put something together for you. You might get a quicker response in the forum. Also see the example detailed notification automation it sorts entities by device and names the device.
Make the same changes I made to the base template here to yours to only select entities with a state of unavailable.
{% set ignore_seconds = 60 %}
{% set ignored = state_attr('group.ignored_unavailable_entities', 'entity_id') %}
{% set ignore_ts = (now().timestamp() - ignore_seconds)|as_datetime %}
{% set entities = states
| rejectattr('domain','in',['button', 'event', 'group', 'image', 'input_button', 'input_text', 'remote', 'tts', 'scene', 'stt'])
| rejectattr('last_changed', 'ge', ignore_ts)
| selectattr('state','eq','unavailable') %}
{% set entities = entities | rejectattr('entity_id', 'in', ignored) if ignored != none else entities %}
{{ entities | map(attribute='entity_id') | list | sort }}
The text was updated successfully, but these errors were encountered: