that worked from the UI, without setting the end date. I still had to set the start date, which I think make sense. however it didnât work from assist. I tried both âWhats the weather for Wednesdayâ and âWhats the forecast for Wednesdayâ. Neither are triggering the script. Aside from exposing it, is there something else that I need to be doing for it?
EDIT: I may have gotten it working somehow. I randomly asked Assist to âturn on the forecastâ (forecast is the alias I gave the script). Now it returns answers when I asked it, whats the forecast [for X day, tomorrow, etc.]
EDIT 2: Nope, as soon as I end the Assist conversation and restart it, it no longer triggers the script
description: >-
Liefert die Wettervorhersage entweder fĂźr einen Teil eines Tages oder fĂźr
einen oder mehrere ganze Tage. Falls das Wetter fĂźr das Wochenende angefordert
wird, bedeutet dies Samstag und Sonntag.
and these fields translated in German:
fields:
start_of_period:
selector:
datetime: null
name: Start of period
description: >-
Beginn des Zeitraums, fĂźr den das Wetter angefordert wird. Benutze eine
isoformat datetime Zeichenfolge.
required: true
end_of_period:
selector:
datetime: null
name: End of period
description: >-
Ende des Zeitraums, fĂźr den das Wetter angefordert wird. Benutze eine
isoformat datetime Zeichenfolge.
required: true
Maybe try to remove the script and create it again (do a HA core restart in between just to make sure). make sure to not change any name/entity_id before testing. It might be that that messes stuff up.
Hmm tried that to no avail. Something weird is going on because I canât even save the script from the Blueprint. It has to be added manually. Must be something with my setup/docker. Because I tried other script blueprints and those donât save either
With some minor changes i removed the uv_index, humidity, wind_bearing.
{% for item in
weather_data[0].keys()
| reject('eq', 'datetime')
| reject('eq', 'wind_bearing')
| reject('eq', 'humidity')
| reject('eq', 'uv_index')%}
Result looks a bit more compact like this:
How can i now tell the LLM to approximate the wind-speed? I just want to know if it has high winds if needed. Iâve tried modifiying the description, but this doesnât seem to change anything.
Or should i directly program this into the above codesnippet response?
You can put it in the configuration of the integration itself.
Something like. If weather forecasts are requested, only mention wind speed if there are high winds (above xx km/h)
{% for item in
weather_data[0].keys()
| reject('in', ['datetime', 'wind_bearing', 'humidity', 'uv_index'])%}
BTW, for me it never mentions stuff like this, it always ignores this in the response. Bu it will reduce the data sent to the LLM, and with that the token usage, so thatâs still an advantage
The script uses a weather entity, and gets the the data from that entity. If you have a weather integration for a specific city, you can use that entity, and add in the script description that it should be used only for that specific city.
Thanks for doing this! I have setup the script from the Blueprint several times. I have named the scrip the same as you did and given it the same description. I have exposed it to Assist. It runs correctly in Developer, Actions. I am running Ollam 3.2, locally. It never calls the script. I canât figure out what I am doing wrong.
I didnât. My plan is to use the new VPE with Whisper/Piper/Rhasspy for home control and local Ollama for general knowledge queries. I am running the latest 2025.1.2 that supports local fallback. When I ask Assist a general knowledge question that it should fallback to Ollama it doesnât fall back. Two different issues it appears. When the weather is failing I am asking Ollama directly since fallback doesnât work. I canât imagine what i am doing wrong. Thanks!
Thanks! That makes sense although it doesnât appear it will work with my intended design. Not anything wrong with what you have coded, of course. I changed the Ollama integration configuration to all control. Now this error is logged: Logger: homeassistant.components.script.fetch_weather_forecast_data
Source: helpers/script.py:2032
integration: Script (documentation, issues)
First occurred: 3:39:55 PM (1 occurrences)
Last logged: 3:39:55 PM
fetch_weather_forecast_data: Error executing script. Error rendering template for variables at pos 3: UndefinedError: list object has no element 0