Trying to understand the US NWS (National Weather Service) integration's detailed_description

I’m trying to find a weather service that provides a descriptive forecast for day - night - tomorrow.

I discovered this is available in the NWS integration, but I can’t seem to deduce at what time these keys are correct.

I thought {state_attr("weather.knak_daynight","forecast")[0].detailed_description}} would give me 'Todays (day) forecast.

Additionally I thought {state_attr("weather.knak_daynight","forecast")[1].detailed_description}} would give me Tonights (night) forecast

and finally {state_attr("weather.knak_daynight","forecast")[2].detailed_description}} would provide Tomorrows forecast.

The forecast don’t seem like they are in line with the key for the time of day I check. Either I have the statements wrong or I can’t find the proper time to send the message.

Here is an example:

The forecasts are twice a day. The timestamp is the starting time at which the forecast is valid. Therefore if a day had forecasts at 6AM and 6PM, the forecast at 6AM is valid for 6AM to 6PM.

During the day, the first forecast is a daytime forecast. During the night, the first forecast is a nighttime forecast. Therefore, tomorrow’s day forecast is either the 2nd or 3rd entry in the forecast, and so on…

There is also a daytime attribute for each forecast entry that can help set up the logic you want.

1 Like

Thank You! That helps a lot.