XBMC Plugin
This is an idea to include XBMC support inside of InControl. If you are intersted in this plugin, please leave us a comment with the interaction you would like between InControl and XBMC.
-
Laz commented
i have try david fix but is not working with the new xbmc version
-
Laz commented
im interested on this too
-
Tyler commented
I am using an XBMC script called Cinema Experience.
It does a lot of things including playing trivia slides MPAA rating videos and streaming trailers.
But it also has a home automation section to it.
I had to do some modification to the code, but it was a simple copy/paste of this line:
urllib2.urlopen('http://192.168.1.5:1178/zwave/activateSceneGet?sceneName=PauseMovie')The script has a few bugs that I'm hoping get worked out but it looks very promising.
-
Chris commented
I'd like to see this feature implemented. Recently replaced my XBOX1 that running XBMC with an Intel NUC running XBMC.
I'm thinking most of the config should be done on the InControl server and then the XBMC plugin sends the events/commands to control the InControl server.
-
Marc commented
@David
I like this script but i think this is achievable using tasker now that the incontrol plugin has been released
-
Anonymous commented
I would like to be able to do what David is doing with his script files.
-
Jack commented
I would like to be able to control my devices from inside XBMC and see the status of the devices as well.
-
David commented
I have fixed issues with my script to allow XBMC to send commands to InControl. This script will dim lights when player starts playing a movie, is paused, or stopped or ends. You will need to create three scenes: PlayMoive, PauseMovies, and StopMovie for the lights you wish to control when using XBMC.
Place the following script in a folder called scripts in the XBMC root directory also you will need to add or create the script autoexec.py under the userdata directory:
example:
____________________________________
import os
import xbmc
xbmc.executescript('special://home/scripts/playeraction.py')____________________________________
This is the playeraction script in the scripts folder. Edit the IP address to the IP of the machine on your network running InControl. I added notifications these can be commented out by placing adding a # the start of lines that start with xbmc.executebuiltin
____________________________________
import xbmc,xbmcgui
import urllib2
import subprocess,os
class MyPlayer(xbmc.Player) :
def __init__ (self):
xbmc.Player.__init__(self)def Paused(self):
xbmc.Player.pause()
xbmc.executebuiltin('Notification(Player Paused 1,Increase lights - Video: %d 1,5000,special://home/scripts/1.png)'%(VIDEO))
urllib2.urlopen('http://192.168.1.5:1178/zwave/activateSceneGet?sceneName=PauseMovie')
def onPlayBackStarted(self):
if xbmc.Player().isPlayingVideo():
VIDEO = 1
xbmc.log("Movie is playing time to turn off the lights")
xbmc.executebuiltin('Notification(Player Started,Dimming lights - Video: %d,5000,special://home/scripts/1.png)'%(VIDEO))
urllib2.urlopen('http://192.168.1.5:1178/zwave/activateSceneGet?sceneName=PlayMovie')def onPlayBackEnded(self):
VIDEO = 0
xbmc.log("The movie has ended time to turn on the lights")
xbmc.executebuiltin('Notification(Player Ended,Increase lights - Video: %d,5000,special://home/scripts/1.png)'%(VIDEO))
urllib2.urlopen('http://192.168.1.5:1178/zwave/activateSceneGet?sceneName=StopMovie')def onPlayBackStopped(self):
VIDEO = 0
xbmc.log("Movie is stopped time to turn on the lights")
xbmc.executebuiltin('Notification(Player Stopped,Increase lights - Video: %d,5000,special://home/scripts/1.png)'%(VIDEO))
urllib2.urlopen('http://192.168.1.5:1178/zwave/activateSceneGet?sceneName=StopMovie')
def onPlayBackPaused(self):
if xbmc.Player().isPlayingVideo():
VIDEO = 0
xbmc.log("Movie is paused time to turn up the lights")
xbmc.executebuiltin('Notification(Player Paused,Increase lights - Video: %d,5000,special://home/scripts/1.png)'%(VIDEO))
urllib2.urlopen('http://192.168.1.5:1178/zwave/activateSceneGet?sceneName=PauseMovie')
def onPlayBackResumed(self):
if xbmc.Player().isPlayingVideo():
VIDEO = 1
xbmc.log("Movie is resumed time to turn down the lights")
xbmc.executebuiltin('Notification(Player Resumed,Dimming lights - Video: %d,5000,special://home/scripts/1.png)'%(VIDEO))
urllib2.urlopen('http://192.168.1.5:1178/zwave/activateSceneGet?sceneName=PlayMovie')
Player=MyPlayer()
VIDEO = 0
while(1):
if xbmc.Player().isPlaying():
if xbmc.Player().isPlayingVideo():
VIDEO = 1
else:
VIDEO = 0
xbmc.sleep(1000) -
David commented
I think it might be easier to make an add-on for XBMC to list devices and or execute scenes when the player starts, is paused, is resumed, or ends. I have this working on a PC os (laptop running XBMC) but I am having issues with lights coming back up on Android stick running XBMC when player is paused, ends, or is stopped.
However, I'm not sure what you have in mind. I like both InControl and XBMC. Getting the two to work together would be awesome.
-
Rod Ferris commented
You can do this right now on Frodo with a simple Get request.. you could create scenes which fire these requests
Re: http://wiki.xbmc.org/?title=JSON-RPC_API#GET
Here is how to add the code in C#
http://support.microsoft.com/kb/307023 -
Anonymous commented
The user should be able to control the player and the program from a single interface.
The program must monitor the status of the player. When I run the video should turn off the light in the living room. When I turn on the music, you have to switch the controller RGB LED backlight mode light music rooms.