I’m trying to create a list of the dark sky sensors within a separate sensor using Jinjga2. The sensors I’m trying to capture are:
sensor.dark_sky_apparent_temperature_0h
sensor.dark_sky_apparent_temperature_1h
...
sensor.dark_sky_apparent_temperature_4h
This is what I’ve written so far, but it is not working. How do I “escape” the variable i so that the output will be as expected?
{% for i in range(5) %}
{{ states('sensor.dark_sky_apparent_temperature_{{i}}h') }}
{% endfor %}