Hi,
Apologies in advance for the very basic question, but I’m trying to learn a bit more about scripting.
I have the following:
- variables:
forecast: null
- action: weather.get_forecasts
metadata: {}
data:
type: daily
response_variable: forecasts
target:
entity_id: weather.openweathermap
If I write forecasts to the log I see:
weather.openweathermap:
forecast:
- datetime: '2025-10-11T11:00:00+00:00'
I wanted to loop over the forecasts with:
{% for forecast in forecasts %}
But this doesn’t work.
So I tried e.g. forecasts.weather.openweathermap
But then I get:
Error rendering data template: UndefinedError: 'dict object' has no attribute 'weather'
So I’m actually wondering if this is a string? If so, how can I tell?
Edit: Okay, I realised something and this now works:
{% for forecast in forecasts["weather.openweathermap"].forecast %}
{{forecast}}
{% endfor %}
But my question still stands - how is the best way to debug this without re-running the script over and over again? How can I tell the type of a variable?