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.
builderjer wrote:I am trying to use JSON to get which window is open in XBMC. I guess I have no idea on how to achieve that.
Interestingly (and lucky you ) I've been looking into how to find out where the user is and what the user is doing in XBMC(Kodi).
You were in the right track with GetProperties. Specifically you need to use a JSONRPC action with Namespace:"GUI" and Method:"GetProperties" parameter: [["currentwindow"]]
You can access the results with eg.result["currentwindow"]["id"] or eg.result["currentwindow"]["label"].
You might need to use JSONRPC XBMC.GetInfoLabels to get more information. If I know more specific what you want to do I can help more.
jonib
XBMC2 plugin to control XBMC. If you want to flatter me
Thank you for the quick response. That worked perfect. I'm new to eventghost, but really enjoy the possibilities of it. I'm sure I will be posting more as I go
OK, so I have another question. I am trying to learn to use JSON to notify me of when media is playing. I want to use the Player.OnPlay method, but it doesn't seem to be available in the options provided. Is there a way that I can code this into a python script to achieve this?
I guess what I'm trying to do is receive the raw event sent from XBMC and process that with an action.
For example:
When a video is selected to play and starts, I want EventGhost to process that and ExclusiveEnable a specific folder.
When the video stops, I want it to ExclusiveEnable a different folder.
Any ideas on how I can accomplish this?
Last edited by builderjer on Wed Nov 19, 2014 3:15 pm, edited 1 time in total.
I am trying to learn to use JSON to notify me of when media is playing.
Nice
I want to use the Player.OnPlay method, but it doesn't seem to be available in the options provided. Is there a way that I can code this into a python script to achieve this?
That's a notification (event) and you just need to activate "JSON-RPC notifications" in XBMC2s settings. You also need to activate UPnP in XBMC(Kodi). After that you would get all events from XBMC and you can do whatever you want with them.
jonib
XBMC2 plugin to control XBMC. If you want to flatter me
builderjer wrote:This is my log. It only shows it as a notification, not an event.
Those are "Raw" events just used for debugging, so you should turn that off. You need to disable the "Log only assigned and activated events" to see all events.
jonib
XBMC2 plugin to control XBMC. If you want to flatter me
I did have to leave the "Raw Events" checked, otherwise it didn't show the events from them.
That would be a bug then, mind posting a new screenshot of the log with RAW events and normal events? I'll check on my system too a bit later with Gotham and Helix
jonib
XBMC2 plugin to control XBMC. If you want to flatter me