[RELEASE] Commands - Map multiple xbmc commands to one remote button

  Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
AussieFries Offline
Fan
Posts: 400
Joined: Aug 2010
Reputation: 2
Post: #16
Great work!

I'm trying to create an event which first sends the IR remote 'Stop', then the Suspend command.
('Stop' to stop what's currently playing in XBMC)

So to map above action to button '1' on my remote, I have to add below line to my keyboard.xml?

<one>RunPlugin(plugin://script.commands)</one>

Please find content of my commands. file below.

1###Stop#Suspend

Will this work?

Many thanks for your help
(This post was last modified: 2012-11-06 13:00 by AussieFries.)
find quote
evenzak Offline
Junior Member
Posts: 11
Joined: Dec 2011
Reputation: 0
Location: West Virginia, USA
Post: #17
Is it possible to map a combo command directly to a remote button by passing a parameter i.e. RunPlugin://script.commands/?combo_command_name? I often use the combo CleanLibrary(video)#RunScript(script.artwork.downloader) and I would like to execute directly from a button press rather than have the list of commands pop up. Thanks, and great work!
find quote
AddonScriptorDE Offline
Skilled Python Coder
Posts: 767
Joined: May 2012
Reputation: 85
Location: Germany
Post: #18
(2012-11-03 21:17)AussieFries Wrote:  Great work!

I'm trying to create an event which first sends the IR remote 'Stop', then the Suspend command.
('Stop' to stop what's currently playing in XBMC)

So to map above action to button '1' on my remote, I have to add below line to my keyboard.xml?

<one>RunPlugin(plugin://script.commands)</one>

Please find content of my commands. file below.

1###Stop#Suspend

Will this work?

Many thanks for your help
Hi! Yes, this should work...
Code:
<one>RunPlugin(plugin://script.commands)</one>
opens the "Commands" menu.
But I would replace the "1" with a better title...
This command will not be directly executed when pushing "1" on your remote...
Instead, a list with all your commands will appear...

(2013-02-07 00:43)evenzak Wrote:  Is it possible to map a combo command directly to a remote button by passing a parameter i.e. RunPlugin://script.commands/?combo_command_name? I often use the combo CleanLibrary(video)#RunScript(script.artwork.downloader) and I would like to execute directly from a button press rather than have the list of commands pop up. Thanks, and great work!
Currently, you cant directly map combo commands to one key...Sad But I can add something like that to the next version!
find quote
evenzak Offline
Junior Member
Posts: 11
Joined: Dec 2011
Reputation: 0
Location: West Virginia, USA
Post: #19
You're awesome! Thanks for all the hard work on this script!
find quote
aptalca Online
The Dude
Posts: 1,245
Joined: Sep 2009
Reputation: 32
Post: #20
Just wanted to say thanks again

this addon increased the waf of my system greatly :-)
find quote
frank1119 Offline
Junior Member
Posts: 2
Joined: Feb 2013
Reputation: 0
Post: #21
I like this addon, but I wanted to execute commands defined with this addon directly from my RC, so I modified the script /home/pi/.xbmc/addons/script.commands/default.py

I added this

Code:
def executeFunc(key,func):
        importCommands(key)
        myCommandsTemp=[]
        for temp in myCommands:
          if temp.find(func+"###")>=0:
            command = temp[temp.find("###")+3:]
            if command.find("#")==-1:
              xbmc.executebuiltin(command)
            else:
              spl=command.split("#")
              for temp in spl:
                xbmc.executebuiltin(temp)

And I replaced

Code:
params=parameters_string_to_dict(sys.argv[2])
key=params.get('key')

if type(key)!=type(str()):
  key=''

if key != '':
    commandsMain('_'+key)
else:
    commandsMain('')

with

Code:
params=parameters_string_to_dict(sys.argv[2])
key=params.get('key')
func=params.get('func')
if type(key)!=type(str()):
  key=''
if type(func)!=type(str()):
  func=''

if func != '':
  if key != '':
      executeFunc('_'+key,func)
  else:
      executeFunc(''+key,func)
else:
  if key != '':
      commandsMain('_'+key)
  else:
      commandsMain('')

Now you can modify the keyboard.xml like this:

<one mod="ctrl,alt">RunPlugin(plugin://script.commands/?func=CycleSubs)</one>

I hope the original developer feels not offended... Blush
find quote
MeMeMe Offline
Senior Member
Posts: 171
Joined: Sep 2011
Reputation: 5
Post: #22
How do I download this addon?
find quote
AddonScriptorDE Offline
Skilled Python Coder
Posts: 767
Joined: May 2012
Reputation: 85
Location: Germany
Post: #23
(2013-02-23 15:20)frank1119 Wrote:  I like this addon, but I wanted to execute commands defined with this addon directly from my RC, so I modified the script /home/pi/.xbmc/addons/script.commands/default.py
Nice, thanks for your modification! Useful for combi-commands. (Every single-command could be directly mapped to a key without this addon...)
I will add this to the next version... (if you agree Wink)

(2013-02-23 15:20)frank1119 Wrote:  I hope the original developer feels not offended... Blush
Not at all! Smile

(2013-02-25 15:04)MeMeMe Wrote:  How do I download this addon?
You can install it via the xbmc.org repo:
Settings -> Add-ons -> Get Add-ons -> XBMC.org Add-ons -> Program Add-ons -> Commands
find quote
MeMeMe Offline
Senior Member
Posts: 171
Joined: Sep 2011
Reputation: 5
Post: #24
(2013-02-25 15:04)MeMeMe Wrote:  How do I download this addon?
You can install it via the xbmc.org repo:
Settings -> Add-ons -> Get Add-ons -> XBMC.org Add-ons -> Program Add-ons -> Commands
[/quote]

Doh! Of course. Thanks
find quote
frank1119 Offline
Junior Member
Posts: 2
Joined: Feb 2013
Reputation: 0
Post: #25
(2013-02-25 15:58)AddonScriptorDE Wrote:  Nice, thanks for your modification! Useful for combi-commands. (Every single-command could be directly mapped to a key without this addon...)
I will add this to the next version... (if you agree Wink)

Your welcome and of course I agree. Glad to be of some help
find quote
vazexa Offline
Junior Member
Posts: 5
Joined: Jan 2013
Reputation: 0
Post: #26
Hello,
This is an excellent addon!!

How will it be possible to add a specific command i.e. Rip CD or Shutdown as a favorite, in order to add it directly to the Main menu??
find quote
AddonScriptorDE Offline
Skilled Python Coder
Posts: 767
Joined: May 2012
Reputation: 85
Location: Germany
Post: #27
(2013-03-16 22:21)vazexa Wrote:  How will it be possible to add a specific command i.e. Rip CD or Shutdown as a favorite, in order to add it directly to the Main menu??
These are all default xbmc commands (full list of all commands), you can add them to your favourites.xml like this:
Code:
<favourite name="Rip Audio CD">RipCD</favourite>
find quote
SpiderDice Offline
Senior Member
Posts: 102
Joined: Jul 2012
Reputation: 0
Post: #28
After I install this add on, and try to Launch it, the script fails. Anyone else getting this error?

Setup:
- nvidia Shield TV Pro
- 8TB Synology DS214play
- 2TB External eSATA

twitter
find quote
AddonScriptorDE Offline
Skilled Python Coder
Posts: 767
Joined: May 2012
Reputation: 85
Location: Germany
Post: #29
(2013-03-25 07:48)SpiderDice Wrote:  After I install this add on, and try to Launch it, the script fails. Anyone else getting this error?
Hard to say if someone is getting your error! Because you didn't posted it... Wink
Please upload your log file so i can have a look at it...
find quote
SpiderDice Offline
Senior Member
Posts: 102
Joined: Jul 2012
Reputation: 0
Post: #30
Log Uploader installed fine, but never sent me the e-mail, and that script failed too. Haha

I grabbed my xbmc.log file, removed all the passwords, and then tried to upload it to xbmclogs.com Apparently, 1.6MB is too big for the server to handle.


TL;DR
Here's my log file:
http://ge.tt/8M3HfRc

Setup:
- nvidia Shield TV Pro
- 8TB Synology DS214play
- 2TB External eSATA

twitter
find quote