Hello,
I am trying to make a script which you input hour as a field and it would return the forecasted outside temperature.
I am not an expert in HA, I found a template:
I suppose this can me parametic-ized but I could not figure where to put it. I would appreciate if someone could point me the direction.
Thanks up front!
Use a template where you can use the above for ‘state’
For the 18:00 part you have have to refer to the state of a input helper, you can use input text and type in 18:00 there or an input number which you limit between 0 and 23.
Not sure if you progressed but here is some further help so I can close this off
I will not explain how to organise template/sensor/etc. in yaml files (lots of other posts out there)… so for now I will assume you put this in configuration.yaml and restart HA.
The first bit is creating a sensor with hourly forecast values, using an existing (do check if you have that) weather entity weather.forecast_home, with me this is generated through the met.no integration but this could be any …just make sure the name is correct with your situation
The second part is creating a sensor that gets the forecasted value of that first sensor based on an input helper. I create a time-helper called input_datetime.time_for_weather_forecast…again…your choice on how you name this but jsut make sure they match below
In the end you have a sensor.weather_forecast_today_time which you can combine with the input helper to get the forecast at your choice today (!).
That would go either in a YAML for a UI card or a template sensor to make it into an entity for some other purpose. Of course, you need the data to appear as an attribute as @vingerha has shown.