#restful command - help with payload

1 messages · Page 1 of 1 (latest)

open owl
#

I’m sooooo tired of battling with the NWS integration in HA. It’s never worked well and is now broken again, so I’d like to bypass it completely and just get the data directly from NWS.

I can get the full forecast I need from this simple service call

https://api.weather.gov/gridpoints/BOI/110,92/forecast

However I’m not sure how I would get the resulting output into Sensor I can then use. I want to extract the very first detailedForecast text from this output at all times.

"periods": [
            {
                "number": 1,
                "name": "Tonight",
                "startTime": "2024-06-23T22:00:00-06:00",
                "endTime": "2024-06-24T06:00:00-06:00",
                "isDaytime": false,
                "temperature": 59,
                "temperatureUnit": "F",
                "temperatureTrend": "",
                "probabilityOfPrecipitation": {
                    "unitCode": "wmoUnit:percent",
                    "value": null

                },
                "windSpeed": "12 mph",
                "windDirection": "NW",
                "icon": "/icons/land/night/skc?size=medium",
                "shortForecast": "Clear",
                "detailedForecast": "Clear, with a low around 59. Northwest wind around 12 mph, with gusts as high as 21 mph."
            },

Questions:

  • how do I create a periodic service call to grab this info, say once per hour?
  • how do I get the results into a sensor
  • I think I need to then create a template sensor to extract the object in question: detailedForecast
open owl
#

I think I add this to configuration.yaml, but unsure how to format the payload?

rest_command:
  detailedForecast:
    url: https://api.weather.gov/gridpoints/BOI/110,92/forecast
    method: GET
    content_type: application/json
    payload: ??

Yes, this works, but I need help with the payload section....