Kodi Community Forum

Full Version: OzWeather - Australian Weather Addon using BOM data inc. animated radar support
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
(2021-06-01, 04:15)bossanova808 Wrote: [ -> ]Yep I think I am already protected against the Fire & UV - those will show None if no value is given for them, and to me that's fine if we're at the point they no longer apply to the current day.

The max looks ok in your screenshot though?  And the low should be fixed by this, I believe.

The max is ok - but it was before 10 so probably not n/a at that time. I agree that the fire and UV are unimportant then...
Is there a new test? The dropbox still seems to have 1.9.92 (not sure where 1.1.93 went..)
Ok, latest test version is here: https://www.dropbox.com/s/s4rza68v3hkmv8...4.zip?dl=0 - with the fixes for the min temp issue above.

Also now reports times (Sunrise, sunset etc) - in the local time for the currently being viewed location (as opposed to local time of the system). 
Now has sun protection warning info in the extended forecast, if there is a current recommendation (e.g. 'Sun protection is recommended from 9:40am to 3:40pm.')

I have not yet done anything about the max temp as that appears to stay valid in the forecast data from what I can see.  Otherwise, not sure what to do there without some example JSON forecast data to help me figure it out...but I think the Fire and UV should work as is.

BUT NOTE -> this now requires the pytz module
As you're installing from a zip file, I don't think it will automatically fetch this for you.  You might have it on your system already for other reasons,  in which case it should be ok, once you re-start Kodi.

If not - you can entirely uninstall OzWeather, then re-install from the zip - I _think_ this will then automatically get the dependency for you.

OR, you can manually install pyzt from the .zip here:
http://mirrors.kodi.tv/addons/matrix/scr...trix.2.zip

Then install the updated OzWeather zip, then re-start Kodi and all should be ok.


(I do see that addons installed by zip will not automatically update, so once the final version is accept into the Kodi repo, you will actually have to uninstall/re-install I think - sorry!  I have been pushing all the fixes/changes to the v2.0.0 release in the meantime...)
The max is same as min.... it will go n/a in the json file.
All good on the update when it drops. If I go into versions for Ozweather it is showing me the Kodi rep to install anyway so it may update to 2 on release but we will see when it's released. Not a big issue anyway.
Maybe I already had pyzt as it seems to be working without me doing anything.
All seems good anyway. Thanks.
Literally n/a?  I think more likely null?
Maybe.. it's been a while since I checked it. Will be same as min. I'll see if I can catch it today.

EDIT you are probably right and it will be null.... everything else n/a seems to be null in the json...
{"data":[{"rain":{"amount":{"min":0,"max":null,"units":"mm"},"chance":0},"uv":{"category":"low","end_time":null,"max_index":2,"start_time":null},"astronomical":{"sunrise_time":"2021-05-31T20:51:31Z","sunset_time":"2021-06-01T06:56:32Z"},"date":"2021-05-31T14:00:00Z","temp_max":19,"temp_min":null,"extended_text":"Mostly sunny. Patchy fog early this morning. Winds north to northwesterly 15 to 20 km/h becoming light in the middle of the day then becoming northwesterly 15 to 25 km/h in the late afternoon.","icon_descriptor":"cloudy","short_text":"Mostly sunny.","fire_danger":null,"now":{"is_night":false,"now_label":"Max","later_label":"Overnight Min","temp_now":19,"temp_later":7}},{"rain":{"amount":{"min":0,"max":null,"units":"mm"},"chance":10},"uv":{"category":"low","end_time":null,"max_index":2,"start_time":null},"astronomical":{"sunrise_time":"2021-06-01T20:52:06Z","sunset_time":"2021-06-02T06:56:16Z"},"date":"2021-06-01T14:00:00Z","temp_max":20,"temp_min":7,"extended_text":"Partly cloudy. Light winds.","icon_descriptor":"mostly_sunny","short_text":"Partly cloudy.","fire_danger":null},{"rain":{"amount":{"min":3,"max":6,"units":"mm"},"chance":70},"uv":{"category":"low","end_time":null,"max_index":2,"start_time":null},"astronomical":{"sunrise_time":"2021-06-02T20:52:40Z","sunset_time":"2021-06-03T06:56:01Z"},"date":"2021-06-02T14:00:00Z","temp_max":18,"temp_min":9,"extended_text":"Cloudy. High (70%) chance of showers, most likely in the afternoon and evening. Light winds.","icon_descriptor":"shower","short_text":"Showers.","fire_danger":null},{"rain":{"amount":{"min":0,"max":1,"units":"mm"},"chance":50},"uv":{"category":"low","end_time":null,"max_index":2,"start_time":null},"astronomical":{"sunrise_time":"2021-06-03T20:53:12Z","sunset_time":"2021-06-04T06:55:48Z"},"date":"2021-06-03T14:00:00Z","temp_max":18,"temp_min":9,"extended_text":"Partly cloudy. Medium (50%) chance of showers, most likely in the afternoon and evening. Winds westerly 15 to 25 km/h turning south to southwesterly during the afternoon.","icon_descriptor":"shower","short_text":"Shower or two.","fire_danger":null},{"rain":{"amount":{"min":0,"max":0.2,"units":"mm"},"chance":20},"uv":{"category":null,"end_time":null,"max_index":null,"start_time":null},"astronomical":{"sunrise_time":"2021-06-04T20:53:44Z","sunset_time":"2021-06-05T06:55:36Z"},"date":"2021-06-04T14:00:00Z","temp_max":15,"temp_min":7,"extended_text":"Partly cloudy. Slight (20%) chance of a shower. Winds southwesterly 15 to 25 km/h.","icon_descriptor":"mostly_sunny","short_text":"Partly cloudy.","fire_danger":null},{"rain":{"amount":{"min":0,"max":null,"units":"mm"},"chance":0},"uv":{"category":null,"end_time":null,"max_index":null,"start_time":null},"astronomical":{"sunrise_time":"2021-06-05T20:54:15Z","sunset_time":"2021-06-06T06:55:26Z"},"date":"2021-06-05T14:00:00Z","temp_max":18,"temp_min":5,"extended_text":"Sunny. Light winds.","icon_descriptor":"sunny","short_text":"Sunny.","fire_danger":null},{"rain":{"amount":{"min":0,"max":null,"units":"mm"},"chance":5},"uv":{"category":null,"end_time":null,"max_index":null,"start_time":null},"astronomical":{"sunrise_time":"2021-06-06T20:54:45Z","sunset_time":"2021-06-07T06:55:17Z"},"date":"2021-06-06T14:00:00Z","temp_max":18,"temp_min":5,"extended_text":"Mostly sunny. Light winds becoming northwesterly 15 to 20 km/h later.","icon_descriptor":"mostly_sunny","short_text":"Mostly sunny.","fire_danger":null}],"metadata":{"response_timestamp":"2021-06-01T06:15:15Z","issue_time":"2021-06-01T06:02:51Z","forecast_region":"Central Coast","forecast_type":"metropolitan"}}

From https://api.weather.bom.gov.au/v1/locati...asts/daily right now min is null Kodi still showing 7 for min and 19 max
Yep, so that's correct for the min - {"is_night":false,"now_label":"Max","later_label":"Overnight Min","temp_now":19,"temp_later":7} so that's progress.
Hmm, interesting:

json:

            "now": {
                "is_night": true,
                "later_label": "Tomorrow's Max",
                "now_label": "Overnight Min",
                "temp_later": 19,
                "temp_now": 7
            },
Yeah... so what are you going to show when it's not night and the min disappears? Of it is night and the min disappears? I would have thought storing todays min and max in a file (XML?) and falling back to that if null would work or do you just intend to use tomorrows value instead?
Ok, wow, the way the BOM is removing the forecast data and then playing around with the now data is just...stupid...

Sigh.

I can't really (and also really don't want) to save things between sessions (as there's no guarantee there will have been an earlier session, given Kodi is not always on...)
Yeah you're right it is. Perhaps just use tomorrow when it happens? It's only late afternoon for the min and a couple of hrs for the max.... or take the simple approach and show a dash.... Or in the obs to you have actual temp range or only now? (I think it's just now right?)
It's just now.

I'd have to modify all the skin files to show a dash - anything not in there and Kodi annoyingly seems to shove a 0 in there. 

I've written something that might work, will watch it during the evening tonight...
Is yours doing the same at night? Damn nuisance!
This API is honestly a bit shit - I mean.... "icon_descriptor":"mostly_sunny","short_text":"Mostly cloudy. - WTF?
So on the main screen now it's saying None for the minimum and on the radar view says 0