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.
ntk1
Posts: 19
Joined: Sat Nov 24, 2012 6:25 am

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by ntk1 »

jonib wrote:
ntk1 wrote:i'm using onkyo iscp and select command, this is the commands
I can't test as I don't have your amp, but this should work. :roll:

Put a "Python command" action in the macro, then put the below code in it.

Code: Select all

eg.plugins.OnkyoISCP.SendCommand(u'MVL'+str(eg.event.payload["volume"]))
It should send a MVL+volume to your amp.

jonib
thanks! this is working

but i have a problem, because my amp goes up to MVL57 (volume 87 max) and from volume 32 down it goes MVL1F / MVL1d / MVL1e

and XBMC goes from 1-100 so this is working but i want to do it manually, so i need to do 100 command

MVL57-XBMC 100
MVL56-XBMC 99
MVL55-XBMC 98...

how can i do that, i tried few combination but did not work, example :lol:

eg.plugins.OnkyoISCP.SendCommand(u'MV57' str(eg.event.payload["volume: 100'"]))

:oops:
miljbee
Experienced User
Posts: 146
Joined: Fri Mar 27, 2009 1:29 pm
Location: Orl├®ans, France

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by miljbee »

Apparently, you need to transcode XBMC Vol level to your amp vol level.

When looking at your amp commands, I see that the vol level is hex encoded.

So what you need to do it transcode 0-100 to 0-87, then convert the result to hex, then send the hex value to your amp.

Assuming the vol levels are linear, it should be easy.

Something like :

Code: Select all

xbmc = int(eg.event.payload['volume'])
amp = int(xbmc*0.87)
ampHex = hex(amp)[2:].upper()
ampCommand = "MVL" + ampHex
eg.plugins.OnkyoISCP.SendCommand(ampCommand)
Of course, you will have to put this in a python script rather than a python command. Or just for fun, you can put this in a python command :

Code: Select all

eg.plugins.OnkyoISCP.SendCommand("MVL" + hex(int(int(eg.event.payload['volume'])*0.87))[2:].upper())
miljbee
TCP Events : A Better Network Event Sender/Receiver Plugin.
The Network Event Sender/Receiver in C#
Get events in EG from Google Calendar.
ntk1
Posts: 19
Joined: Sat Nov 24, 2012 6:25 am

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by ntk1 »

this is working great but from 1-16 the commands are

MVL00
MVL02
MVL03
MVL04
MVL05
MVL07
MVL09
MVL0A
MVL0B
MVL0C
MVL0D
MVL0E
MVL0F

and its not working ( there are also a 5-6 commands with letters between 17-87 that is not working ) there is a way to make all commands with letters also work? or i can just do the letters manually one by one but i don't know how

thanks for the help!
Last edited by ntk1 on Wed Feb 27, 2013 4:54 pm, edited 1 time in total.
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 »

ntk1 wrote:this is working great but from 1-16 the commands are
Try this:

Code: Select all

hex(int(int(eg.event.payload['volume'])*0.87))[2:].zfill(2).upper()
and its not working ( there are also a 5-6 commands with letters between 17-87 that is not working ) there is a way to make all commands with letters also work?
What commands are not working?

jonib
XBMC2 plugin to control XBMC. If you want to flatter me Image
ntk1
Posts: 19
Joined: Sat Nov 24, 2012 6:25 am

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by ntk1 »

jonib wrote:
ntk1 wrote:this is working great but from 1-16 the commands are
Try this:

Code: Select all

hex(int(int(eg.event.payload['volume'])*0.87))[2:].zfill(2).upper()
and its not working ( there are also a 5-6 commands with letters between 17-87 that is not working ) there is a way to make all commands with letters also work?
What commands are not working?

jonib
https://dl.dropbox.com/u/85710841/New%2 ... cument.txt

this is the list of all the volume commands, all the commands with the letters after the numbers are not working

also i wanted to know if there is a way to bypass the volume lock in XBMC when its in passthrough mode, because the volume bar is locked i cant change the volume in the amp when watching a movie
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 »

ntk1 wrote:this is the list of all the volume commands, all the commands with the letters after the numbers are not working
I'm sorry for being daft but "not working" is not that helpful to figure out what is not working.
also i wanted to know if there is a way to bypass the volume lock in XBMC when its in passthrough mode, because the volume bar is locked i cant change the volume in the amp when watching a movie
If I understand it correctly XBMC can't influence the volume in the passthrough mode (as the audio data goes directly to the decoder), so the volume control is disabled in XBMC.

Just a question why don't you control the amps volume directly? I never use the XBMCs volume as I control my speakers directly.

jonib
XBMC2 plugin to control XBMC. If you want to flatter me Image
ntk1
Posts: 19
Joined: Sat Nov 24, 2012 6:25 am

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by ntk1 »

jonib wrote:
ntk1 wrote:this is the list of all the volume commands, all the commands with the letters after the numbers are not working
I'm sorry for being daft but "not working" is not that helpful to figure out what is not working.
also i wanted to know if there is a way to bypass the volume lock in XBMC when its in passthrough mode, because the volume bar is locked i cant change the volume in the amp when watching a movie
If I understand it correctly XBMC can't influence the volume in the passthrough mode (as the audio data goes directly to the decoder), so the volume control is disabled in XBMC.

Just a question why don't you control the amps volume directly? I never use the XBMCs volume as I control my speakers directly.

jonib

im sorry i will try to explain

all the commands with the letters in the end he will skip, so for example if mvl19 is 19 on the amp, mvl1A 1B... it will skip and continue when the commands are again only numbers, but MVL20 is already 30 in the amp not 20 ( so he skip on 20 21 22...and jump to 30 ) this is very stupid, don't know why this is not just 1-100 and have to be so complicated with all the letters :evil:

OnkyoISCP.MVL '19'
OnkyoISCP.MVL19
OnkyoISCP.MVL '1A'
OnkyoISCP.MVL1A
OnkyoISCP.MVL '1A'
OnkyoISCP.MVL1A
OnkyoISCP.MVL '1B'
OnkyoISCP.MVL1B
OnkyoISCP.MVL '1B'
OnkyoISCP.MVL1B
OnkyoISCP.MVL '1C'
OnkyoISCP.MVL1C
OnkyoISCP.MVL '1C'
OnkyoISCP.MVL1C
OnkyoISCP.MVL '1D'
OnkyoISCP.MVL1D
OnkyoISCP.MVL '1E'
OnkyoISCP.MVL1E
OnkyoISCP.MVL '1E'
OnkyoISCP.MVL1E
OnkyoISCP.MVL '1F'
OnkyoISCP.MVL1F
OnkyoISCP.MVL '1F'
OnkyoISCP.MVL1F
OnkyoISCP.MVL '20'


because im using YATSE (android remote) and i want to control the amp vol from within YATSE, maybe the only solution is CEC adapter, i also made shortcuts on the home screen for up \ down vol instead using onkyo app, it take time to load every time you switch from YATSE, but still prefer to have the option to control the amp directly from YATSE, for now im using this great XBMC plugin for eventghost to control my smart home, turn the light when start watching a movie, led strip activated by sound turn on with the music and etc
miljbee
Experienced User
Posts: 146
Joined: Fri Mar 27, 2009 1:29 pm
Location: Orl├®ans, France

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by miljbee »

I can't understand your problem.
don't know why this is not just 1-100 and have to be so complicated with all the letters
Do you understand that :
"A" is the hexadecimal represention of 10 (decimal representation)
"10" is the hexadecimal represention of 16 (decimal representation)
miljbee
TCP Events : A Better Network Event Sender/Receiver Plugin.
The Network Event Sender/Receiver in C#
Get events in EG from Google Calendar.
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 »

ntk1 wrote:all the commands with the letters in the end he will skip, so for example if mvl19 is 19 on the amp, mvl1A 1B... it will skip and continue when the commands are again only numbers, but MVL20 is already 30 in the amp not 20 ( so he skip on 20 21 22...and jump to 30 ) this is very stupid, don't know why this is not just 1-100 and have to be so complicated with all the letters :evil:
This sounds like you should ask in the OnkyoISCP plugin thread.

jonib
XBMC2 plugin to control XBMC. If you want to flatter me Image
nonob
Experienced User
Posts: 76
Joined: Tue Dec 06, 2011 6:52 am

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by nonob »

Hi :)

I recently updated my xbmc eden to frodo.

I was using "open playlist" command with HTTP API (see my post viewtopic.php?f=9&t=1562&hilit=JSON+pla ... 435#p21960) but with frodo this API doens't exist anymore.

So i tried to do the same thing with JSON but i don't know how..

I tried to add command Player.Open but when i open JSONRPC action, commands are empty, and if i try to do "update", i have this error message:

Code: Select all

Error opening: jsonrpc.dat
Traceback (most recent call last) (1610):
  File "C:\Program Files\EventGhost\plugins\XBMCRepeat\__init__.py", line 914, in OnUpdate
    UpdateMethods()
  File "C:\Program Files\EventGhost\plugins\XBMCRepeat\__init__.py", line 929, in UpdateMethods
    responce = self.plugin.JSON_RPC.send('JSONRPC.Version')
  File "C:\Program Files\EventGhost\plugins\XBMCRepeat\__init__.py", line 681, in send
    return json.loads(responce)
  File "json\__init__.pyc", line 307, in loads
  File "json\decoder.pyc", line 319, in decode
  File "json\decoder.pyc", line 338, in raw_decode
ValueError: No JSON object could be decoded
This is a screenshot:

Image

I'm using xbmc frodo on windows xp SP3.

Thanks for your help.
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 »

nonob wrote:I tried to add command Player.Open but when i open JSONRPC action, commands are empty, and if i try to do "update", i have this error message:
Are you using the test release posted here, as that is needed for Frodo support. I'll try to release a Frodo supporting proper release (I'll probably update the version that is in EventGhost without the new event stuff, as they are not ready :evil: :cry: )

jonib
XBMC2 plugin to control XBMC. If you want to flatter me Image
nonob
Experienced User
Posts: 76
Joined: Tue Dec 06, 2011 6:52 am

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by nonob »

Hi,

I"m using EG 0.4.1.r1610 and xbmc2 provided within.(Is ther a file where i can read your plugin version without running EG?)

So i will try with with the frodo version from the link you gave me.
I'll probably update the version that is in EventGhost without the new event stuff
By "new event stuff" you mean "new EG version" ?

If it works, can you tell me the way to play a playlist with JSON ?

Thanks
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 »

nonob wrote:I"m using EG 0.4.1.r1610 and xbmc2 provided within.(Is ther a file where i can read your plugin version without running EG?)
You can look in the plugin file "(EventGhost install dir)\plugins\XBMCRepeat\__init__.py", but you can't check the test versions as they have the same version number. :shock:
By "new event stuff" you mean "new EG version" ?
No the new JSON-RPC notifications and broadcast events, I have been working on them for a while, and only released test versions as I'm not finished yet.
If it works, can you tell me the way to play a playlist with JSON ?
I haven't found a way to open a playlist directly with JSON only to open files and put files in XBMCs internal playlist. I think you need to ask in the XBMC forum for a way, and I'll add it to the plugin if there's a way.

jonib
XBMC2 plugin to control XBMC. If you want to flatter me Image
nonob
Experienced User
Posts: 76
Joined: Tue Dec 06, 2011 6:52 am

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by nonob »

nonob wrote:I"m using EG 0.4.1.r1610 and xbmc2 provided within.(Is ther a file where i can read your plugin version without running EG?)

You can look in the plugin file "(EventGhost install dir)\plugins\XBMCRepeat\__init__.py", but you can't check the test versions as they have the same version number. :shock:
Ok, i found it, thanks.

So i installed 0.6..3e and now it seems to work better but i have this error message at EG start :

JSON-RPC event settings reset, please check.

This is the complete log:

Code: Select all

---> Bienvenue dans EventGhost <---
D├®marrage automatique
   Greffon: IgorPlug-USB
   Greffon: XBMC2
      JSON-RPC event settings reset, please check.
      JSON-RPC connected
      HTTP API connected
   Greffon: Media Player Classic
   Greffon: Task Create/Switch Events
   Greffon: Windows Media Player
   Greffon: MediaMonkey
   Greffon: Speech
   Greffon: Broadcaster
   Greffon: Webserver (Serveur Web)
   Greffon: Joystick
I'm surprised to see "HTTP API connected", i thought it was no longer available with frodo ? isn't it ?
If it works, can you tell me the way to play a playlist with JSON ?

I haven't found a way to open a playlist directly with JSON only to open files and put files in XBMCs internal playlist. I think you need to ask in the XBMC forum for a way, and I'll add it to the plugin if there's a way.
:cry: , i often used

Code: Select all

PlayFile(filename;[playlist])
with http api.
Is ther another way to do the same thing without json ?

I posted on xbmc forum as you recommanded to me,
http://forum.xbmc.org/showthread.php?ti ... pid1356622

and someone reply to me:

Player.Open using the "file" property in the "item" parameter.

So i try it but i had an error message:

Image

Thanks
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 »

nonob wrote:So i installed 0.6..3e and now it seems to work better but i have this error message at EG start :

JSON-RPC event settings reset, please check.
I had to change how the settings are stored when I added the events support, you just have to open the configuration for XBMC2 plugin check that the settings are right then save, then the error should be gone.
I'm surprised to see "HTTP API connected", i thought it was no longer available with frodo ? isn't it ?
The plugin just initializes the HTTPAPI support, it doesn't actually connect anywhere, so it doesn't know that it's not supported. I'm going to change that message.
Is ther another way to do the same thing without json ?
Looks like JSONRPC.Player.Open can play a .xsp playlist, I tried other types and XBMC always tried to show the items in the list as pictures, so it seemed not to work.

Put this code in the JSONRPC.Player.Open action, changing the "Path\\Movies.xsp" to your file of course, the slashes need to be doubled or it wont work.

Code: Select all

[{"file":"Path\\Movies.xsp"}]
jonib
XBMC2 plugin to control XBMC. If you want to flatter me Image
Post Reply