Weather.get_forecasts response to input_text

Hello,

I’m trying to get the response from weather.get_forecasts into a variable or input_text as JSON.

I need this in order to determine the best 5-hour temperature window.
My automation and the corresponding debug output: unfortunately, the entity input_text.wetter_forecast_json remains empty. Maybe someone has a tip for me.

alias: Wetter Forecast Debug
triggers:
  - at: "14:00:00"
    trigger: time
actions:
  - target:
      entity_id: weather.forecast_schenki
    data:
      type: hourly
    response_variable: forecast_response
    action: weather.get_forecasts
  - data:
      title: Wetter Forecast Antwort
      message: >
        {% set forecast = forecast_response["weather.forecast_schenki"] %} {% if
        forecast is defined %}
          {{ forecast }}
        {% else %}
          ⚠️ Keine Forecast-Daten erhalten!
        {% endif %}
    action: persistent_notification.create
  - action: input_text.set_value
    data:
      value: |
        {{ forecast_response | tojson }}
    target:
      entity_id: input_text.wetter_forecast_json
  - action: persistent_notification.create
    data:
      title: Debug
      message: |
        {{ forecast_response | tojson }}
mode: single

Debug

{"weather.forecast_schenki": {"forecast": [{"cloud_coverage": 40.6, "condition": "rainy", "datetime": "2025-07-15T12:00:00+00:00", "humidity": 60, "precipitation": 0.1, "temperature": 21.4, "uv_index": 5.5, "wind_bearing": 267.8, "wind_speed": 18.4}, {"cloud_coverage": 51.6, "condition": "rainy", "datetime": "2025-07-15T13:00:00+00:00", "humidity": 55, "precipitation": 0.1, "temperature": 21.5, "uv_index": 4.7, "wind_bearing": 279.7, "wind_speed": 22.0}, {"cloud_coverage": 80.5, "condition": "partlycloudy", "datetime": "2025-07-15T14:00:00+00:00", "humidity": 56, "precipitation": 0.0, "temperature": 20.3, "uv_index": 3.6, "wind_bearing": 297.7, "wind_speed": 23.4}, {"cloud_coverage": 27.3, "condition": "partlycloudy", "datetime": "2025-07-15T15:00:00+00:00", "humidity": 51, "precipitation": 0.0, "temperature": 20.7, "uv_index": 2.5, "wind_bearing": 290.7, "wind_speed": 17.3}, {"cloud_coverage": 31.2, "condition": "rainy", "datetime": "2025-07-15T16:00:00+00:00", "humidity": 52, "precipitation": 0.1, "temperature": 20.8, "uv_index": 1.4, "wind_bearing": 294.3, "wind_speed": 14.0}, {"cloud_coverage": 68.7, "condition": "rainy", "datetime": "2025-07-15T17:00:00+00:00", "humidity": 54, "precipitation": 0.8, "temperature": 20.0, "uv_index": 0.7, "wind_bearing": 296.5, "wind_speed": 18.7}, {"cloud_coverage": 100.0, "condition": "cloudy", "datetime": "2025-07-15T18:00:00+00:00", "humidity": 78, "precipitation": 0.0, "temperature": 17.2, "uv_index": 0.2, "wind_bearing": 275.0, "wind_speed": 12.6}, {"cloud_coverage": 100.0, "condition": "cloudy", "datetime": "2025-07-15T19:00:00+00:00", "humidity": 81, "precipitation": 0.0, "temperature": 17.1, "uv_index": 0.0, "wind_bearing": 237.0, "wind_speed": 7.2}, {"cloud_coverage": 57.0, "condition": "partlycloudy", "datetime": "2025-07-15T20:00:00+00:00", "humidity": 83, "precipitation": 0.0, "temperature": 16.4, "uv_index": 0.0, "wind_bearing": 267.2, "wind_speed": 9.7}, {"cloud_coverage": 14.8, "condition": "partlycloudy", "datetime": "2025-07-15T21:00:00+00:00", "humidity": 85, "precipitation": 0.0, "temperature": 15.9, "uv_index": 0.0, "wind_bearing": 253.7, "wind_speed": 7.9}, {"cloud_coverage": 71.1, "condition": "partlycloudy", "datetime": "2025-07-15T22:00:00+00:00", "humidity": 90, "precipitation": 0.0, "temperature": 14.8, "uv_index": 0.0, "wind_bearing": 225.4, "wind_speed": 6.1}, {"cloud_coverage": 100.0, "condition": "cloudy", "datetime": "2025-07-15T23:00:00+00:00", "humidity": 85, "precipitation": 0.0, "temperature": 15.5, "uv_index": 0.0, "wind_bearing": 215.4, "wind_speed": 8.6}, {"cloud_coverage": 100.0, "condition": "cloudy", "datetime": "2025-07-16T00:00:00+00:00", "humidity": 81, "precipitation": 0.0, "temperature": 15.9, "uv_index": 0.0, "wind_bearing": 219.2, "wind_speed": 11.9}, {"cloud_coverage": 100.0, "condition": "rainy", "datetime": "2025-07-16T01:00:00+00:00", "humidity": 81, "precipitation": 0.2, "temperature": 15.6, "uv_index": 0.0, "wind_bearing": 232.6, "wind_speed": 11.5}, {"cloud_coverage": 100.0, "condition": "rainy", "datetime": "2025-07-16T02:00:00+00:00", "humidity": 82, "precipitation": 0.8, "temperature": 15.0, "uv_index": 0.0, "wind_bearing": 242.8, "wind_speed": 11.9}, {"cloud_coverage": 99.2, "condition": "rainy", "datetime": "2025-07-16T03:00:00+00:00", "humidity": 87, "precipitation": 0.7, "temperature": 14.4, "uv_index": 0.0, "wind_bearing": 227.8, "wind_speed": 9.4}, {"cloud_coverage": 89.8, "condition": "cloudy", "datetime": "2025-07-16T04:00:00+00:00", "humidity": 89, "precipitation": 0.0, "temperature": 14.3, "uv_index": 0.1, "wind_bearing": 172.4, "wind_speed": 10.4}, {"cloud_coverage": 62.5, "condition": "partlycloudy", "datetime": "2025-07-16T05:00:00+00:00", "humidity": 88, "precipitation": 0.0, "temperature": 14.7, "uv_index": 0.3, "wind_bearing": 201.0, "wind_speed": 12.6}, {"cloud_coverage": 100.0, "condition": "rainy", "datetime": "2025-07-16T06:00:00+00:00", "humidity": 83, "precipitation": 0.5, "temperature": 15.8, "uv_index": 0.9, "wind_bearing": 201.1, "wind_speed": 13.7}, {"cloud_coverage": 100.0, "condition": "rainy", "datetime": "2025-07-16T07:00:00+00:00", "humidity": 84, "precipitation": 0.4, "temperature": 15.0, "uv_index": 1.8, "wind_bearing": 204.6, "wind_speed": 15.5}, {"cloud_coverage": 100.0, "condition": "rainy", "datetime": "2025-07-16T08:00:00+00:00", "humidity": 85, "precipitation": 0.1, "temperature": 14.9, "uv_index": 3.0, "wind_bearing": 193.0, "wind_speed": 13.7}, {"cloud_coverage": 100.0, "condition": "cloudy", "datetime": "2025-07-16T09:00:00+00:00", "humidity": 78, "precipitation": 0.0, "temperature": 16.7, "uv_index": 4.3, "wind_bearing": 197.1, "wind_speed": 11.9}, {"cloud_coverage": 99.2, "condition": "cloudy", "datetime": "2025-07-16T10:00:00+00:00", "humidity": 71, "precipitation": 0.0, "temperature": 18.0, "uv_index": 5.4, "wind_bearing": 225.1, "wind_speed": 9.4}, {"cloud_coverage": 100.0, "condition": "cloudy", "datetime": "2025-07-16T11:00:00+00:00", "humidity": 65, "precipitation": 0.0, "temperature": 18.7, "uv_index": 6.1, "wind_bearing": 268.7, "wind_speed": 6.8}]}}```

Input text can only hold 255 characters.

Thanks for your hint, but I’m a bit confused. I increased the max length value. Does that mean it doesn’t matter how large the max length is if it exceeds 255? See screenshot.
If I limit my output to 250 characters, it works without any issues.

Yes, you can’t save more than 255 in the input text.
You can use a sensors attribute, but that means you need to make a template sensor in yaml.
Or you need to think about what you actually want to save. Perhaps 255 is enough?

Thank you, you’re right. I’ve drastically shortened my output for now. I got stuck at the max value and thought there was a way to increase it further.