Kodi Community Forum
Release OzWeather - Australian Weather Addon using BOM data inc. animated radar support - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: Add-on Support (https://forum.kodi.tv/forumdisplay.php?fid=27)
+---- Forum: Weather Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=155)
+---- Thread: Release OzWeather - Australian Weather Addon using BOM data inc. animated radar support (/showthread.php?tid=116905)



RE: [RELEASE] OzWeather - Australian Weather Addon using BOM data - bossanova808 - 2013-07-27

Hey

Apart from being really busy in general right now, I've also made a decision with my addons to not spend extra time on supporting under-weight platforms like the Pi. There are so many better alternatives...old ION/atom machines that are vastly more powerful and don't cost much more on ebay etc. I just can't be bothered to be honest!

That said, the code is here: http://code.google.com/p/ozweather/ - and I will absolutely be fine with a pull request that moves the background grabbing stuff into settings so there is a download/update radar backgrounds control in there, and it's not done in the main retrieval. As it is it only does it once a week anyhow.

(line 203 - http://code.google.com/p/ozweather/source/browse/default.py)

The background stuff is in a separate function so moving it so it's bound in settings instead should only be a half hours work or so, maybe a couple hours if you don't know Python Wink - you could also guard the weekly function with if system = raspberry pi guard or something.

This was my first add on and is...not awesome....code wise.

So TL;DR - if you code it, do a pull request to my repo and I am fine with it moving out there as long as for decent powered systems it checks for changes once a week or so (they do sometimes (rarely) change the BGs)...i.e. works as is for my system, but happy to incorporate if you add low powered system support!


RE: [RELEASE] OzWeather - Australian Weather Addon using BOM data - raspberrypie - 2013-07-29

Today it all working happily, even if it takes a while to change location. So I think I'll leave it alone!


RE: [RELEASE] OzWeather - Australian Weather Addon using BOM data - bossanova808 - 2013-07-29

Probably takes more time the first time - once the backgrounds are in, and not stale (> 1 week old) - they are skipped, so just the overlays load.

After that it's mainly up to the BOMs speed...


RE: [RELEASE] OzWeather - Australian Weather Addon using BOM data - raspberrypie - 2013-08-03

Any idea why the wind is now being reported in mph and not km/h? Temperatures are still in Celsius. It might be the recent raspbmc update has buggered something - there have been many reports of it not going smoothly. I take it the localisation stuff is done in the general weather plugin and not in your ozweather. eg It briefly shows the number 40 and is then replaced by 25 mph (which is near enough to 40 km/h).

Edit: forget all that, I hadn't set the location Region correctly: it was UK, not Australia (although I thought even they went metric ages ago, so why are their wind speeds still in mph?).


RE: [RELEASE] OzWeather - Australian Weather Addon using BOM data - bossanova808 - 2013-08-03

Glad you worked it out. Indeed my addon does not deal with any unit settings...


RE: [RELEASE] OzWeather - Australian Weather Addon using BOM data - fuggin - 2013-08-08

Is there an updated MyWeather.xml and DialogSeekBar.xml for Gotham? Using alpha 6 and Confluence skin the add-on works but the radar function fails with a script fail error dialog.


RE: [RELEASE] OzWeather - Australian Weather Addon using BOM data - bossanova808 - 2013-08-08

Haven't tried Gotham recently....leave it with me and I will check wht's going on

Just tried it here - no issue.

Pastebin a *full debug log* and I will have a look at your issue.


RE: [RELEASE] OzWeather - Australian Weather Addon using BOM data - fuggin - 2013-08-08

Bah! just retried it here too and it's working fine now.

Thanks for the nice add-on btw.


RE: [RELEASE] OzWeather - Australian Weather Addon using BOM data - bossanova808 - 2013-08-08

No probs - enjoy!


RE: [RELEASE] OzWeather - Australian Weather Addon using BOM data - fuggin - 2013-08-08

Spoke too soon. Just got the script fail error again... here's the log. http://xbmclogs.com/show.php?id=43358


RE: [RELEASE] OzWeather - Australian Weather Addon using BOM data - bossanova808 - 2013-08-08

Hmm, no idea really - this the block in question:

#we need make the directories to store stuff if they don't exist
if not xbmcvfs.exists( RADAR_BACKGROUNDS_PATH ):
os.makedirs( RADAR_BACKGROUNDS_PATH )
if not xbmcvfs.exists( LOOP_IMAGES_PATH ):
os.makedirs( LOOP_IMAGES_PATH )

...and the error is:

20:59:58 T:139959354103552 ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <type 'exceptions.OSError'>
Error Contents: (17, 'File exists', '/home/xbmc/.xbmc/userdata/addon_data/weather.ozweather/currentloop/IDR021/')
Traceback (most recent call last):
File "/home/xbmc/.xbmc/addons/weather.ozweather/default.py", line 578, in <module>
forecast(location, radar)
File "/home/xbmc/.xbmc/addons/weather.ozweather/default.py", line 167, in forecast
buildImages(radarCode)
File "/home/xbmc/.xbmc/addons/weather.ozweather/default.py", line 289, in buildImages
os.makedirs( LOOP_IMAGES_PATH )
File "/usr/lib/python2.7/os.py", line 157, in makedirs
mkdir(name, mode)
OSError: (17, 'File exists', '/home/xbmc/.xbmc/userdata/addon_data/weather.ozweather/currentloop/IDR021/')

so basically the VFS is saying the folder doesn't exist, but when python goes to make it, it does.

Very likely it's a big and will get fixed along the road to Gotham...in the meantime, you can probably get it to work like this:
Code:
if not xbmcvfs.exists( RADAR_BACKGROUNDS_PATH ):
        try:
            os.makedirs( RADAR_BACKGROUNDS_PATH )
    if not xbmcvfs.exists( LOOP_IMAGES_PATH ):
        try:
            os.makedirs( LOOP_IMAGES_PATH )

It's not happening here on two machines (both Windows, though).


RE: [RELEASE] OzWeather - Australian Weather Addon using BOM data - fuggin - 2013-08-09

Thanks but using that code gives indentation errors.

tbh i'll wait until 13.0 progresses further as you suggest.


RE: [RELEASE] OzWeather - Australian Weather Addon using BOM data - bossanova808 - 2013-08-09

Yeah it pasted funny.

But I think that's the right idea anyway - if there are VFS path issues it will break a lot of addons...


RE: [RELEASE] OzWeather - Australian Weather Addon using BOM data - raspberrypie - 2013-08-15

Thanks for the update to fix this latest embuggerence, working again now.

One small change I made, I round the values in your default.py

temperature = str(int(round(float(observations[0].strip( '&deg;C' )))))
dewPoint = str(int(round(float(observations[1].strip( '&deg;C' )))))
feelsLike = str(int(round(float(observations[2].strip( '&deg;C' )))))

It's not your fault, it's because the xml script appears to truncate the values instead of rounding them correctly. You see 12.7 C for a moment then it's changed to 12 C etc. to fit in the skin correctly. I prefer 13 C.


RE: [RELEASE] OzWeather - Australian Weather Addon using BOM data - bossanova808 - 2013-08-15

Yeah that's weird, I thought I'd done that.

Thanks, will incorporate and get it out there soon.