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.
Thanks for all your help re applying to patch on my Android TV (Sony Bravia btw).

When I applied the patch it said Action Complete and skin restarted. No errors that I could see. In the log it says "CPythonInvoker ..... script.ozweather-skinpatch script successfully run" or something like that - some of the text is cut off and not sure how to view the actual log (that's using a log viewer add-on). Then the log goes on to restart the skin which also appears to be successful.

I have looked into trying to root the TV but haven't had much luck so far. Also a bit worried about breaking something. So I might just leave it for now. I've got a Google TV with chromecast too so I might give it a go on that.

I appreciate the help.

Thanks
AD
I've pushed version 0.0.6 of the skin patcher - looking at the code I realised it was logging the errors in the suspected case here of being unable to write to the skin folder...but not passing those errors back to the Kodi UI.  Oops.

This version should report the issues if/when they happen and write a bit more to the log.

(If you have a look in the Kodi addons there are ones that can upload log files for you, if you can't find them on your system.  The upload the logs and give you a URL to post here that I could then look at).
(2021-03-07, 08:52)bossanova808 Wrote: [ -> ]@anarchotaoist  What skin are you using? 
 Aeon Nox Silvo
Yep so there's no special support for that skin - i.e. skin patcher can't help you, and currently no one has contributed an OzWeather skin file for it.  If they (you?) were to do so, I would be happy to add it to the Skin Patcher so others could enjoy OzWeather support.

In terms of a main screen widget, though, you'd need to get the skin maker to do that for you, or perhaps submit a PR for it.  I'd be happy to give you some guidance along the way, but I'm not able to do it all....I'm sticking to supporting the main skins as I've limited time.
First post, here goes...

A question about temperatures reported via OzWeather compared to the Aus BoM website.

I'm looking at OzWeather and the BoM website (for my local area, at the same time) and am seeing around a 2-3 degree difference in forecast temps over the next week.

Max temps on OzWeather are consistently below the BoM website temps by 3 degrees. Min temps vary in difference between 1 - 3 degrees but always higher than the BoM website.

As a third data point, the BoM IOS app on my phone has identical max temps to the BoM website and a couple of single degree differences in min temps.

If the data all comes from the BoM, the differences.....?

I can't see where I could have done 'something' to cause the disparity, but if there's a way...

This is on windows, but the same occurs on some NUC's I have as well with LibreElec running.
Yeah so this is a new thing....for a long time, the values were all the same and WeatherZone (where things are currently scraped from) said 'Weather Data from the BOM'.

At some point, not completely sure when, they changed this to a BS phrase along the lines of 'some weather data from the BOM'.  And I too have noticed in the last few months that the WZ temp & forecast data is no longer spot on.

But, fortunately....in the meantime, the BOM finally have a new 'places' system - e.g. http://www.bom.gov.au/places/vic/ascot-vale/ -although it is still in beta at this point.

So...I have started a re-write to scrape from there instead.  But it means quite a bit of work, and I'll have to write some sort of migration system, or at least force everyone to re-configure the addon from scratch when the time comes to release that.  Also, there isn't quite as much data on those pages, so a few things will be lost...so a bit of skin work to clean up too...but at least the data will be bang on again, and definitely 100% all from the BOM forever more.  Not hard, just a bit of a PITA.  The BOM pages are much easier to scrape at least, a lot more structured than the shitty WZ code is.

I've started the work, but not quite sure when I will have time to finish...but definitely in the 'weeks' category rather than days....sorry.    I was kind hoping it would fly under the radar for a bit but I suppose someone had to point it out @Jetson  -thanks!  Wink
(2021-04-21, 14:16)bossanova808 Wrote: [ -> ]Yeah so this is a new thing....for a long time, the values were all the same and WeatherZone (where things are currently scraped from) said 'Weather Data from the BOM'.

At some point, not completely sure when, they changed this to a BS phrase along the lines of 'some weather data from the BOM'.  And I too have noticed in the last few months that the WZ temp & forecast data is no longer spot on.

But, fortunately....in the meantime, the BOM finally have a new 'places' system - e.g. http://www.bom.gov.au/places/vic/ascot-vale/ -although it is still in beta at this point.

So...I have started a re-write to scrape from there instead.  But it means quite a bit of work, and I'll have to write some sort of migration system, or at least force everyone to re-configure the addon from scratch when the time comes to release that.  Also, there isn't quite as much data on those pages, so a few things will be lost...so a bit of skin work to clean up too...but at least the data will be bang on again, and definitely 100% all from the BOM forever more.  Not hard, just a bit of a PITA.  The BOM pages are much easier to scrape at least, a lot more structured than the shitty WZ code is.

I've started the work, but not quite sure when I will have time to finish...but definitely in the 'weeks' category rather than days....sorry.    I was kind hoping it would fly under the radar for a bit but I suppose someone had to point it out @Jetson  -thanks!  Wink

They have an API you can use (Their new app uses it) You shouldn't need to scrape anything..
(2021-04-22, 03:09)DavidFW1960 Wrote: [ -> ]They have an API you can use (Their new app uses it) You shouldn't need to scrape anything..

Do they, though?  Obviously for this I am not going to use their official paid services - http://reg.bom.gov.au/other/charges.shtml - for a Kodi addon.

I don't really call this an API as such - http://www.bom.gov.au/catalogue/data-feeds.shtml - if that is what you mean. 

The big issue is how to find locations and then match that to data.  It's not hard at all to scrape their places search page, and then to scrape the various results pages for the place....less obvious how, given a place, one then uses it with that XML mess.

From what I can see, other folks have concluded that scraping is easier than the API here - e.g. https://pypi.org/project/weather-au/

But I may well be missing something - the BOM site is a chaotic mess really.  If there is a nice tidy 'search for a place' and given a place here's the weather and radar data' - that would of course be great, but I am not sure there is?  If you know of one, can you point me at it?  (The new BOM app is pretty crappy, just as a side note....I really miss Pocket Weather!)
(2021-04-22, 03:28)bossanova808 Wrote: [ -> ]
(2021-04-22, 03:09)DavidFW1960 Wrote: [ -> ]They have an API you can use (Their new app uses it) You shouldn't need to scrape anything..

Do they, though?  Obviously for this I am not going to use their official paid services - http://reg.bom.gov.au/other/charges.shtml - for a Kodi addon.

I don't really call this an API as such - http://www.bom.gov.au/catalogue/data-feeds.shtml - if that is what you mean. 

The big issue is how to find locations and then match that to data.  It's not hard at all to scrape their places search page, and then to scrape the various results pages for the place....less obvious how, given a place, one then uses it with that XML mess.

From what I can see, other folks have concluded that scraping is easier than the API here - e.g. https://pypi.org/project/weather-au/

But I may well be missing something - the BOM site is a chaotic mess really.  If there is a nice tidy 'search for a place' and given a place here's the weather and radar data' - that would of course be great, but I am not sure there is?  If you know of one, can you point me at it?  (The new BOM app is pretty crappy, just as a side note....I really miss Pocket Weather!)

Well look here:

Have you seen this https://weather.bom.gov.au/location/r659gg5-gosford ?
There is a JSON API behind it..
also (from the network tab in chrome dev-tools for that page):

https://api.weather.bom.gov.au/v1/locations/r659gg5 – general site info
https://api.weather.bom.gov.au/v1/locati...g/warnings – weather warnings for district
https://api.weather.bom.gov.au/v1/locati...asts/daily forecast info for 7 days
https://api.weather.bom.gov.au/v1/locati...s/3-hourly 3 hourly forecasts..
https://api.weather.bom.gov.au/v1/locati...servations – has also general current info
https://api.weather.bom.gov.au/v1/locati...ecast/rain – rain status

You just need the geohash of the site
Ah wow, I did indeed not know that was there.  That looks like it will be super handy.  Thanks!  Be nice if that was documented somewhere obvious...

Probably worth remembering that I wrote this like 12 years ago (as my first Python project) - and apart from little things to keep it going, I haven't really re-visited it much since then.  Seems times have changed more than I realised...you're gonna have me re-writing the whole thing now, sigh.

Looks like one can get the geohash via - https://weather.bom.gov.au/onboarding (unless you magically have an API for that too - but would be easy to scrape...)

The radar there looks a lot more complicated than the FTP approach though...any magic hints on that?
(2021-04-22, 04:25)bossanova808 Wrote: [ -> ]Ah wow, I did indeed not know that was there.  That looks like it will be super handy.  Thanks!  Be nice if that was documented somewhere obvious...

Probably worth remembering that I wrote this like 12 years ago (as my first Python project) - and apart from little things to keep it going, I haven't really re-visited it much since then.  Seems times have changed more than I realised...you're gonna have me re-writing the whole thing now, sigh.

Looks like one can get the geohash via - https://weather.bom.gov.au/onboarding (unless you magically have an API for that too - but would be easy to scrape...)

The radar there looks a lot more complicated than the FTP approach though...any magic hints on that?
How about here? https://api.weather.bom.gov.au/v1/locati...ch=gosford
The geohash is nothing special.. probably 10's of sites will calculate that from a lat/long but that API is probably best..

With the radar.... well BOM now does tiles and you can pan and zoom etc. Here is a javascript card for Home Assistant that does it..  Dunno if it helps..

I also upgraded to Kodi Matrix this week on OSMC and it's doing the same as the chromecast.. I'm getting a blacked out screen for the radar (with all the data) but the fonts are wrong and I don't have any of the interactive buttons like for ABC Weather of to switch location. So both my matrix systems do this now. I am using your patch script. Anyway I have been meaning to get some logs..
Yeah I don't think end users will find it nice to have to put in their lat long, so using the BOM search thing is the way to go I think.  But that link looks perfect thanks.

(and yes would need logs but honestly I am first going to spend my time on this new stuff given I am going to be replacing it all...I will say I have it running fine on a bunch of Matrix systems (windows and Coreelec) - so my guess it is some sort of platform packaging thing maybe?)

I think the forum intercepted your js - maybe you could pastebin it and post me a link?
(2021-04-22, 04:44)bossanova808 Wrote: [ -> ]Yeah I don't think end users will find it nice to have to put in their lat long, so using the BOM search thing is the way to go I think.  But that link looks perfect thanks.

(and yes would need logs but honestly I am first going to spend my time on this new stuff given I am going to be replacing it all...I will say I have it running fine on a bunch of Matrix systems (windows and Coreelec) - so my guess it is some sort of platform packaging thing maybe?)

I think the forum intercepted your js - maybe you could pastebin it and post me a link?
Doh I should have posted the link probably... https://github.com/theOzzieRat/bom-radar-card

I have a ChromeCast With Google TV doing it and my Vero4K running OSMC doing it as well... couldn't have 2 more different systems. I will get some logs maybe on the weekend.
Hmm, might do a round one of changes with the new BOM data, and the old radar, then look at that - considerably more complicated....but would be nice....
(2021-04-22, 05:26)bossanova808 Wrote: [ -> ]Hmm, might do a round one of changes with the new BOM data, and the old radar, then look at that - considerably more complicated....but would be nice....

Here is my log https://paste.kodi.tv/uxihorodag.kodi

ImageImageIf I manually copy the skin file it is all OK but skin patcher... error.

Looks like this https://imgur.com/a/w1qvKmB
Image