Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details

If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.

Support for XBMC2 plugin (formerly XBMCRepeat)

Questions and comments specific to a particular plugin should go here.
matejdro
Posts: 38
Joined: Wed Jul 21, 2010 9:58 am

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by matejdro »

I have added action to the script: Get3DMode, which retrieves whether GUI is being rendered in 2D or in stereoscopic 3D. For example, I use it when EG receives play event from the Kodi to automatically change my TV into/out of 3D mode. Included patch is based on March 21th version (I had to rename it to txt to upload it to the forum).

Also bug report: HTTP API is completely broken. Trying to send any command will trigger this error:

Code: Select all

   Traceback (most recent call last):
     Python script "16", line 1, in <module>
       print(eg.plugins.XBMC2.plugin.HTTP_API.send('getcurrentlyplaying'))
     File "C:\Program Files (x86)\EventGhost\plugins\XBMCRepeat\__init__.py", line 882, in send
       request = urllib2.Request('http://'+self.ip+':'+self.port+'/xbmcCmds/xbmcHttp?command='+method+'('+urllib2.quote(eg.ParseString(params), ':\\')+')')
   TypeError: cannot concatenate 'str' and 'int' objects
Attachments
3dmode.patch.txt
(1.19 KiB) Downloaded 111 times
jonib
Plugin Developer
Posts: 1328
Joined: Thu Mar 26, 2009 9:33 pm
Location: Sweden

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by jonib »

matejdro wrote:I have added action to the script: Get3DMode, which retrieves whether GUI is being rendered in 2D or in stereoscopic 3D. For example, I use it when EG receives play event from the Kodi to automatically change my TV into/out of 3D mode.
Thanks for the contribution, however I will not include it in the plugin, as it's just a command to run a JSON-RPC method and checking its result.
I don't really like these custom commands as I can't add in a million variants just because they might be easier to use then a JSON-RPC action directly, but I still want to make the JSON-RPC methods more accessible.
But it did give me an idea for user added "Custom" actions that uses JSON-RPC methods with specific parameters and gives easily usable results. I'll have to think about it some more.
Also bug report: HTTP API is completely broken. Trying to send any command will trigger this error:
What XBMC version did you use? (Only older XBMC versions have support for it, No Kodi supports it)
If I ever get it done I'll make the error properly show if HTTP API is supported or not (Or maybe remove it but I'll have to check if XBMC4XBOX still supports it or is actually developed still)

jonib
XBMC2 plugin to control XBMC. If you want to flatter me Image
matejdro
Posts: 38
Joined: Wed Jul 21, 2010 9:58 am

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by matejdro »

What would be the best way then to do what I have done and keep it compatible with new versions of the script? Python script action probably?

Ah ok, so HTTP API is dead with Kodi? My bad then. I was looking for a way to reliably send built-in functions to Kodi, but it looks like it doesn't exist at the moment:
  • HTTP API is dead as you said
  • JSON API does not seem to be able to do this (I searched through docs and could not find it)
  • Commands via xbmc.send_action() does not seem to be reliable (I found it sometimes just stopped working, mostly after restarting Kodi. Which is weird because buttons seem to be sent via same API and they work fine).
jonib
Plugin Developer
Posts: 1328
Joined: Thu Mar 26, 2009 9:33 pm
Location: Sweden

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by jonib »

matejdro wrote:What would be the best way then to do what I have done and keep it compatible with new versions of the script? Python script action probably?
Using Python scripts should be the best way at the moment.
Ah ok, so HTTP API is dead with Kodi?
Dharma was the last version with support for it.
I was looking for a way to reliably send built-in functions to Kodi, but it looks like it doesn't exist at the moment:
In ver 0.6.23 I added support for built-in functions, "XBMC2\Experimental\BuiltInFunctions" in the plugin. But there seems to be some problem with the update function (The plugin gets the functions from Kodi website), I'll have to look into it also. Damn why can't stuff just work always and never break. :cry:

jonib
XBMC2 plugin to control XBMC. If you want to flatter me Image
fuxxi
Posts: 12
Joined: Mon Apr 25, 2016 9:00 pm

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by fuxxi »

I hope it is ok to link to my question here:

viewtopic.php?f=2&t=8128#p40122

Iam using the RC6 USB eHome Reciver HP 5187-4593 and a logitech harmony remote to control Kodi on my PC. Its working pretty good so far. However if I want to send emulated keystrokes to Kodi, Kodi must be an active window and the keystrokes are not shown as Event in Eventghost, so that I cant assign the events to macros.

What I basically want to know:

Is it possible to somehow make the emulated keystrokes ('o' for example) visible in EG and assign them to macros in the XBMC2 plugin (without Kodi being active)? As I mentioned above its technically functional already and the keystroke 'o' is send to Kodi and working fine when Kodi is the active window. But the keystroke is also send to any other application, depending on the windows focus.
So what I want is to filter all IR commands coming through the RC6 USB receiver in EG and send them directly to Kodi (and only to Kodi).
I think it should be possible for EG to listen on the RC6 USB Receiver and just grab all commands, which are coming in?

Iam using Windows 10 64 Bit and the "Microsoft MCE Remote Plugin" with the "Disable HID service" option checked. The "Microsoft MCE Remote Plugin - Vista/Win7" is buggy as hell for me.

Ive been searching around for weeks now on this topic, but with no success yet. :-( I have also searched for other 3rd party programs to somehow filter/grab all commands coming through the RC6 receiver and send them to EG or even better directly to Kodi.
User avatar
Luca Brasi
Experienced User
Posts: 262
Joined: Sat Oct 11, 2008 12:39 pm

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by Luca Brasi »

You should have a look at the mce plugin for that. Make sure you got the latest version of it here from the forums. The mce plugin should take care of intercepting the hid commands. If the commands keep triggering on the system level as well uninstall the hid device in the device manager. You might have to repeat that a couple of times. The device might get installed again on reboot but in my case after the third or fourth reboot/uninstall it got solved in mysterious ways...
Win10 x64 Prof. / Eventghost latest / MCE Plugin / MCE RC6 Receiver / Logitech Harmony Hub / MediaPortal / kodi
fuxxi
Posts: 12
Joined: Mon Apr 25, 2016 9:00 pm

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by fuxxi »

Luca Brasi wrote:You should have a look at the mce plugin for that. Make sure you got the latest version of it here from the forums. The mce plugin should take care of intercepting the hid commands.
Ok im gonna ask my question there. Jesus, this is not easy. :(

If anybody in this thread has any idea, please post back :)


Edit:

I just can confirm that this is definately a problem with the MCE Remote Plugin. With the new plugin "MCE Remote - Vista/Win7" the converted keyboard strokes are recognized in EG. However this plugin is very buggy. For anybody who wants to help, You can read my post here:

viewtopic.php?f=9&t=6044&p=40127&hilit=config#p40127
fuqit2
Posts: 16
Joined: Sat May 14, 2016 6:49 pm

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by fuqit2 »

hey
After days of reading, searching, trial and error my head is going to explode. I'm not a python expert but have successfully created several scripts that do what I need but this one has go me by the nads.

What I'm trying to do is take the payload from any given live tv channel number and then create an event ghost event based on what the channel number is. In other words, when this event XBMC2.Player.OnPlay.channel happens, find out what channel it is, trigger an eg event that says channel "xxx"

I would be eternally grateful for any help.


edit disregard got it
User avatar
Luca Brasi
Experienced User
Posts: 262
Joined: Sat Oct 11, 2008 12:39 pm

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by Luca Brasi »

Hey guys,

I am running my htpc with different configurations for audio and video. Audio can be given out to headset, TV and AVR. Video to TV and Beamer. Now as headset and TV are stereo and the amp is capable of 7.1 I'd like to set the bitstreaming paththrough setting in kodi accordingly. If the amp is active the setting in kodi should be active.
Could anyone of you help me with setting this up? As far as I understand it should be possible by json and settings/set settingsvalue command. My skills with json and kodi are like none. So I'd appreciate some help a lot....
Win10 x64 Prof. / Eventghost latest / MCE Plugin / MCE RC6 Receiver / Logitech Harmony Hub / MediaPortal / kodi
blaher
Experienced User
Posts: 487
Joined: Thu Nov 17, 2011 1:27 am

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by blaher »

Luca Brasi wrote: If the amp is active the setting in kodi should be active.
I'd like to know how to do this too. I'm sick of Kodi forgetting my sound settings because I've started it with the receiver off.
jonib
Plugin Developer
Posts: 1328
Joined: Thu Mar 26, 2009 9:33 pm
Location: Sweden

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by jonib »

Luca Brasi wrote:I am running my htpc with different configurations for audio and video. Audio can be given out to headset, TV and AVR. Video to TV and Beamer. Now as headset and TV are stereo and the amp is capable of 7.1 I'd like to set the bitstreaming paththrough setting in kodi accordingly. If the amp is active the setting in kodi should be active.
Could anyone of you help me with setting this up? As far as I understand it should be possible by json and settings/set settingsvalue command. My skills with json and kodi are like none. So I'd appreciate some help a lot....
I did a quick look and for some reason the setSettingsvalue command is not available via the XBMC2 plugin, don't know why I'll try to find out. Unfortunately my brain is on low power and I haven't been able to do anything useful for a while again, so don't know when.

This thread talks about using a external command maybe a (temporary) solution?

Then there is the XBMC2->Unrecognized actions->AudioToggleDigital action, it toggles passthrough On/Off. Maybe it's what you need?

jonib
XBMC2 plugin to control XBMC. If you want to flatter me Image
blaher
Experienced User
Posts: 487
Joined: Thu Nov 17, 2011 1:27 am

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by blaher »

jonib wrote: This thread talks about using a external command maybe a (temporary) solution?
jonib
Cheers, I figured it out from that link.

You need to look at the Kodi log file to find the big long alpha-numeric of the sound device you want to use:
Click start, type:
%appdata%
press enter, which will give you the C:\Users\YOURuserNAME\AppData\Roaming folder.

Click on Kodi, then kodi.log and scroll until you see all your sound devices.

Code: Select all

{"setting": "audiooutput.audiodevice", "value": "DIRECTSOUND:{18EA932A-B9BE-4033-A5D4-0A5009B22EA8}"}
Wasapi device passthrough:

Code: Select all

{"setting": "audiooutput.passthroughdevice", "value": "WASAPI:{18EA932A-B9BE-4033-A5D4-0A5009B22EA8}"}
Attachments
2Capture.JPG
Capture.JPG
User avatar
Luca Brasi
Experienced User
Posts: 262
Joined: Sat Oct 11, 2008 12:39 pm

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by Luca Brasi »

Hey guys,

thank you very much for your replies!
With your infos and those in the link to the kodi forums I could find a solution as well. I don't have the setsettingvalue in xbmc2 plugin so I went with the curl option. Jonip mentions this as well. How come you have it blaher? Which version of the plugin are you running?
With curl I had to trigger it from a linux machine cause I couldn't make it work on windows. Seems to be some formatting issue in the curl statement I couldn't figure out so I went with the linux option via ssh. Of course I'll go with the direct solution in the plugin as soon as jonib has worked it out.

In my case toggle the bitstreaming option in kodi is sufficient. I always use the default device there. Changing that is handled separately on os level with Audio switcher and hotkeys. This is the statement I use from linux for bitstreaming on ("value":true):

Code: Select all

curl -v -H "Content-type: application/json" -X POST -d '{"jsonrpc":"2.0","method":"Settings.SetSettingValue", "params": "setting":"audiooutput.passthrough","value":true},"id":1}' http://myhtpc:8080/jsonrpc
And jonib thanks for your useful infos and the great work you do on the plugin. Still a lot from a tired brain :-)

[Edit:] Dude I feel dumb now. The setsettingvalue is sitting in the settings namespace in the plugin's json menu... Should have had a look there too :-) I'll check it out right away...
Win10 x64 Prof. / Eventghost latest / MCE Plugin / MCE RC6 Receiver / Logitech Harmony Hub / MediaPortal / kodi
blaher
Experienced User
Posts: 487
Joined: Thu Nov 17, 2011 1:27 am

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by blaher »

Luca Brasi wrote: [Edit:] Dude I feel dumb now. The setsettingvalue is sitting in the settings namespace in the plugin's json menu... Should have had a look there too :-) I'll check it out right away...
It only appeared for me afterwards too. I was going to do a screenshot, but it worked without it, just by copying and pasting the code, so I didn't want to confuse. You shouldn't need to use curl...that's amateur hour, bush league stuff. :)
User avatar
Luca Brasi
Experienced User
Posts: 262
Joined: Sat Oct 11, 2008 12:39 pm

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by Luca Brasi »

You shouldn't need to use curl...that's amateur hour, bush league stuff. :)
Yeah but it works so far :-) I can't get it to work directly from the plugin.
If I enter the string
{"setting":"audiooutput.passthrough","value":true}
exactly as in the curl statement and fitting your example I will get

Code: Select all

13:45:54      ValueError: malformed string
I tried your approach with defining one of my audio cards and it works. I guess this is somehow related to the fact that my "value" is not a string and is not supposed to be put in quotation.
Any ideas?

[Edit] I figured it out by trial and error and pure luck because I didn't find any helpful info... The trick was to use
{"setting": "audiooutput.passthrough","value": True}
with the True with a capital T differing from the curl where I had to use true. No f clue why but it works now... :-)
Win10 x64 Prof. / Eventghost latest / MCE Plugin / MCE RC6 Receiver / Logitech Harmony Hub / MediaPortal / kodi
Post Reply