Refreshing weather from home screen?
#1
Question 
Is it possible to refresh the weather on demand from the home screen? I've added a submenu item to the main weather item (see picture below) but cannot work out what to call in the <onclick> tag? As far as I can tell, it only gets refreshed by default when you start XBMC - I tend to put my computer to sleep so it never appears to get updated.

Image

I know it can be done as Showmix has a "Refresh" button in the dialog that appears when the main weather screen is activated (using code inside MyWeather.xml). Is it only possible from within MyWeather.xml?

Here's a snippet of my submenu code for the refresh item if that helps...

Code:
...
...
<control type="button" id="40">
    <description>refresh</description>
    <include>Submenu_Button</include>
    <label>Refresh</label>
    <onclick>[color=green]What goes here???[/color]</onclick>
</control>
...
...
Reply
#2
Using a fake button should do the trick.

Code:
<control type="button" id="40">
    <description>refresh</description>
    <include>Submenu_Button</include>
    <label>Refresh</label>
    <onclick>SetFocus(41)</onclick>
</control>

<control type="button" id="41">
    <description>Trigger Weather</description>
    <posx>-20</posx>
    <posy>-20</posy>
    <width>1</width>
    <height>1</height>
    <texturenofocus>-</texturenofocus>
    <texturefocus>-</texturefocus>
    <label>$INFO[Weather.Conditions]</label>
    <font>-</font>
    <onfocus>SetFocus(40)</onfocus>
</control>
Reply
#3
Hitcher Wrote:Using a fake button should do the trick.

Code:
<control type="button" id="40">
    <description>refresh</description>
    <include>Submenu_Button</include>
    <label>Refresh</label>
    <onclick>SetFocus(41)</onclick>
</control>

<control type="button" id="41">
    <description>Trigger Weather</description>
    <posx>-20</posx>
    <posy>-20</posy>
    <width>1</width>
    <height>1</height>
    <texturenofocus>-</texturenofocus>
    <texturefocus>-</texturefocus>
    <label>$INFO[Weather.Conditions]</label>
    <font>-</font>
    <onfocus>SetFocus(40)</onfocus>
</control>

Thanks for the reply, but unfortunately that didn't work. My theory on that is that unlike in Home.xml, which has similar code to force a weather update on startup, $INFO[Weather.Conditions] is already populated at this point so doing this has no effect. :confused2: Any other ideas? :p
Reply
#4
I would like to know this too, since I use standby instead of poweroff asswel.

Also, I have to update the weather manually everytime I start XBMC. It just doesn't populate the fields. Maybe there's someone who knows how I can fix this? (I'm using the standard weather plugin in Stark)
Reply
#5
generator Wrote:I would like to know this too, since I use standby instead of poweroff asswel.

Also, I have to update the weather manually everytime I start XBMC. It just doesn't populate the fields. Maybe there's someone who knows how I can fix this? (I'm using the standard weather plugin in Stark)

That's interesting. I'm using a home-modded Auriga (rather than Stark, which is marginally older) and it updates fine when you first start XBMC. In Home.xml, a few lines down from the top, I have the following bit of code, which presumably (as the description suggests!) does an initial update of the weather by populating the label. Do you have the same?

Code:
<control type="label">
        <description>Force Weather update on load</description>
        <posx>0</posx>
        <posy>-100</posy>
        <label>$INFO[Weather.Conditions]</label>
        <font>-</font>
    </control>

I'm beginning to become convinced that refreshing the weather on demand is only possible if you update it from the window created from MyWeather.xml. I'll be overjoyed to be proved wrong though :p
Reply
#6
Heck, I NEVER power down my system... I hardly ever even restart XBMC. Does this mean I'd be stuck with the same weather every day?
Reply
#7
DurhamDev Wrote:Heck, I NEVER power down my system... I hardly ever even restart XBMC. Does this mean I'd be stuck with the same weather every day?

Good point, and the answer seems to be no, but with some conditions. Having left mine running for a while, it looks like it auto-updates:

[1] Whenever you start XBMC
[2] Every 30 mins whilst XBMC is running
[3] 30 mins after you bring it out of standby with XBMC running - therefore, if your machine has been in standby for several days your weather will be several days out-of-date until 30 mins after your resumed it, at which time the weather will update.
Reply
#8
snowdrift Wrote:Good point, and the answer seems to be no, but with some conditions. Having left mine running for a while, it looks like it auto-updates:

[1] Whenever you start XBMC
[2] Every 30 mins whilst XBMC is running
[3] 30 mins after you bring it out of standby with XBMC running - therefore, if your machine has been in standby for several days your weather will be several days out-of-date until 30 mins after your resumed it, at which time the weather will update.

That's good to know... Now, if only there was a method by which XBMC automagically updated my Library on a daily basis... Anyone? Anyone?

Laugh
Reply
#9
DurhamDev Wrote:That's good to know... Now, if only there was a method by which XBMC automagically updated my Library on a daily basis... Anyone? Anyone?

Laugh

Why not just create a script/batch file and add it to your Scheduled Task on
windows or cron on linux?

Using wget, curl or even firefox/ie from the command line will work.

Something like :

iexplore http://user:pass@xbmcip/xbmcCmds/xbmcHtt...rary(video))

if you want to make it cleaner and close firefox/ie after, instead of creating a
regular script, create an AutoIt or AutoHotKey script.

If you are on windows, let me know if you need help and i will make one for
ya. I been meaning to create one for myself Smile

-Pr.
[4 Kodi Clients + 4 Norco RPC-4224 Media Servers w/376 TB HDD Space]
Reply
#10
Pr.Sinister Wrote:Why not just create a script/batch file and add it to your Scheduled Task on windows or cron on linux? Using wget, curl or even firefox/ie from the command line will work.

That is awesome - I didn't know it was that simple.

Pr.Sinister Wrote:If you are on windows, let me know if you need help and i will make one for ya. I been meaning to create one for myself Smile

I'm using Windows XP, and would be very happy if you could provide me with the info, or a file. I don't have a problem integrating a scheduled event, and if it could automagically close after, that would be awesome. Would that affect anything if XBMC was still running? I was playing with the idea of having XBMC close and open, but I could never get the scheduler to do what I wanted it to. I was considering having XBMC close, then run my antivirus and defragmenting, and then rerun XBMC when it was done, which would automatically update the library.

If you're making one for yourself, I can tell you that there are probably tonnes of people on here who would love it! Thanks!
Reply
#11
DurhamDev Wrote:That is awesome - I didn't know it was that simple.

If you're making one for yourself, I can tell you that there are probably tonnes of people on here who would love it! Thanks!

Ok after the new year party, i came home and decided to write that script i was talking about!

I'm pretty sure i ain't drunk so it should all work fine.

I only tested the wget and firefox scripts. I haven't tested the one for the
antivirus and defrag but i don't see why it wouldn't work...

Try them out!

[Windows] How-To Schedule Automatic Library Updates
[4 Kodi Clients + 4 Norco RPC-4224 Media Servers w/376 TB HDD Space]
Reply

Logout Mark Read Team Forum Stats Members Help
Refreshing weather from home screen?0