I just need the top result from this template?
{% for sensor in states.sensor |
selectattr('entity_id','in',integration_entities('alexa_media')) |
rejectattr('state', "search", "unknown" ) |
rejectattr('state', "search", "unavailable" ) |
sort(attribute='state') |
map(attribute='entity_id') -%}
{{ sensor }},
{%- endfor %}
currently gives me
sensor.living_room_echo_next_reminder,sensor.bedroom_echo_next_alarm,sensor.living_room_echo_next_alarm,
I just need the first one in the array.