Posts: 152
Joined: Feb 2007
Reputation:
1
I am trying to get my remote xbmc clients to send an http command to a web server when they access "live tv" this will in turn send an ir signal to wake up the sky box. I have tried various ways but haven't found a solution.
I have set up a similar thing using autoexec.py and a playeractions script for Movie player events, but can find the way to do this based on a specific addon/menu item.
in simple terms all I want is when you select live tv the following be sent:
urllib2.urlopen('http://192.168.1.141/ajax_sendevent.lhtml?event=study_live_tv&device=18')
thanks for any pointers.
Tyrherman
Posts: 7,650
Joined: Jun 2011
Reputation:
287
moving to the dev forum, you might have more luck there
Posts: 3,909
Joined: Dec 2004
Reputation:
20
Nuka1195
Skilled Python Coder
Posts: 3,909
there's a "WakeOnLan" builtin you could add an extra <onclick> to the skin file for the button that launches live tv if the skybox supported that.
if the IR is the only way, then an extra <onclick> that calls RunAddon(), where the addon is a simple python addon to do what you want.
Posts: 793
Joined: Oct 2010
Reputation:
17
I'd use a service addon to check the current window, sleep a while, check again, etc. When it finds the right window, send the command
Posts: 152
Joined: Feb 2007
Reputation:
1
can you put 2 actions <onclick> in the skin settings? i.e. when you select "live tv" 1st one activates_window, 2nd runs addon, then use an addon to send the http command?
Posts: 793
Joined: Oct 2010
Reputation:
17
You could just run the add-on and have it call the activate window built-in, then send the command.
Also, make sure you backup your changes as they'll be over written when the skin updates
Posts: 152
Joined: Feb 2007
Reputation:
1
ok think I got it, so set the skin to activate the addon and within the addon have it do both activate_liveTV and send the http command. Anyone point me to a simple addon I could modify as Python is completely new to me, but my editing is good! :-)
Posts: 793
Joined: Oct 2010
Reputation:
17
If you're editing the skin you don't even need a full add-on, just a script. Xbmc.executeBuiltin() will let you call activate window. On my phone or I'd give you a snippet, but you should be able Google it from there.
Posts: 152
Joined: Feb 2007
Reputation:
1
first things first, this thread was moved to python but in fairness I have little understanding of python, so when you say "just a script. Xbmc.executeBuiltin() will let you call activate window" you may as well have told me to run to the moon :-( second problem is I can't even find where in the skin to edit this!! - how embarrassing! I am using aeon nox and cannot see anywhere in the home.xml that is obvious.
have been googling pretty much all day in between watching the football and to say I am struggling is an understatement.
so this is my understanding of what you say I need to do:
if I could write a script (which consists of a folder in the addons with 2 files. addon.xml and default.py??) I could then call that script from the onclick livetv?
I apologise if I am a complete novice, I will also look at using a simple skin which may also help!
Posts: 152
Joined: Feb 2007
Reputation:
1
update, couldn't wait so tested and it works perfectly!!
thanks for your help! just need to see if I can find the place to edit Aeon Nox or stick with one of the simpler skins,