RE: [RELEASE] Cinema Experience - the new Home Theater Experience Script - mattbrowno - 2013-04-28
would anyone be able to help me set this up using teamviewer? i have the program installed and everything. I have tried tons of themes. But the cinema expereince is not working for some reason. If so message me
This is driving me NUTS!!!!! - mattbrowno - 2013-04-28
I have installed cinema experience on my xbmc and it just isnt working. It doesnt load the movie or play trailers when i click the cinema button. Any help would be GREATLY appreciated
Re: [RELEASE] Cinema Experience - the new Home Theater Experience Script - Ragnarok - 2013-04-28
Did you configure the add-on and tell it where to pull trailers and get the slides and video files to play?
RE: [RELEASE] Cinema Experience - the new Home Theater Experience Script - mattbrowno - 2013-04-28
Yes i did all that
Re: RE: This is driving me NUTS!!!!! - giftie - 2013-04-28
(2013-04-28, 18:11)mattbrowno Wrote: I have installed cinema experience on my xbmc and it just isnt working. It doesnt load the movie or play trailers when i click the cinema button. Any help would be GREATLY appreciated :D :D
The first place to start is a debug log. This will show me many things about your system, skin and script setup.
Re: RE: This is driving me NUTS!!!!! - giftie - 2013-04-28
(2013-04-28, 18:11)mattbrowno Wrote: I have installed cinema experience on my xbmc and it just isnt working. It doesnt load the movie or play trailers when i click the cinema button. Any help would be GREATLY appreciated :D :D
The first place to start is a debug log. This will show me many things about your system, skin and script setup.
RE: [RELEASE] Cinema Experience - the new Home Theater Experience Script - Ragnarok - 2013-04-28
(2013-04-28, 23:00)giftie Wrote: The first place to start is a debug log. This will show me many things about your system, skin and script setup.
I got him all taken care of giftie. No worries
RE: [RELEASE] Cinema Experience - the new Home Theater Experience Script - phsyraxion - 2013-04-29
I have started experimenting with this script and love it. I have everything figured out and working but just wanted to find out a little about the Home Automation part of the addon.
I know very little about Python but do know basic programming in C++ and Python doesn't seem much different. I have had a look at 2 different HA script files in this thread and the first (which I assume was an original) has comments to say "Add Code Here" where you could add the code you wanted to run. But the home_automation(2).py script which has been "cleaned up" does not have these pointers. In any event, I wanted to ask the following:
I have an ELK M1 automation system and the full SDK software for the system. It controls everything in my home (lights, fish tanks, media devices etc) and is simple to control from ASCII commands. I have created the following test script that will trigger the MESSAGE I send just fine:
Code: # PYTHON SCRIPT TO SEND COMMANDS TO ELK M1
# VERSION: 1.0 (30 APRIL 2013)
#
# Use the M1 SDK to generate ASCII commands
# Copy the ASCII command to the MESSAGE and replace the ^ character with \r
#
import socket
M1IP = "192.168.0.251"
M1PORT = 2101
MESSAGE=b'0Ecn0030000300D4\r'
#Code Start
srvsock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
srvsock.settimeout(3) # 3 second timeout on commands
srvsock.connect((M1IP, M1PORT))
srvsock.sendall(MESSAGE)
data = srvsock.recv(4096)
#returns result from panel (for troubleshooting)
print ("received message:", data.decode("UTF-8"))
srvsock.close()
The Message simply pulses an output for 3 seconds as a test and works perfectly. I assume I should be able to slot the code into the automation script where I would like to trigger something and it should be able to send the command to my system?
Code: # This module's future home should be inside userdata/addon_data/script.cinema.experience/ha_scripts
# to make sure it does not get over written when updating the script
import xbmc, xbmcaddon
import socket
M1IP = "192.168.0.251"
M1PORT = 2101
MESSAGE=b'0Ecn0030000300D4\r'
_A_ = xbmcaddon.Addon('script.cinema.experience')
_L_ = _A_.getLocalizedString
_S_ = _A_.getSetting
def activate_on( trigger = "None" ):
"""
Scripting to trigger almost anything(HA, other scripts, etc...) when videos start.
Usage:
activate_on( "Movie" )
will trigger code that is set under the Movie heading.
"""
if trigger == "None":
xbmc.output( "[script.cinema.experience] - [ home_automation.py ] - No Trigger Sent, Returning", level=xbmc.LOGNOTICE )
return
xbmc.output( "[script.cinema.experience] - [ home_automation.py ] - activate_on( %s ) Triggered" % trigger, level=xbmc.LOGNOTICE )
# Script Start
if trigger == _L_( 32613 ) and _S_( "ha_script_start" ) == "true":
xbmc.output( "[script.cinema.experience] - [ home_automation.py ] - %s Triggered" % _L_( 32613 ), level=xbmc.LOGNOTICE )
# place code below this line
xbmc.executehttpapi( "Broadcast(<b>CE_Automate<li>script_start</b>)" )
# Trivia Intro
elif trigger == _L_( 32609 ) and _S_( "ha_trivia_intro" ) == "true":
xbmc.output( "[script.cinema.experience] - [ home_automation.py ] - %s Triggered" % _L_( 32609 ), level=xbmc.LOGNOTICE )
# place code below this line
########################################################
srvsock.settimeout(3) # 3 second timeout on commands
srvsock.connect((M1IP, M1PORT))
srvsock.sendall(MESSAGE)
########################################################
xbmc.executehttpapi( "Broadcast(<b>CE_Automate<li>trivia_intro</b>)" )
The example above with my code between the comment lines, would that work if I wanted the event to happen on the trivia intro? I just want to be sure that what I am trying would be possible before investing time on it.
RE: [RELEASE] Cinema Experience - the new Home Theater Experience Script - phsyraxion - 2013-04-29
Tested... Doesn't work. If I add the few lines of code into the script under the #place code here part of any section, the CE script just wont run. Using the script file that came with the latest CE on Frodo I have the following:
Code: # This module's future home should be inside userdata/addon_data/script.cinema.experience/ha_scripts
# to make sure it does not get over written when updating the script
import xbmc, xbmcaddon
import socket, sys
from threading import Thread
triggers = sys.modules[ "__main__" ].triggers
ha_settings = sys.modules[ "__main__" ].ha_settings
M1IP = "192.168.0.251"
M1PORT = 2101
class Automate:
def __init__( self ):
pass
def activate_ha( self, trigger = None, prev_trigger = None, mode="thread" ):
if ha_settings[ "ha_enable" ]:
if ha_settings[ "ha_multi_trigger" ] and prev_trigger == trigger:
pass
elif mode != "thread":
self.activate_on( trigger )
else:
thread = Thread( name='ha_trigger', target=self.activate_on, args=( trigger, ) )
thread.start()
return prev_trigger
def activate_on( self, trigger = None ):
"""
Scripting to trigger almost anything(HA, other scripts, etc...) when videos start.
Usage:
activate_on( "Movie" )
will trigger code that is set under the Movie heading.
"""
if not trigger:
xbmc.log( "[script.cinema.experience] - [ home_automation.py ] - No Trigger Sent, Returning", level=xbmc.LOGNOTICE )
return
xbmc.log( "[script.cinema.experience] - [ home_automation.py ] - activate_on( %s ) Triggered" % trigger, level=xbmc.LOGNOTICE )
if trigger in triggers:
xbmc.log( "[script.cinema.experience] - [ home_automation.py ] - Trigger %s" % trigger, level=xbmc.LOGNOTICE )
# Script Start
if trigger == "Script Start" and ha_settings[ "ha_script_start" ]:
# place code below this line
pass
# Trivia Intro
elif trigger == "Trivia Intro" and ha_settings[ "ha_trivia_intro" ]:
pass
# place code below this line
srvsock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
srvsock.settimeout(3) # 3 second timeout on commands
srvsock.connect((M1IP, M1PORT))
srvsock.sendall(b'09ct01000CF4\r')
srvsock.close()
# Trivia
elif trigger == "Trivia" and ha_settings[ "ha_trivia_start" ]:
pass
# place code below this line
# Trivia Outro
elif trigger == "Trivia Outro" and ha_settings[ "ha_trivia_outro" ]:
pass
# place code below this line
# Movie Theatre Intro
elif trigger == "Movie Theater Intro" and ha_settings[ "ha_mte_intro" ]:
pass
# place code below this line
# Coming Attractions Intro
elif trigger == "Coming Attractions Intro" and ha_settings[ "ha_cav_intro" ]:
pass
# place code below this line
# Trailer
elif trigger == "Movie Trailer" and ha_settings[ "ha_trailer_start" ]:
pass
# place code below this line
# Coming Attractions Outro
elif trigger == "Coming Attractions Outro" and ha_settings[ "ha_cav_outro" ]:
pass
# place code below this line
# Feature Presentation Intro
elif trigger == "Feature Presentation Intro" and ha_settings[ "ha_fpv_intro" ]:
pass
# place code below this line
# MPAA Rating
elif trigger == "MPAA Rating" and ha_settings[ "ha_mpaa_rating" ]:
pass
# place code below this line
# Countdown
elif trigger == "Countdown" and ha_settings[ "ha_countdown_video" ]:
pass
# place code below this line
# Audio Format
elif trigger == "Audio Format" and ha_settings[ "ha_audio_format" ]:
pass
# place code below this line
# Movie
elif trigger == "Movie" and ha_settings[ "ha_movie" ]:
pass
# place code below this line
# Feature Presentation Outro
elif trigger == "Feature Presentation Outro" and ha_settings[ "ha_fpv_outro" ]:
pass
# place code below this line
# Movie Theatre Intro
elif trigger == "Movie Theatre Outro" and ha_settings[ "ha_mte_outro" ]:
pass
# place code below this line
# Intermission
elif trigger == "Intermission" and ha_settings[ "ha_intermission" ]:
pass
# place code below this line
# Script End
elif trigger == "Script End" and ha_settings[ "ha_script_end" ]:
pass
# place code below this line
# Paused
elif trigger == "Pause" and ha_settings[ "ha_paused" ]:
pass
# place code below this line
# Resumed
elif trigger == "Resume" and ha_settings[ "ha_resumed" ]:
pass
# place code below this line
else:
xbmc.log( "[script.cinema.experience] - [ home_automation.py ] - Opps. Something happened", level=xbmc.LOGNOTICE )
http://pastebin.com/DTqgFbnn
Not really sure what I am doing but it would be good to have the commands I need in the script file.
EDIT: Seems to work when I test in the #trailers section. May have something to do with the fact I am not using the Trivia Info?
RE: [RELEASE] Cinema Experience - the new Home Theater Experience Script - giftie - 2013-04-29
(2013-04-29, 08:56)phsyraxion Wrote: I have started experimenting with this script and love it. I have everything figured out and working but just wanted to find out a little about the Home Automation part of the addon.
I know very little about Python but do know basic programming in C++ and Python doesn't seem much different. I have had a look at 2 different HA script files in this thread and the first (which I assume was an original) has comments to say "Add Code Here" where you could add the code you wanted to run. But the home_automation(2).py script which has been "cleaned up" does not have these pointers. In any event, I wanted to ask the following: The home_automation(2).py script is one that was written to control EventGhost on a Windows Machine(what most were using to control their systems)
Quote:I have an ELK M1 automation system and the full SDK software for the system. It controls everything in my home (lights, fish tanks, media devices etc) and is simple to control from ASCII commands. I have created the following test script that will trigger the MESSAGE I send just fine:
Code: # PYTHON SCRIPT TO SEND COMMANDS TO ELK M1
# VERSION: 1.0 (30 APRIL 2013)
#
# Use the M1 SDK to generate ASCII commands
# Copy the ASCII command to the MESSAGE and replace the ^ character with \r
#
import socket
M1IP = "192.168.0.251"
M1PORT = 2101
MESSAGE=b'0Ecn0030000300D4\r'
#Code Start
srvsock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
srvsock.settimeout(3) # 3 second timeout on commands
srvsock.connect((M1IP, M1PORT))
srvsock.sendall(MESSAGE)
data = srvsock.recv(4096)
#returns result from panel (for troubleshooting)
print ("received message:", data.decode("UTF-8"))
srvsock.close()
The Message simply pulses an output for 3 seconds as a test and works perfectly. I assume I should be able to slot the code into the automation script where I would like to trigger something and it should be able to send the command to my system?
Code: # This module's future home should be inside userdata/addon_data/script.cinema.experience/ha_scripts
# to make sure it does not get over written when updating the script
import xbmc, xbmcaddon
import socket
M1IP = "192.168.0.251"
M1PORT = 2101
MESSAGE=b'0Ecn0030000300D4\r'
_A_ = xbmcaddon.Addon('script.cinema.experience')
_L_ = _A_.getLocalizedString
_S_ = _A_.getSetting
def activate_on( trigger = "None" ):
"""
Scripting to trigger almost anything(HA, other scripts, etc...) when videos start.
Usage:
activate_on( "Movie" )
will trigger code that is set under the Movie heading.
"""
if trigger == "None":
xbmc.output( "[script.cinema.experience] - [ home_automation.py ] - No Trigger Sent, Returning", level=xbmc.LOGNOTICE )
return
xbmc.output( "[script.cinema.experience] - [ home_automation.py ] - activate_on( %s ) Triggered" % trigger, level=xbmc.LOGNOTICE )
# Script Start
if trigger == _L_( 32613 ) and _S_( "ha_script_start" ) == "true":
xbmc.output( "[script.cinema.experience] - [ home_automation.py ] - %s Triggered" % _L_( 32613 ), level=xbmc.LOGNOTICE )
# place code below this line
xbmc.executehttpapi( "Broadcast(<b>CE_Automate<li>script_start</b>)" )
# Trivia Intro
elif trigger == _L_( 32609 ) and _S_( "ha_trivia_intro" ) == "true":
xbmc.output( "[script.cinema.experience] - [ home_automation.py ] - %s Triggered" % _L_( 32609 ), level=xbmc.LOGNOTICE )
# place code below this line
########################################################
srvsock.settimeout(3) # 3 second timeout on commands
srvsock.connect((M1IP, M1PORT))
srvsock.sendall(MESSAGE)
########################################################
xbmc.executehttpapi( "Broadcast(<b>CE_Automate<li>trivia_intro</b>)" )
The example above with my code between the comment lines, would that work if I wanted the event to happen on the trivia intro? I just want to be sure that what I am trying would be possible before investing time on it.
That is the code for the Eden version of Cinema Experience which will give you other errors.
(2013-04-29, 12:26)phsyraxion Wrote: Tested... Doesn't work. If I add the few lines of code into the script under the #place code here part of any section, the CE script just wont run. Using the script file that came with the latest CE on Frodo I have the following:
Code: # This module's future home should be inside userdata/addon_data/script.cinema.experience/ha_scripts
# to make sure it does not get over written when updating the script
import xbmc, xbmcaddon
import socket, sys
from threading import Thread
triggers = sys.modules[ "__main__" ].triggers
ha_settings = sys.modules[ "__main__" ].ha_settings
M1IP = "192.168.0.251"
M1PORT = 2101
class Automate:
def __init__( self ):
pass
def activate_ha( self, trigger = None, prev_trigger = None, mode="thread" ):
if ha_settings[ "ha_enable" ]:
if ha_settings[ "ha_multi_trigger" ] and prev_trigger == trigger:
pass
elif mode != "thread":
self.activate_on( trigger )
else:
thread = Thread( name='ha_trigger', target=self.activate_on, args=( trigger, ) )
thread.start()
return prev_trigger
def activate_on( self, trigger = None ):
"""
Scripting to trigger almost anything(HA, other scripts, etc...) when videos start.
Usage:
activate_on( "Movie" )
will trigger code that is set under the Movie heading.
"""
if not trigger:
xbmc.log( "[script.cinema.experience] - [ home_automation.py ] - No Trigger Sent, Returning", level=xbmc.LOGNOTICE )
return
xbmc.log( "[script.cinema.experience] - [ home_automation.py ] - activate_on( %s ) Triggered" % trigger, level=xbmc.LOGNOTICE )
if trigger in triggers:
xbmc.log( "[script.cinema.experience] - [ home_automation.py ] - Trigger %s" % trigger, level=xbmc.LOGNOTICE )
# Script Start
if trigger == "Script Start" and ha_settings[ "ha_script_start" ]:
# place code below this line
pass
# Trivia Intro
elif trigger == "Trivia Intro" and ha_settings[ "ha_trivia_intro" ]:
pass
# place code below this line
srvsock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
srvsock.settimeout(3) # 3 second timeout on commands
srvsock.connect((M1IP, M1PORT))
srvsock.sendall(b'09ct01000CF4\r')
srvsock.close()
# Trivia
elif trigger == "Trivia" and ha_settings[ "ha_trivia_start" ]:
pass
# place code below this line
# Trivia Outro
elif trigger == "Trivia Outro" and ha_settings[ "ha_trivia_outro" ]:
pass
# place code below this line
# Movie Theatre Intro
elif trigger == "Movie Theater Intro" and ha_settings[ "ha_mte_intro" ]:
pass
# place code below this line
# Coming Attractions Intro
elif trigger == "Coming Attractions Intro" and ha_settings[ "ha_cav_intro" ]:
pass
# place code below this line
# Trailer
elif trigger == "Movie Trailer" and ha_settings[ "ha_trailer_start" ]:
pass
# place code below this line
# Coming Attractions Outro
elif trigger == "Coming Attractions Outro" and ha_settings[ "ha_cav_outro" ]:
pass
# place code below this line
# Feature Presentation Intro
elif trigger == "Feature Presentation Intro" and ha_settings[ "ha_fpv_intro" ]:
pass
# place code below this line
# MPAA Rating
elif trigger == "MPAA Rating" and ha_settings[ "ha_mpaa_rating" ]:
pass
# place code below this line
# Countdown
elif trigger == "Countdown" and ha_settings[ "ha_countdown_video" ]:
pass
# place code below this line
# Audio Format
elif trigger == "Audio Format" and ha_settings[ "ha_audio_format" ]:
pass
# place code below this line
# Movie
elif trigger == "Movie" and ha_settings[ "ha_movie" ]:
pass
# place code below this line
# Feature Presentation Outro
elif trigger == "Feature Presentation Outro" and ha_settings[ "ha_fpv_outro" ]:
pass
# place code below this line
# Movie Theatre Intro
elif trigger == "Movie Theatre Outro" and ha_settings[ "ha_mte_outro" ]:
pass
# place code below this line
# Intermission
elif trigger == "Intermission" and ha_settings[ "ha_intermission" ]:
pass
# place code below this line
# Script End
elif trigger == "Script End" and ha_settings[ "ha_script_end" ]:
pass
# place code below this line
# Paused
elif trigger == "Pause" and ha_settings[ "ha_paused" ]:
pass
# place code below this line
# Resumed
elif trigger == "Resume" and ha_settings[ "ha_resumed" ]:
pass
# place code below this line
else:
xbmc.log( "[script.cinema.experience] - [ home_automation.py ] - Opps. Something happened", level=xbmc.LOGNOTICE )
http://pastebin.com/DTqgFbnn
Not really sure what I am doing but it would be good to have the commands I need in the script file.
EDIT: Seems to work when I test in the #trailers section. May have something to do with the fact I am not using the Trivia Info?
The debug log you provided shows an indentation error in the code, the script uses 4 spaces(no tabs) for indentation. This is probably why it didn't work.
Code: 19:45:58 T:4824 ERROR: Traceback (most recent call last):
19:45:58 T:4824 ERROR: File "C:\Program Files\XBMC\portable_data\addons\script.cinema.experience\resources\lib\launch_automation.py", line 12, in <module>
19:45:58 T:5212 DEBUG: NEWADDON PythonCallbackHandler construction with PyThreadState 0xbddf900
19:45:58 T:4824 ERROR: from home_automation import Automate
19:45:58 T:4824 ERROR: File "C:\Program Files\XBMC\portable_data\userdata\addon_data\script.cinema.experience\ha_scripts\home_automation.py", line 53
19:45:58 T:4824 ERROR: srvsock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
19:45:58 T:4824 ERROR: ^
19:45:58 T:4824 ERROR: IndentationError: unexpected indent
Since you are going to be repeating code through out the module, you should move the main part of your triggering out of the automate_on() function.
Code: class Automate:
def __init__( self ):
pass
def broadcast( self, data, port = 8278, ipaddress = '255.255.255.255' ):
IPADDR = ipaddress
PORTNUM = port
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((IPADDR, PORTNUM))
s.sendall(data)
s.close()
Then in the if statements just need to have:
Code: if trigger == "Script Start" and ha_settings[ "ha_script_start" ]:
self.broadcast( b'0Ecn0030000300D4\r', port = 2101, ipaddress = '192.168.0.251' )
RE: [RELEASE] Cinema Experience - the new Home Theater Experience Script - shaktoo - 2013-04-29
@giftie another suggestion I am not sure this has been put forward before , this is regarding using CE script with 3D movies. What I propose ( if it could be done ) is to add settings for 3D movies ( to recognise file names with ".3D " with them to play trailers marked / matched locally with 3D trailers (either seperated in a particular folder whose path could be given to HC script or just marked with ".3D " in the file name or stream from here "https://www.youtube.com/playlist?list=PLE4D71498D1E19B8E " .
in the intros section there could also be a setting to play the 3D imax intro.
I know for a fact that this would Further enrich the whole Home Cinema Experience.
What do you think ?
In my head sequence should be like this
As per my current settings i have local folder where I download all new trailers using ijourneaux's excellent "HD-Trailers.net Downloader" script. I would probably add a seperate folder for 3D trailers where I shall download all sbs 3D trailers.Another folder for 3D Imax Intros.
CE has settings for special 3D intros + 3D Trailers.
All my 3D movies are appropriately named with .3D in the filenames.
when I play .3D files using CE, this would then pull the specific intros / trailers as specified within the script.
Bliss !!
Is this Possible ?
RE: [RELEASE] Cinema Experience - the new Home Theater Experience Script - phsyraxion - 2013-04-30
Thanks for the feedback. That is exactly what I planned to do with the code once I had it working.
I found out that it was an indentation thing. I had the spaces done correctly but when I copied and pasted (using Notepad++) it added a "tabbed indent" to the first line and when I deleted the extra indent I removed the spaced indent, not the tabbed indent...
Bottom line is that I got it working without the need to install another addon or anything and I can now trigger my windows to close and the lighting to change when playing trailers etc and even when pressing pause.
RE: [RELEASE] Cinema Experience - the new Home Theater Experience Script - chewie - 2013-05-01
Hi all, first off, this script is amazing. It adds a level of professionalism to a home theater that is very difficult to achieve. Kudos!
My question revolves around changing frame rates/audio/resolution between videos. My system uses a projector that takes a few seconds to switch formats, so I was wondering if there was anyway to build in something like a 3 second delay between videos?
RE: [RELEASE] Cinema Experience - the new Home Theater Experience Script - chewie - 2013-05-01
Nevermind, I figured it out. If you are having the issue I was describing you simply go to Settings - Videos - Playback and increment the Pause during refresh rate change value so that your system has time to switch with the various videos that Cinema Experience is queuing up.
Hooray for answering your own question!
RE: [RELEASE] Cinema Experience - the new Home Theater Experience Script - shaktoo - 2013-05-02
(2013-05-01, 23:31)chewie Wrote: Hooray for answering your own question!
well done !
|