swa72 / home-assistant

13 stars 1 forks source link

Messing with lists #71

Open swa72 opened 2 years ago

swa72 commented 2 years ago
{% set ns = namespace(target_sensors=[],source_sensors=(states.sensor | list)) %}
{% for s in ns.source_sensors %}
  {% if "multi_" in s.entity_id and "temperature" in s.entity_id %}
    {% set ns.target_sensors = ns.target_sensors + [s] %}
  {% endif %}
{% endfor %}
# no change in two hours
{{ ns.target_sensors
   | map(attribute='entity_id') | join(', ') }}