Hi all, I could use some help here. This script is returning nothing in the response variable. I tested the template and it runs fine. But when I run the script I get nothing in the response.
alias: Generate Hourly Forecast
mode: single
variables:
hourly: |
{% set hours = state_attr('sensor.weather_forecast_hourly', 'hourly') %}
{% set ns = namespace(result=[]) %}
{% for h in hours[:12] %}
{% set ns.result = ns.result + [{
"time": (h.timestamp | as_timestamp | timestamp_custom('%H:%M')),
"temperature": h.temperature,
"condition": h.condition,
"pop": h.precip_probability,
"wind": h.wind_speed ~ ' km/h ' ~ h.wind_direction,
"windchill": h.windchill
}] %}
{% endfor %}
{{ ns.result }}
sequence:
- stop: All Done
response_variable: hourly