Leaving aside the TERRIBLE way we have to now use weather objects, I’ve made the switch from NWS to Accuweather. There’s a way in NWS to get a twice a day forecast that contains a textual description of what it’s like or going to be like outside. This proves more useful on wall displays that have other components.
I am using NWS and it is unfortunate that the detailedForecast was removed. It would be great to have it return in some fashion. I am experimenting with a configuration.yaml for a rest sensor that will get the NWS forecast. I can then have home assistant get the values for period.name and period.detailedForecast then speak them to my audio devices for my morning report.
The state attributes would look something like this in HA.
periods:
- number: 1
name: Tonight
startTime: "2024-04-22T18:00:00-04:00"
endTime: "2024-04-23T06:00:00-04:00"
isDaytime: false
temperature: 50
temperatureUnit: F
temperatureTrend: rising
probabilityOfPrecipitation:
unitCode: wmoUnit:percent
value: 30
dewpoint:
unitCode: wmoUnit:degC
value: 1.6666666666666667
relativeHumidity:
unitCode: wmoUnit:percent
value: 53
windSpeed: 9 to 14 mph
windDirection: SSW
icon: https://api.weather.gov/icons/land/night/bkn/rain_showers,30?size=medium
shortForecast: Mostly Cloudy then Chance Rain Showers
detailedForecast: >-
A chance of rain showers after 4am. Mostly cloudy. Low around 50, with
temperatures rising to around 52 overnight. South southwest wind 9 to 14
mph, with gusts as high as 24 mph. Chance of precipitation is 30%. New
rainfall amounts less than a tenth of an inch possible.
- number: 2
name: Tuesday
startTime: "2024-04-23T06:00:00-04:00"
endTime: "2024-04-23T18:00:00-04:00"
isDaytime: true
temperature: 64
temperatureUnit: F
temperatureTrend: falling
probabilityOfPrecipitation:
unitCode: wmoUnit:percent
value: 60
dewpoint:
unitCode: wmoUnit:degC
value: 7.222222222222222
relativeHumidity:
unitCode: wmoUnit:percent
value: 57
windSpeed: 15 to 20 mph
windDirection: SW
icon: https://api.weather.gov/icons/land/day/rain_showers,50/tsra,60?size=medium
shortForecast: Showers And Thunderstorms Likely
detailedForecast: >-
A chance of rain showers before 5pm, then showers and thunderstorms
likely. Cloudy. High near 64, with temperatures falling to around 61 in
the afternoon. Southwest wind 15 to 20 mph, with gusts as high as 31 mph.
Chance of precipitation is 60%. New rainfall amounts between a tenth and
quarter of an inch possible.
I like the detailed nature off the NWS forecasts. I finally got the info out of NWS using the new methods. Unfortunately to use daily forecasts I had to use AccuWeather as NWS doesn’t support it, and even then I only get 5 days.
Thanks. This is all good information. It’s helping me learn how to get information off the NWS API.
Question: How can I pull the name field off the NWS api, similar to condition or temperature ? I’m wanting name so that I can display, for example, ‘Tonight’ or ‘Tuesday Night’ in a twice a day forecast. I see name listed in the api, but nothing is getting pulled.
Jeff,
Thanks for the quick response. In your NWS “Detailed Forecast” card (above), how are you able to get to get the column entries “Tonight”, “Wednesday “, Wednesday Night”, etc ?
name: in the API has these, but I’m not able get this field to populate in my sensor attributes. Could it be called something else? I am able to get the detailed_description.
If this isn’t clear, I can post my sensor code later when I get home.
Maybe it’s because of the integration issue you mentioned.