I’m using the below template in a markdown card to display devices reporting as unavailable
but | rejectattr('name', 'eq', 'HACS')
is not working correctly…i.e. “HACS” still appears in the list of devices.
The rest of the template works as expected but what am I doing wrong with the rejectattr
?
type: markdown
title: Devices Offline
content: |-
{% set device_ids = states
| selectattr('state', 'in', ['unavailable'])
| rejectattr('name', 'eq', 'HACS')
| map(attribute='entity_id')
| map("device_id")
| map("string")
| unique
| select("ne", "None")
| list
%}
{% for device_id in device_ids %}
{{ device_attr(device_id, "name_by_user") or device_attr(device_id, "name")}}
{%- endfor %}