And what is the secret sauce to get the twice daily or hourly forecasts now? I’m trying to update my template weather provider to use the NWS forecasts, and nothing I have tried so far gets the forecast into the template weather provider.
Here’s my template weather provider that doesn’t provide the forecast:
- platform: template
name: "My Weather Station"
unique_id: '0a7476cc-d6c1-40ba-8ae1-606518c3497f'
condition_template: "{{ states('weather.kphl_daynight') }}"
temperature_template: "{{ states('sensor.outdoor_temperature') | float(0.0) }}"
temperature_unit: "°F"
dew_point_template: "{{ states('sensor.kphl_dew_point') | float(0.0) }}"
pressure_template: "{{ states('sensor.outdoor_pressure') | float(0.0) }}"
pressure_unit: "inHg"
humidity_template: "{{ states('sensor.outdoor_humidity') | float(0.0) }}"
forecast_twice_daily_template: "{{ state_attr('weather.kphl_daynight', 'forecast') }}"
wind_speed_template: "{{ states('sensor.kphl_wind_speed') | float(0.0) | round(0) }}"
wind_speed_unit: "mph"
wind_bearing_template: "{{ states('sensor.kphl_wind_direction') }}"
and a trigger sensor to get the high and low temperate, which also don’t work because I can’t get the forecast:
- trigger:
- platform: state
entity_id: weather.my_weather_station
action:
- service: weather.get_forecasts
data:
type: twice_daily
target:
entity_id: weather.my_weather_station
response_variable: response
sensor:
- name: Today High
device_class: Temperature
unit_of_measurement: °F
icon: mdi:thermometer-high
state: "{{ response['weather.my_weather_station'].forecast[0].temperature }}"
- name: Today Low
device_class: Temperature
unit_of_measurement: °F
icon: mdi:thermometer-low
state: "{{ response['weather.my_weather_station'].forecast[1].temperature }}"
Here’s the response to the service call to my template weather provider:
service: weather.get_forecasts
data:
type: twice_daily
target:
entity_id: weather.my_weather_station
weather.my_weather_station:
forecast: []
And the same thing if I call the NWS provider:
service: weather.get_forecasts
data:
type: twice_daily
target:
entity_id: weather.kphl_daynight
weather.kphl_daynight:
forecast:
- detailed_description: Sunny, with a high near 64. Southeast wind 5 to 10 mph.
datetime: "2024-04-26T11:00:00-04:00"
precipitation_probability: 0
is_daytime: true
condition: partlycloudy
wind_bearing: 135
temperature: 64
dew_point: 32
wind_speed: 7.5
humidity: 41
- detailed_description: Mostly clear, with a low around 41. Southeast wind 0 to 10 mph.
datetime: "2024-04-26T18:00:00-04:00"
precipitation_probability: 0
is_daytime: false
condition: partlycloudy
wind_bearing: 135
temperature: 41
dew_point: 35
wind_speed: 5
humidity: 79
- detailed_description: Mostly sunny, with a high near 63. Southeast wind 0 to 10 mph.
datetime: "2024-04-27T06:00:00-04:00"
precipitation_probability: 0
is_daytime: true
condition: partlycloudy
wind_bearing: 135
temperature: 63
dew_point: 37
wind_speed: 5
humidity: 79
- detailed_description: >-
A slight chance of rain showers after 2am. Mostly cloudy, with a low
around 49. South wind 5 to 10 mph. Chance of precipitation is 20%.
datetime: "2024-04-27T18:00:00-04:00"
precipitation_probability: 20
is_daytime: false
condition: rainy
wind_bearing: 180
temperature: 49
dew_point: 43
wind_speed: 7.5
humidity: 77
- detailed_description: >-
A slight chance of rain showers before 8am. Partly sunny, with a high
near 79. Southwest wind 5 to 10 mph. Chance of precipitation is 20%.
datetime: "2024-04-28T06:00:00-04:00"
precipitation_probability: 20
is_daytime: true
condition: rainy
wind_bearing: 225
temperature: 79
dew_point: 56
wind_speed: 7.5
humidity: 77
- detailed_description: Partly cloudy, with a low around 60.
datetime: "2024-04-28T18:00:00-04:00"
precipitation_probability: 0
is_daytime: false
condition: partlycloudy
wind_bearing: 270
temperature: 60
dew_point: 59
wind_speed: 7.5
humidity: 93
- detailed_description: Mostly sunny, with a high near 86.
datetime: "2024-04-29T06:00:00-04:00"
precipitation_probability: 0
is_daytime: true
condition: partlycloudy
wind_bearing: 315
temperature: 86
dew_point: 62
wind_speed: 7.5
humidity: 87
- detailed_description: Partly cloudy, with a low around 59.
datetime: "2024-04-29T18:00:00-04:00"
precipitation_probability: 0
is_daytime: false
condition: partlycloudy
wind_bearing: 135
temperature: 59
dew_point: 59
wind_speed: 7.5
humidity: 83
- detailed_description: >-
A chance of showers and thunderstorms after 2pm. Partly sunny, with a
high near 81. Chance of precipitation is 30%.
datetime: "2024-04-30T06:00:00-04:00"
precipitation_probability: 30
is_daytime: true
condition: lightning-rainy
wind_bearing: 135
temperature: 81
dew_point: 58
wind_speed: 7.5
humidity: 84
- detailed_description: >-
A chance of showers and thunderstorms before 2am. Mostly cloudy, with a
low around 61. Chance of precipitation is 40%.
datetime: "2024-04-30T18:00:00-04:00"
precipitation_probability: 40
is_daytime: false
condition: lightning-rainy
wind_bearing: 225
temperature: 61
dew_point: 58
wind_speed: 7.5
humidity: 90
- detailed_description: >-
A slight chance of rain showers after 2pm. Mostly sunny, with a high
near 81.
datetime: "2024-05-01T06:00:00-04:00"
precipitation_probability: 0
is_daytime: true
condition: rainy
wind_bearing: 270
temperature: 81
dew_point: 58
wind_speed: 7.5
humidity: 87
- detailed_description: >-
A slight chance of rain showers before 8pm. Partly cloudy, with a low
around 59.
datetime: "2024-05-01T18:00:00-04:00"
precipitation_probability: 0
is_daytime: false
condition: rainy
wind_bearing: 225
temperature: 59
dew_point: 57
wind_speed: 7.5
humidity: 87
- detailed_description: >-
A slight chance of rain showers after 2pm. Mostly sunny, with a high
near 80.
datetime: "2024-05-02T06:00:00-04:00"
precipitation_probability: 0
is_daytime: true
condition: rainy
wind_bearing: 270
temperature: 80
dew_point: 56
wind_speed: 10
humidity: 81
- detailed_description: >-
A slight chance of rain showers before 8pm, then a slight chance of
showers and thunderstorms. Partly cloudy, with a low around 58.
datetime: "2024-05-02T18:00:00-04:00"
precipitation_probability: 0
is_daytime: false
condition: lightning-rainy
wind_bearing: 270
temperature: 58
dew_point: 52
wind_speed: 10
humidity: 72