Hello
My template for alarmo have stopped working.
I had a senor to see which sensor trigged the alarm and got the friendly name of the sensor.
but now it just blank.
{% set result = namespace(sensors=[]) %}
{% for state in states.sensor
| selectattr('attributes.device_class', 'defined')
| selectattr('attributes.device_class', '==', 'open_sensors')
| rejectattr('state', 'in', ['unavailable', 'unknown'])
| selectattr('entity_id', 'search', 'friendly_name') %}
{% set result.sensors = result.sensors %}
{% endfor %}
{{ result.sensors|join('\n') }}
if I just filter on open_sensors I get this on alarmo entity.
under open_sensor I get binary_sensor.pannrum_person_occupancy
and I want the friendly name on that entity.
I use it in notification and automations.
That screenshot contains only one entity and it doesn’t even have a device_class attribute. The template you posted above can’t possibly find this entity.
You said the “template for alarmo have stopped working” which implies it used to work. So what changed in your system recently to may have caused the template to stop working?
The template you posted above, the one that allegedly used to work, isn’t designed to find the friendly_name of that binary_sensor.
It’s difficult to help you because you asked to fix a template that’s designed to find entities you don’t have. Then you asked to find something that the template is also not designed to find.
for alarmo it works because alarmo just store the first sensor that triggers the alarm.
but I think I have to work whit my alarm some more until it’s finished.