Yet Another Weather Driver (but for Edge!)

Have you looked into incorporating the lightning data from the Tempest API?

It’s one of those things I used through IFTTT and I would love it if I could create routines based on lightning nearby. I didn’t see any mention of lightning data in the thread

Worked for about a month and a half then suddenly stopped a week ago taking data from api.weather.com. I collected debug data from edgebridge and it reported the following data for the current weather from my PWS:

{“observations”:[{“stationID”:“XXXXXXXXXXXX”,“obsTimeUtc”:“2024-11-29T03:04:44Z”,“obsTimeLocal”:“2024-11-28 22:04:44”,“neighborhood”:“XXXXXXXX”,“softwareType”:null,“country”:“US”,“solarRadiation”:null,“lon”:-81.371,“realtimeFrequency”:null,“epoch”:1732849484,“lat”:28.542,“uv”:null,“winddir”:23,“humidity”:85,“qcStatus”:0,“imperial”:{“temp”:71,“heatIndex”:72,“dewpt”:67,“windChill”:71,“windSpeed”:0,“windGust”:0,“pressure”:29.88,“precipRate”:0.00,“precipTotal”:0.00,“elev”:103}}]}

and for the future weather:

{“calendarDayTemperatureMax”:[81,72,68,70,66,64],“calendarDayTemperatureMin”:[56,54,48,51,46,42],“dayOfWeek”:[“Thursday”,“Friday”,“Saturday”,“Sunday”,“Monday”,“Tuesday”],“expirationTimeUtc”:[1732850389,1732850389,1732850389,1732850389,1732850389,1732850389],“moonPhase”:[“Waning Crescent”,“Waning Crescent”,“New Moon”,“New Moon”,“Waxing Crescent”,“Waxing Crescent”],“moonPhaseCode”:[“WNC”,“WNC”,“N”,“N”,“WXC”,“WXC”],“moonPhaseDay”:[27,28,29,0,1,2],“moonriseTimeLocal”:[“2024-11-28T04:35:22-0500”,“2024-11-29T05:31:05-0500”,“2024-11-30T06:29:59-0500”,“2024-12-01T07:29:10-0500”,“2024-12-02T08:28:33-0500”,“2024-12-03T09:23:45-0500”],“moonriseTimeUtc”:[1732786522,1732876265,1732966199,1733056150,1733146113,1733235825],“moonsetTimeLocal”:[“2024-11-28T15:38:41-0500”,“2024-11-29T16:13:18-0500”,“2024-11-30T16:53:03-0500”,“2024-12-01T17:39:10-0500”,“2024-12-02T18:32:59-0500”,“2024-12-03T19:31:51-0500”],“moonsetTimeUtc”:[1732826321,1732914798,1733003583,1733092750,1733182379,1733272311],“narrative”:[“Mainly clear. Lows overnight in the mid 60s.”,“A few thunderstorms possible. Highs in the low 70s and lows in the upper 40s.”,“Partly cloudy. Highs in the upper 60s and lows in the low 50s.”,“A few clouds. Highs in the low 70s and lows in the mid 40s.”,“Abundant sunshine. Highs in the mid 60s and lows in the low 40s.”,“Sunshine. Highs in the mid 60s and lows in the low 40s.”],“qpf”:[0.0,0.22,0.0,0.0,0.0,0.0],“qpfSnow”:[0.0,0.0,0.0,0.0,0.0,0.0],“sunriseTimeLocal”:[“2024-11-28T06:58:42-0500”,“2024-11-29T06:59:28-0500”,“2024-11-30T07:00:13-0500”,“2024-12-01T07:00:58-0500”,“2024-12-02T07:01:43-0500”,“2024-12-03T07:02:27-0500”],“sunriseTimeUtc”:[1732795122,1732881568,1732968013,1733054458,1733140903,1733227347],“sunsetTimeLocal”:[“2024-11-28T17:28:06-0500”,“2024-11-29T17:28:02-0500”,“2024-11-30T17:28:00-0500”,“2024-12-01T17:28:00-0500”,“2024-12-02T17:28:01-0500”,“2024-12-03T17:28:04-0500”],“sunsetTimeUtc”:[1732832886,1732919282,1733005680,1733092080,1733178481,1733264884],“temperatureMax”:[null,72,68,70,66,64],“temperatureMin”:[65,48,51,46,42,43],“validTimeLocal”:[“2024-11-28T07:00:00-0500”,“2024-11-29T07:00:00-0500”,“2024-11-30T07:00:00-0500”,“2024-12-01T07:00:00-0500”,“2024-12-02T07:00:00-0500”,“2024-12-03T07:00:00-0500”],“validTimeUtc”:[1732795200,1732881600,1732968000,1733054400,1733140800,1733227200],“daypart”:[{“cloudCover”:[null,39,90,54,46,45,26,24,4,3,3,8],“dayOrNight”:[null,“N”,“D”,“N”,“D”,“N”,“D”,“N”,“D”,“N”,“D”,“N”],“daypartName”:[null,“Tonight”,“Tomorrow”,“Tomorrow night”,“Saturday”,“Saturday night”,“Sunday”,“Sunday night”,“Monday”,“Monday night”,“Tuesday”,“Tuesday night”],“iconCode”:[null,33,38,29,30,29,34,29,32,31,32,31],“iconCodeExtend”:[null,3300,3800,2900,3000,2900,3400,2900,3200,3100,3200,3100],“narrative”:[null,“A few passing clouds. Areas of patchy fog. Low near 65F. Winds light and variable.”,“Scattered thunderstorms. Areas of patchy fog. High 72F. Winds NNW at 10 to 15 mph. Chance of rain 60%.”,“Partly cloudy skies. Low 48F. Winds N at 5 to 10 mph.”,“Sunshine and clouds mixed. High 68F. Winds N at 10 to 15 mph.”,“Partly cloudy skies. Low 51F. Winds N at 5 to 10 mph.”,“Mostly sunny skies. High around 70F. Winds N at 5 to 10 mph.”,“Partly cloudy. Low 46F. Winds NNW at 5 to 10 mph.”,“A mainly sunny sky. High 66F. Winds N at 10 to 15 mph.”,“Clear skies. Low 42F. Winds NNW at 5 to 10 mph.”,“Mainly sunny. High 64F. Winds N at 5 to 10 mph.”,“A mostly clear sky. Cold. Low 43F. Winds N at 5 to 10 mph.”],“precipChance”:[null,9,58,21,3,12,5,8,1,2,1,3],“precipType”:[null,“rain”,“rain”,“rain”,“rain”,“rain”,“rain”,“rain”,“rain”,“rain”,“rain”,“rain”],“qpf”:[null,0.0,0.22,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0],“qpfSnow”:[null,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0],“qualifierCode”:[null,“Q902”,“Q902”,null,null,null,null,null,null,null,null,“Q700”],“qualifierPhrase”:[null,“Areas of patchy fog.”,“Areas of patchy fog.”,null,null,null,null,null,null,null,null,“Cold.”],“relativeHumidity”:[null,88,82,77,59,76,56,66,41,57,44,68],“snowRange”:[null,“”,“”,“”,“”,“”,“”,“”,“”,“”,“”,“”],“temperature”:[null,65,72,48,68,51,70,46,66,42,64,43],“temperatureHeatIndex”:[null,68,73,61,68,60,70,60,66,55,64,54],“temperatureWindChill”:[null,65,63,46,46,50,49,45,44,40,39,41],“thunderCategory”:[null,“No thunder”,“Thunder expected”,“No thunder”,“No thunder”,“No thunder”,“No thunder”,“No thunder”,“No thunder”,“No thunder”,“No thunder”,“No thunder”],“thunderIndex”:[null,0,2,0,0,0,0,0,0,0,0,0],“uvDescription”:[null,“Low”,“Low”,“Low”,“Moderate”,“Low”,“Moderate”,“Low”,“Moderate”,“Low”,“Moderate”,“Low”],“uvIndex”:[null,0,2,0,4,0,4,0,4,0,4,0],“windDirection”:[null,252,341,349,11,350,354,346,351,343,356,350],“windDirectionCardinal”:[null,“WSW”,“NNW”,“N”,“N”,“N”,“N”,“NNW”,“N”,“NNW”,“N”,“N”],“windPhrase”:[null,“Winds light and variable.”,“Winds NNW at 10 to 15 mph.”,“Winds N at 5 to 10 mph.”,“Winds N at 10 to 15 mph.”,“Winds N at 5 to 10 mph.”,“Winds N at 5 to 10 mph.”,“Winds NNW at 5 to 10 mph.”,“Winds N at 10 to 15 mph.”,“Winds NNW at 5 to 10 mph.”,“Winds N at 5 to 10 mph.”,“Winds N at 5 to 10 mph.”],“windSpeed”:[null,5,11,10,11,9,9,7,11,7,9,7],“wxPhraseLong”:[null,“Mostly Clear”,“Scattered Thunderstorms”,“Partly Cloudy”,“Partly Cloudy”,“Partly Cloudy”,“Mostly Sunny”,“Partly Cloudy”,“Sunny”,“Clear”,“Sunny”,“Clear”],“wxPhraseShort”:[null,“M Clear”,“Sct T-Storms”,“P Cloudy”,“P Cloudy”,“P Cloudy”,“M Sunny”,“P Cloudy”,“Sunny”,“Clear”,“Sunny”,“Clear”]}]

Update Dec 1 8:15am, the PWS got through once, and now we are stuck on another set of values. The predicted weather remains with content from Nov 21st. Assumption: need to look at the data parser for the edge driver.

I know you posted this over two years ago but I was wondering if you ever completed your local implementation of an Edge driver for the GW1000/GW1100 series gateways. I would be willing to help test. Thanks.

@TAustin I’ve started getting the following error since the early hours of 12/03:

2025-12-04T23:06:24.021219855Z ERROR Edge Weather V1 driver thread encountered error: [string "common.lua"]:123: attempt to perform arithmetic on a nil value (local 'speed')

I am using the Tempest API. I have full logs if you are able to look at this.

I don’t think the Tempest API has changed recently and I have not made any changes to the calls.

Probably no data being returned for windspeed for some reason. However it shouldn’t be causing an error like this. I’ll fix.

1 Like

I have determined the root cause of this. This time of year, my Tempest relies on battery backup a lot. The backup batteries had died and the Tempest was conserving power and not reporting certain values as a result.

1 Like

I’ve updated the driver to add some guards to address the empty data issue. It should automatically update on your hub. If data such as wind, precip, or pressure is missing it now just gets set to 0.

Let me know if you have any more problems.

2 Likes

Thank you.

EdgeWeather stopped updating automatically every 5 minutes as set, on Dec 14th, due to the update of the driver as I have confirmed. I can manually update by pulling down on the Smartthings screen. I have rebooted SmartThings, edgebridge on my internal server, my Router and my Internet Modem to no avail, and even changed the sampling period to 6 minutes to impose a change in the parameters, the periodic automatic polling updates no longer occur. The edgebridge log confirms that the only requests are my manually initiated ones from the SmartThings application.

Working fine for me.

You realize that ‘works for me’ is a developer siren call to dig deeper. Any suggestions for data collection that could aid in diagnosing this problem? And recognize the corner case could be an existing bug, like a version change and not necessarily the recent code change itself.

BTW I am going on the assumption that I am of the few with this problem and that EdgeWeather has shown some fragility, that sometimes clears itself over time on its own. I am not using any third party service to trigger a refresh. Could polling be off because the last poll is some date in the future as a result of the version change? I switched polling to every 15 minutes from 6 (and before 5 as noted above) just to save oarms yet again.

Good news. After 12 days of not automatically updating, and after 3 days of poking it with a stick once I noticed it, selecting 15 minutes to update the parameters, has been picking up consistently and automatically for the past 2 hours. Now I wish I knew why …