OpenWeatherMap-Alerts-Weather-Driver

I am sorry to bug you, but something is still not right or I might be mistaken. Now when I turn the switch on or off, It is changing the condition_text variable to match the forecast. So when I have switch off it is showing moderate rain, but when I turn it on it changes the condition text to match the forecast. Was that the intended result?

The intent: When the switch is on both the Icon and the text will show the 'Current' conditions. When the switch is off both the Icon and the Text will show the 'Forecast' conditions. This pertains to both the MyTile and the ThreeDayForecastTile.

For both tiles you either get the current day's 'Current' condition as reported by OWM, or you get the current day's 'Forecast' condition as reported by OWM. At this time I do not plan on adding a second option to allow each tile to be set independently.

Yes, the tiles are all good, but the variable outside of the tile is changing when you put the swithc to on or off. For example right now

Current condition is scattered clouds
Forcast is light rain

if I set the switch to off
Current conditon is light rain
forecast is light rain

If this is the intened affect that is fine, I just need to know so I can do my automations correctly.

The text I highlighted is what is changing.

I did not write it to preserve both attributes, so yes, if you select Off (for Forecast) the 'Current Condition' will reflect the forecast that you selected.

1 Like

Thank you very much, I really appreciate all the help.

Found a minor error on line 493
}else if(twb < 56.25) {

should be
}else if(twb < 78.75) {

This has been corrected in the code. Re-import the code or do a Repair in HPM. The version number was not updated.

Thanks @arnb

I have been getting an error since last night.
2022-07-25 09:18:21.134 pm errorjava.lang.IllegalArgumentException: The JSON input text should neither be null nor empty. on line 1296 (method pollOWMHandler)

From the detailed logging:
OpenWeatherMap Data: [current:[sunrise:1658744216, temp:79.88, visibility:10000, uvi:0, pressure:1016, clouds:100, feels_like:79.88, wind_gust:15.64, dt:1658798297, wind_deg:245, dew_point:67.06, sunset:1658795200, weather:[[icon:04n, description:overcast clouds, main:Clouds, id:804]], humidity:65, wind_speed:5.82], timezone:America/New_York, timezone_offset:-14400, daily:[[moonset:1658788620, rain:0.24, sunrise:1658744216, temp:[min:70.86, max:94.05, eve:82.56, night:77.7, day:93.4, morn:71.82], moon_phase:0.91, uvi:9.54, moonrise:1658733420, pressure:1017, clouds:75, feels_like:[eve:85.46, night:78.66, day:96.58, morn:72.97], wind_gust:25.14, dt:1658768400, pop:0.92, wind_deg:219, dew_point:66.69, sunset:1658795200, weather:[[icon:10d, description:light rain, main:Rain, id:500]], humidity:41, wind_speed:12.01], [moonset:1658878080, rain:12.83, sunrise:1658830662, temp:[min:71.92, max:94.05, eve:76.17, night:73.04, day:82.44, morn:72.21], moon_phase:0.94, uvi:8.29, moonrise:1658822640, pressure:1018, clouds:98, feels_like:[eve:77.58, night:74.55, day:86.79, morn:73.69], wind_gust:21.83, dt:1658854800, pop:1, wind_deg:224, dew_point:70.84, sunset:1658881556, weather:[[icon:10d, description:moderate rain, main:Rain, id:501]], humidity:68, wind_speed:11.83], [moonset:1658967120, rain:3.09, sunrise:1658917109, temp:[min:71.85, max:94.01, eve:78.42, night:75.87, day:90.34, morn:72.59], moon_phase:0.97, uvi:7.64, moonrise:1658912220, pressure:1016, clouds:88, feels_like:[eve:79.45, night:77.05, day:95.23, morn:74.01], wind_gust:22.03, dt:1658941200, pop:0.96, wind_deg:313, dew_point:68.99, sunset:1658967909, weather:[[icon:10d, description:moderate rain, main:Rain, id:501]], humidity:50, wind_speed:11.74], [moonset:1659055860, rain:1.84, sunrise:1659003556, temp:[min:71.73, max:97.05, eve:78.48, night:75.7, day:95.43, morn:72.91], moon_phase:0, uvi:9.95, moonrise:1659002100, pressure:1015, clouds:48, feels_like:[eve:79.79, night:76.64, day:100.36, morn:74.14], wind_gust:21.7, dt:1659027600, pop:0.72, wind_deg:270, dew_point:67.93, sunset:1659054262, weather:[[icon:10d, description:light rain, main:Rain, id:500]], humidity:41, wind_speed:8.05], [moonset:1659144300, rain:4.75, sunrise:1659090003, temp:[min:72.14, max:98.96, eve:81.23, night:76.24, day:98.96, morn:77.74], moon_phase:0.03, uvi:9.57, moonrise:1659092040, pressure:1013, clouds:28, feels_like:[eve:85.21, night:77.79, day:101.68, morn:78.78], wind_gust:19.33, dt:1659114000, pop:0.65, wind_deg:254, dew_point:64.44, sunset:1659140613, weather:[[icon:10d, description:moderate rain, main:Rain, id:501]], humidity:32, wind_speed:10.92], [moonset:1659232440, rain:6.32, sunrise:1659176450, temp:[min:70.47, max:94.14, eve:77.92, night:70.47, day:94.14, morn:74.86], moon_phase:0.06, uvi:0.75, moonrise:1659182100, pressure:1019, clouds:25, feels_like:[eve:79.12, night:71.73, day:98.44, morn:76.05], wind_gust:10.92, dt:1659200400, pop:1, wind_deg:22, dew_point:68.04, sunset:1659226963, weather:[[icon:10d, description:moderate rain, main:Rain, id:501]], humidity:42, wind_speed:5.64], [moonset:1659320460, rain:15.72, sunrise:1659262898, temp:[min:69.21, max:86.09, eve:74.5, night:70.16, day:83.59, morn:72.09], moon_phase:0.09, uvi:1, moonrise:1659272100, pressure:1022, clouds:100, feels_like:[eve:75.97, night:71.44, day:88.16, morn:73.45], wind_gust:17.9, dt:1659286800, pop:1, wind_deg:215, dew_point:70.56, sunset:1659313311, weather:[[icon:10d, description:moderate rain, main:Rain, id:501]], humidity:65, wind_speed:7], [moonset:1659408360, rain:1.95, sunrise:1659349346, temp:[min:69.35, max:89.28, eve:80.51, night:74.52, day:89.28, morn:71.94], moon_phase:0.12, uvi:1, moonrise:1659362100, pressure:1019, clouds:92, feels_like:[eve:83.64, night:75.61, day:92.44, morn:73.2], wind_gust:14.7, dt:1659373200, pop:0.99, wind_deg:249, dew_point:66.97, sunset:1659399657, weather:[[icon:10d, description:light rain, main:Rain, id:500]], humidity:48, wind_speed:8.43]], lon:-78.859, lat:36.1321]

Update: I tried to repair in HPM, it had a weird error about the manifest. I removed it entirely and re-created it and now it is updating the time again (It still is reporting that it isn't getting sunrise/sunset data, but no errors )

I'm getting the error now too. I don't use HPM. What did you remove and recreate - the device with the driver attached or the driver code?

[UPDATED] V0.5.8 07/26/2022

  • Improved Fallback to hub location defaults and estimates for Sunrise-Sunset.org poll failure.

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.