OpenWeatherMap-Alerts-Weather-Driver

The Sunrise-Sunset.org poll is failing again (their site has issues). I just released updated code to do a better job at estimating the required information from the hub location when this poll fails (which seem to happen more often lately???). If using HPM, do an update or a repair. Otherwise, re-import the code.

Thanks.

1 Like

[UPDATED] V0.5.9 07/28/2022

1 Like

New to HE and just found your driver. I thought I signed up properly - my API key works on the sample URL, I installed the OWM-Alerts-Weather-Driver from PM, created virtual device using that DD and input my key.

I don't get any attributes updating, and i see these errors in the logs:

Interestingly, the current site seems to advertise onecall v 3.0 whereas the calls the driver is making are v2.5. Did something recently change on the OWM side?
Any help???

First I have seen this. From the OWM website is appears that may have removed the ability to get a legacy (2.5) API key. I only saw the ability to 'subscribe' to the new 3.0 key and only if you enter payment info.

I am still getting data without errors, so the current driver does work with a 2.5 API Key. I did a quick test and changed the code to poll the 3.0 API with my 2.5 API Key and got the same 'unauthorized' you saw. That tells me an old 2.5 API key does not work on the 3.0 API platform and from your results it does not look like a 3.0 API key will work on the 2.5 API platform.

You could do as I did in my test and do a global search and replace in the driver code for 'api.openweathermap.org/data/2.5/' and replace that with 'api.openweathermap.org/data/3.0/' and see if that allows your 3.0 API Key to retrieve data. If that does work I may have to provide a way to indicate in the driver which API version your key is for and then use the appropriate URL for the version. Let me know if are able to make that change and do the test.

Thanks.

1 Like

Thanks for the quick response. There is a truly “FREE” option - which I signed up for that offers a very limited capability thru a non-Onecall api. That KEY does not work with either the 2.5 or 3.0 apis.

I will try signing up for the 3.0 service that includes 1000 free but requires credit card to see if I can get it to work by editing the urls in the driver code from 2.5 to 3.0 ( as you suggested ) and post results.

1 Like

@Matthew, good evening, just a quick question the local Sunrise Sunset Is not function, is this due to the problems stemming from sunrise-sunset.org. The 3 day tile sunset/sunrise is correct but the local sunRise sunSet hasn’t changed in quiet awhile.

Dan

I don't have that optional attribute turn on. Do you?
image

Morning Matthew, I did have it on so I turned it off, did a new poll and a refresh, still no change though.

I may have added some confusion. If you want Local SunRise and SunSet to update that selection must be 'on'. I stated that mine do not update because I have that switch turned 'off'. If you have it 'On' and they are not updating then something is wrong.

Are you certain they are not updating? In general the times should only change once per day and only by a minute of two. Thanks.

I am also noticing an issue re sr/ss, the sunset sunrise times are appearing as 'null' on the mytile attribute. Is this something I am doing wrong?

image

[UPDATED 08/20/2022 V0.6.0]

  • More corrections to sunrise/sunset data when when there is a Sunrise-Sunset.org failure.

If using HPM Update or do a repair. Otherwise open the driver code and re-import from the Github source.

1 Like

Thank you

1 Like

@Matthew, hey Mathew things are looking really good thanks so much for making the repars, love this driver😁

Dan

1 Like

So this driver in its current stat is no longer working for newly registered OW users if we don't pay for their subscription.

Jas anyone got this to work with the new api keys?

I’m receiving the below errors after this update. I haven’t modified anything, but is there something I need to adjust? Thanks!

dev:5192022-08-22 09:37:32.645 errorjava.lang.NullPointerException: null on line 1002 (method pollOWMHandler)
dev:5192022-08-22 09:37:10.095 errorjava.lang.NullPointerException: null on line 1002 (method updateLux)

I'm not seeing any errors on my setup? Suggest you open the driver and click 'Save Preferences'. If the errors continue, suggest a reboot. Let me know if that does not clear the errors and I'll investigate further. Thanks.

Tried Saving Preferences, and when that didn’t work rebooted my hub. I’m still receiving the errors. Appreciate any help you can provide. LMK if you need any additional info from me.

I'm also getting that:
image

When I manually click Refresh, I get the same error at 1002, but with method refresh. I saved the preferences and also rebooted. I still get the error.

I looked at the code

I turned on extended logging and turned off Local SunRise and SunSet to skip this block of code. I didn't get the same error, but instead I got an error in the next block of code:
image

Just to check the values, I copied the logging line for dumping sunRiseSet to line 1000 and refreshed it again:

sunrise:2022-08-22T09:59:27+00:00

@Matthew Does that "+00:00" for the timezone offset work with the "XXX" in the format string?

What I am not understanding is why it is even hitting that block of code (line 998-1020) at all? If Sunrise-Sunset.org poll fails (and it is currently failing) then it would go to lines 1021-1045 (the 'Else' part of that If Then Else block). I am not seeing this behavior on my end and it is acting as I expect it to. I have no errors. I'll keep looking when I get time .... but I don't see any errors on my system and I cannot recreate what you are seeing?

I don't see the poll of sunrise-sunset.org failing. It looks to succeed just fine.

It just seems like the parse of the resulting string is failing.