A question I have is how does the script know which IA to use? It worked great with OpenAI and when I switched to Gemini, it doesn’t. The response it that it does not have access to the data source. I imported the blueprint again and deleted the first script.
reworked how the LLM determines the start and end of the period. It now sets a date and time separately, and then the time period (e.g. 1 day, or 6 hours)
Added all the descriptions of the fields used in the script to the blueprint settings, to allow you to change these when setting up the blueprint
use a datetime comparison instead of a string comparison when grabbing the right items out of the total forecast, to avoid taking the wrong period when the forecast datetimes are in UTC
I updated to the new blueprint and am getting errors.
Logger: homeassistant.helpers.template
Source: helpers/template.py:2758
First occurred: 2:39:04 PM (1 occurrences)
Last logged: 2:39:04 PM
Template variable warning: ‘start_time’ is undefined when rendering ‘{{ ((start_date ~ ’ ’ ~ start_time) | as_datetime | as_local).isoformat() }}’
Logger: homeassistant.components.script.fetch_weather_forecast_data
Source: helpers/script.py:2041
integration: Script (documentation, issues)
First occurred: 2:29:19 PM (7 occurrences)
Last logged: 2:47:18 PM
fetch_weather_forecast_data: Error executing script. Error rendering template for variables at pos 1: TypeError: unsupported type for timedelta days component: str
fetch_weather_forecast_data: Error executing script. Error rendering template for variables at pos 1: AttributeError: ‘NoneType’ object has no attribute ‘tzinfo’
When this happened, the LLM halucinated and ran a different script for night (turn the lights of, the heat down, etc. You can see in the logs that it was the LLM. I’ve disabled HA control in the LLM for now.
It shouldn’t hallucinate toggling devices when a script fails. I really doubt if the script failing caused that. Anyway, I built in a check if are fields are set correct by the LLM in v2.1
Great. Thanks! Do I need to setup the script again after pulling the new BP?
Edit: I just set the script up again to be safe. Now it doesn’t appear to understand location.
Can you give me the trace? It probably made the same error and didn’t provide one of the required fields and decided for itself that it’s caused by a missing location