Can XBMC output events based on menu selections in XBMC?
#1
Evening all

I would like to automate my HTPC with my AV receiver a little bit.

I can use eventghost in windows to control My AV receiver (select input, set default volume, set surround mode etc), but what i need to do is somehow log what i am doing in XBMC in an event server (Eventghost) so that i can link it to commands for my AV receiver.

For example. When i click on MUSIC i would like XBMC to log an event, so that i can link that to a command to set my AV receiver to stereo mode. Then when i click on VIDEO again, it would then change my receiver to Surround mode.

Now, there is a plugin for eventghost called "XBMC Event Receiver" which sounds exactly what i'm looking for, (i havent yet got it to work though) although ive read this in the wiki:

"EventServer Cons
currently cannot send any information back to clients. This is a planned feature."

so based on this, i cant figure out if this is possible or not.

Any thoughts guys?
Reply
#2
Not sure of this helps, but I have a remote control made by a company called RTI. I have the handheld remote and there is a processor as well that can store macros on it. So, when i press on one button on the remote it can run a macro that will turn on/off whatever I like, switch to whatever inputs I wish, etc...
It has the ability to use discrete comands which gives me the ability to completly control all my equipment very reliably and works 100% of the time.

So, when i want to watch a movie on XBMC, I simply hit the "XBMC" premade button which engages the macro (turns on my TV, AV R, etc..)

The RTI remote & processor are very powerful and can be set up to control whatever you wish and run a macro with whatever commands you like..

Take a look at RTI as I am sure that it is a solution that could help...
KODI 16.1 on Odroid C2, Android OS, Roku Clients w/ Plex, Dell R710 Rack Server w/ 40TB storage
Reply
#3
Hi Shane.

Thanks for the suggestion.

I currently have a remote control that works just as i like it, so i was hoping that i could do it this way.

Thanks for your input though.
Reply
#4
Any more thoughts on this guys?

Thanks
Reply
#5
Its a good idea and one which we have discussed earlier to add to json-rpc. However, it hasn't been many who have needed this just yet so it hasn't been prioritized.
If you could list exactly what you need and why (as detailed as possible) this would be greatly appreciated. We are in the middle of discussing additions and cleaning of the API and any ideas is greatly appreciated.
If you have problems please read this before posting

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.

Image

"Well Im gonna download the code and look at it a bit but I'm certainly not a really good C/C++ programer but I'd help as much as I can, I mostly write in C#."
Reply
#6
Hi. Thanks for the message.

I think it would be a very useful feature, i did have a quick look at the json-rpc on the wiki page i think it was.. it looked rather complex!!

Basically, i would like SIMPLE Events that i can then logged into Eventghost (or any other event client) so i can use these events to trigger other commands for other programs.

for example. If i select Music through the xbmc menu, i would like a simple event logged that states:

MUSIC SELECTED

something simple like that.

If it were more complex eg MUSIC.SELECTED.DATE.HOUR.MINUTE.SECOND..... then that could be tricky because the event would be different every time therefore making it difficult to use that event to trigger another event. It needs to be repeatable.

as a further example. if i were to boot XBMC. select MUSIC, then select the Artist PEARL JAM, then the song YELLOW LEDBETTER. Then once the song has finshed, i go back to the menu and select VIDEO, then MOVIES, then TERMINATOR 2. The event list logged would ideally look something like this (on the right is what i could do with these events)

XBMC LOADED

MUSIC SELECTED -------------------- SET AV AMPLIFIER TO STEREO MODE (i dont want my music in dolby prologic!!) -
------------------------------------------------- SET AV AMPLIFIER VOLUME TO -40dB
ARTIST
PEARL JAM
TRACK
YELLOW LEDBETTER.mp3
VIDEO -------------------------------------- SET AV AMPLIFIER TO SURROUND MODE (Its movie time) -
------------------------------------------------- SET AV AMPLIFIER VOLUME TO -35dB -
------------------------------------------------- DIM THE LIGHTS -
------------------------------------------------- CLOSE THE CURTAINS
MOVIES
TERMINATOR 2.mkv

This is just an example. although the main thing is that it is logged as a simple list of events, so it can be easily used to drive other things.

you could expand on this to use the file extension of the file selected, then you could trigger commands based on the type of file, so using the above as an example again, and if XBMC could ignore the file names, but use the file extenstions, you could do this:

XBMC LOADED

MUSIC SELECTED -------------------- SET AV AMPLIFIER TO STEREO MODE (i dont want my music in dolby prologic!!) -
------------------------------------------------- SET AV AMPLIFIER VOLUME TO -40dB
ARTIST
PEARL JAM
TRACK
MUSIC_TRACK.mp3 ------------------ mp3 FILE - STAY IN STEREO MODE
or.....
MUSIC_TRACK.ac3 ------------------- ac3 FILE - MULTI-CHANNEL MUSIC - SELECT SURROUND MODE (This could be espcecially useful now we have the nw AudioEngine)

VIDEO -------------------------------------- SET AV AMPLIFIER TO SURROUND MODE (Its movie time) -
------------------------------------------------- SET AV AMPLIFIER VOLUME TO -35dB -
------------------------------------------------- DIM THE LIGHTS -
------------------------------------------------- CLOSE THE CURTAINS
MOVIES
VIDEO.mkv

as far as list of requirements, i guess the following would be the events that i would find useful

MUSIC SELECTED
VIDEO SELECTED
XBMC SHUTDOWN
STOPPED
PAUSED
PLAY

Im sure there are plenty of other useful ones, but that is all i can think of right now (i dont have XBMC in front of me). I guess it could log all sorts of things, we would just choose what we wanted to use as triggers for other events. As long as it didnt overload the event client though.
Reply
#7
From what I read out it sounds like you are more interested in actual playback hooks rather than music window? I mean you could enter video window and music will start (think if another remote were to send a play music event).

I'd suggest you to look at the player.OnPlaybackStarted (or what the name is) instead. They exist in python and json-rpc and afaict should provide what you want?
If you have problems please read this before posting

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.

Image

"Well Im gonna download the code and look at it a bit but I'm certainly not a really good C/C++ programer but I'd help as much as I can, I mostly write in C#."
Reply
#8
Hi

Thanks for that, ill have a look into it some more.

Thanks for your help
Reply
#9
Hello,
I would like to second champ222:
There are several excellent xbmc remotes for android, but unfortunately for me volume control built into remotes control system volume while I would like them to control volume on AVR (AVR volume can be controled by event ghost via rs-232 port).
There are couple of reasons why I would like to control volume on AVR:
1. I think decreasing volume on HTPC before it gets digitally passed to AVR decreases dynamic range
2. When XBMC is configured to bitstream encoded audio to AVR, system level volume controls are ineffective.
So if event server could log VolumeUp/DOWN commands to eventghost I could configure it to change volume on AVR.
Reply
#10
This is a good use for XBMC Event logging. Thanks for adding to this dumshd.

The possibilies of this are endless, and XBMC could be the hub for home automation if it could log the appropriate events. Other software/hardware exists to make these events do whatever we like.


(2012-09-18, 14:38)topfs2 Wrote: From what I read out it sounds like you are more interested in actual playback hooks rather than music window? I mean you could enter video window and music will start (think if another remote were to send a play music event).

I'd suggest you to look at the player.OnPlaybackStarted (or what the name is) instead. They exist in python and json-rpc and afaict should provide what you want?

I did have a look into this, but i couldnt make much sense of it. Do you know of a tutorial that uses this? so i may be able to adapt if for my needs?

Thanks
Reply
#11
(2012-09-25, 11:20)champ222 Wrote: This is a good use for XBMC Event logging. Thanks for adding to this dumshd.

The possibilies of this are endless, and XBMC could be the hub for home automation if it could log the appropriate events. Other software/hardware exists to make these events do whatever we like.


(2012-09-18, 14:38)topfs2 Wrote: From what I read out it sounds like you are more interested in actual playback hooks rather than music window? I mean you could enter video window and music will start (think if another remote were to send a play music event).

I'd suggest you to look at the player.OnPlaybackStarted (or what the name is) instead. They exist in python and json-rpc and afaict should provide what you want?

I did have a look into this, but i couldnt make much sense of it. Do you know of a tutorial that uses this? so i may be able to adapt if for my needs?

Thanks

There are plenty, if you have enabled the right stuff in settings (can't recall which) you just need to telnet IP:9090 and you should get a bunch of events. There are plenty of Python playback notification examples in wiki. So note there are 2 different ways of getting playback notifications

If you have problems please read this before posting

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.

Image

"Well Im gonna download the code and look at it a bit but I'm certainly not a really good C/C++ programer but I'd help as much as I can, I mostly write in C#."
Reply

Logout Mark Read Team Forum Stats Members Help
Can XBMC output events based on menu selections in XBMC?0