thought I finally had it using this template for my auto-entities in a type: map
filter:
template: >
{%- set ns = namespace(quakes_near=[]) %}
{% set km = states('input_number.quakes_near')|float %}
{% set location = states('input_select.quakes_near') %}
{% for s in states.geo_location|selectattr('attributes.source','eq','usgs_earthquakes_feed')
if distance(s.entity_id,location) < km %}
{% set ns.quakes_near = ns.quakes_near + s.entity_id %}
{% endfor %}
{{ns.quakes_near}}
however, the maps shows, but without any quakes…
in template editor, this error shows: TypeError: can only concatenate list (not "str") to list
but my eyes don’t spot the error, so please have a look for me what is wrong?
this:
{% set km = states('input_number.quakes_near')|float %}
{% set location = states('input_select.quakes_near') %}
{% for s in states.geo_location|selectattr('attributes.source','eq','usgs_earthquakes_feed')
if distance(s.entity_id,location) < km %}
{{- s.entity_id -}}{{',' if not loop.last else ''}}
{% endfor %}
does show the correct entity, and it shows in Map too now, but I am not sure if this produces the correct and expected list, when more entities are to be displayed
EDIT
btw, yes it does