Kodi Community Forum
[RELEASE] Cinema Experience - the new Home Theater Experience Script - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: Add-on Support (https://forum.kodi.tv/forumdisplay.php?fid=27)
+---- Forum: Program Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=151)
+---- Thread: [RELEASE] Cinema Experience - the new Home Theater Experience Script (/showthread.php?tid=87563)



RE: [RELEASE] Cinema Experience - the new Home Theater Experience Script - jer78 - 2014-01-09

(2014-01-09, 13:54)opeters Wrote: Hi Jer78,

I am controlling my HUE lights with EventGhost which is using Phyton. Try this code example:
[/code]
Code:
CURL -XPUT http://<IP HUE Bridge>/api/<key>/lights/1/state -d "{{\"on\": true}"

or this:

Code:
CURL -XPUT http://<IP HUE Bridge>/api/<key>/groups/7/action -d "{{\"transitiontime\": 180,\"on\": true,\"hue\": 15597,\"bri\": 255,\"sat\": 104}"

Note that <key> is your HUE access/username key

Thanks for your quick reply. Unfortunately, that doesn't work either. However, since I've yet to get a script working, I'm wondering if I'm even doing this correctly? Here's where I put it (substituted of course with my real keyl). In the add-on I've enabled the script and enabled the trigger on start

Code:
if trigger == "Script Start" and ha_settings[ "ha_script_start" ]:
            # place code below this line
            CURL -XPUT http://192.168.1.34/api/<mykey>/groups/7/action -d "{{\"on\": true}"
            pass



RE: [RELEASE] Cinema Experience - the new Home Theater Experience Script - opeters - 2014-01-09

(2014-01-09, 14:18)jer78 Wrote:
(2014-01-09, 13:54)opeters Wrote: Hi Jer78,

I am controlling my HUE lights with EventGhost which is using Phyton. Try this code example:
[/code]
Code:
CURL -XPUT http://<IP HUE Bridge>/api/<key>/lights/1/state -d "{{\"on\": true}"

or this:

Code:
CURL -XPUT http://<IP HUE Bridge>/api/<key>/groups/7/action -d "{{\"transitiontime\": 180,\"on\": true,\"hue\": 15597,\"bri\": 255,\"sat\": 104}"

Note that <key> is your HUE access/username key

Thanks for your quick reply. Unfortunately, that doesn't work either. However, since I've yet to get a script working, I'm wondering if I'm even doing this correctly? Here's where I put it (substituted of course with my real keyl). In the add-on I've enabled the script and enabled the trigger on start

Code:
if trigger == "Script Start" and ha_settings[ "ha_script_start" ]:
            # place code below this line
            CURL -XPUT http://192.168.1.34/api/<mykey>/groups/7/action -d "{{\"on\": true}"
            pass

Sorry but the examples I posted are used to call the curl.exe windows executable, like you do on your MAC and have nothing to to with Python.
Looking to find a Phytom script for this but can't find a working on. What is interesting is this link i found: http://www.eventghost.org/forum/viewtopic.php?f=1&t=5138 Seens to be a Python plugin HTTPIE that makes things easy.


RE: [RELEASE] Cinema Experience - the new Home Theater Experience Script - opeters - 2014-01-09

If it has to be in Python than this did work for me, (calling a external program from Phyton and execute it using the subprocess):

Code:
import subprocess
proc = subprocess.Popen(["E:\Curl\curl", "-XPUT", 'http://<IP HUE>/api/<KEY>/lights/8/state', '-d', '{\"on\": false}'], stdout=subprocess.PIPE)
(out, err) = proc.communicate()
print out



RE: [RELEASE] Cinema Experience - the new Home Theater Experience Script - jer78 - 2014-01-10

Thanks for your help. I'm giving up because I just don't think this script works on a Mac. I can get my script working on it's own but as soon as I insert it into the home_automation.py nothing happens. Also, if I run that script on it's own it returns an error on line 4 'no module named xbmc'

Again, thanks for trying!


RE: [RELEASE] Cinema Experience - the new Home Theater Experience Script - nikeb - 2014-01-11

Hi Giftie and all the staff.
First of all congrats for the great work you've done for this amazing addon.

Now, i had CinEx from long time on my lil HTPC with win7 and everything was always fine,
Since i got my new Minix x7 Android i can make everything work.... except CinEx

I would like to have only 3 features:

Coming Intro Video (local folder)
3 Trailers from my xbmc library (scraped by Universal)
Coming Outro Video (local folder)

i really try to figured out what happened but when i use the addon,
all i get is the movie to play, without any of my setup (even the local videos).
This is my full log (i got many startup addon, i guess you will be interested from line 1150 to the end)

http://xbmclogs.com/show.php?id=108746

Thanks for everything and for rockin on this


RE: [RELEASE] Cinema Experience - the new Home Theater Experience Script - jer78 - 2014-01-11

OK, so I did one more try and FINALLY got it working. Here's what I did in case anyone else has a Hue Lights setup and would like to control them with Cinema Experience. Also, thanks opeters for your help! You got me on the right track!

First off, I downloaded the newest version 3.0.7 from github and noticed there was some changes to the home_automation.py file (this may have helped)
Second, I used the following code which seems to work well:

Code:
connection =  httplib.HTTPConnection('MYHUEBRIDGEIP')
body_content = '{"on":true}'
connection.request('PUT', '/api/MYHUEKEY/groups/7/action', body_content)
result = connection.getresponse()

Of course, the Hue Bridge IP and Key need to be changed to your setup, and in the body content you can use your own custom settings.

Finally, I inserted the following line near the top of the code:

Code:
import httplib

Now, everything works like a charm. Thanks again!


RE: [RELEASE] Cinema Experience - the new Home Theater Experience Script - giftie - 2014-01-11

(2014-01-11, 03:59)jer78 Wrote: OK, so I did one more try and FINALLY got it working. Here's what I did in case anyone else has a Hue Lights setup and would like to control them with Cinema Experience. Also, thanks opeters for your help! You got me on the right track!

First off, I downloaded the newest version 3.0.7 from github and noticed there was some changes to the home_automation.py file (this may have helped)
Second, I used the following code which seems to work well:

Code:
connection =  httplib.HTTPConnection('MYHUEBRIDGEIP')
body_content = '{"on":true}'
connection.request('PUT', '/api/MYHUEKEY/groups/7/action', body_content)
result = connection.getresponse()

Of course, the Hue Bridge IP and Key need to be changed to your setup, and in the body content you can use your own custom settings.

Finally, I inserted the following line near the top of the code:

Code:
import httplib

Now, everything works like a charm. Thanks again!

If you PM me with your home_automation.py, I'll clean it up for others to use and keep on my home_automation Git hub. https://github.com/Giftie/home_automation.py this way it will be be kept up to date for others and yourself.


RE: [RELEASE] Cinema Experience - the new Home Theater Experience Script - huttdes - 2014-01-13

Just learning to use CEX... it all seems pretty straight forward but having a few issues.

I'm using with Aeon MQ5

Trivia slides... I have a lot of these downloaded from various sources.
They seem to have 2 different naming structures.
Examples....
question1a (question)
question1b (answer)

or they can be (with or without the clue)
question1_a (answer)
question1_c (clue)
question1_q (question)

Which is correct or does it even matter? Either way its not working correctly for me. Instead of displaying the question then the answer it simply picks slides at random... answers or questions it just throws up whatever.
I would think the second naming scheme would be correct since in the settings it lets me choose how long to display question, clue, and answer so it has to know which are which.


RE: [RELEASE] Cinema Experience - the new Home Theater Experience Script - Ragnarok - 2014-01-13

Are you using my slides with the pre-release ce? Not the one on the repo, the preview build. If so, there's something in the code that changed - but will be fixed in the release. To fix that, edit the xml files and remove any "N/A" from them and try that.


RE: [RELEASE] Cinema Experience - the new Home Theater Experience Script - huttdes - 2014-01-13

(2014-01-13, 03:36)RagnaroktA Wrote: Are you using my slides with the pre-release ce? Not the one on the repo, the preview build. If so, there's something in the code that changed - but will be fixed in the release. To fix that, edit the xml files and remove any "N/A" from them and try that.

I'm using your slides and also some others I downloaded. I'm running MQ5 which has CE already installed. It says version 3.0.6
Which xml file should I be looking at?
I tried in the userdata\addon_data\script.cinema.experience folder .... there is an XML file called newest_720p that had a N/A in it. I deleted it but it didn't help.
There is also a settings.xml file but it didn't contain and N/A.
Is there another file I should check?


RE: [RELEASE] Cinema Experience - the new Home Theater Experience Script - giftie - 2014-01-13

(2014-01-11, 01:24)nikeb Wrote: Hi Giftie and all the staff.
First of all congrats for the great work you've done for this amazing addon.

Now, i had CinEx from long time on my lil HTPC with win7 and everything was always fine,
Since i got my new Minix x7 Android i can make everything work.... except CinEx

I would like to have only 3 features:

Coming Intro Video (local folder)
3 Trailers from my xbmc library (scraped by Universal)
Coming Outro Video (local folder)

i really try to figured out what happened but when i use the addon,
all i get is the movie to play, without any of my setup (even the local videos).
This is my full log (i got many startup addon, i guess you will be interested from line 1150 to the end)

http://xbmclogs.com/show.php?id=108746

Thanks for everything and for rockin on this

Try disabling 'Only unwatched movies' in the trailer settings and see if any trailers play.


RE: [RELEASE] Cinema Experience - the new Home Theater Experience Script - giftie - 2014-01-13

huttdes Wrote:Just learning to use CEX... it all seems pretty straight forward but having a few issues.

I'm using with Aeon MQ5

Trivia slides... I have a lot of these downloaded from various sources.
They seem to have 2 different naming structures.
Examples....
question1a (question)
question1b (answer)

or they can be (with or without the clue)
question1_a (answer)
question1_c (clue)
question1_q (question)

Which is correct or does it even matter? Either way its not working correctly for me. Instead of displaying the question then the answer it simply picks slides at random... answers or questions it just throws up whatever.
I would think the second naming scheme would be correct since in the settings it lets me choose how long to display question, clue, and answer so it has to know which are which.
Both are actually correct depending on you slides.xml file.

(2014-01-13, 04:00)huttdes Wrote:
(2014-01-13, 03:36)RagnaroktA Wrote: Are you using my slides with the pre-release ce? Not the one on the repo, the preview build. If so, there's something in the code that changed - but will be fixed in the release. To fix that, edit the xml files and remove any "N/A" from them and try that.

I'm using your slides and also some others I downloaded. I'm running MQ5 which has CE already installed. It says version 3.0.6
Which xml file should I be looking at?
I tried in the userdata\addon_data\script.cinema.experience folder .... there is an XML file called newest_720p that had a N/A in it. I deleted it but it didn't help.
There is also a settings.xml file but it didn't contain and N/A.
Is there another file I should check?

In each of the Trivia slide folders(if they have different naming schemes) there needs to be a slides.xml file.

The slides.xml file for the first pattern needs to look like this:
PHP Code:
<slides>
    <
slide>
        <
slide rating="">
        <
question format=".([0-9]{1,3})+a.jpg" />
        <
clue format="N/A" />
        <
answer format=".([0-9]{1,2})+b.jpg" />
    </
slide>
</
slides

The slides.xml file for the second pattern needs to look like this:
PHP Code:
<slides>
    <
slide>
        <
slide rating="G">
        <
question format=".([0-9]{1,3})+_q.jpg" />
        <
clue format=".([0-9]{1,3})+_c.jpg" />
        <
answer format=".([0-9]{1,2})+_a.jpg" />
    </
slide>
</
slides>
[/
php



RE: [RELEASE] Cinema Experience - the new Home Theater Experience Script - huttdes - 2014-01-13

(2014-01-13, 05:05)giftie Wrote: In each of the Trivia slide folders(if they have different naming schemes) there needs to be a slides.xml file.

The slides.xml file for the first pattern needs to look like this:
PHP Code:
<slides>
    <
slide>
        <
slide rating="">
        <
question format=".([0-9]{1,3})+a.jpg" />
        <
clue format="N/A" />
        <
answer format=".([0-9]{1,2})+b.jpg" />
    </
slide>
</
slides

The slides.xml file for the second pattern needs to look like this:
PHP Code:
<slides>
    <
slide>
        <
slide rating="G">
        <
question format=".([0-9]{1,3})+_q.jpg" />
        <
clue format=".([0-9]{1,3})+_c.jpg" />
        <
answer format=".([0-9]{1,2})+_a.jpg" />
    </
slide>
</
slides>
[/
php

I tried the top one and the slides would not play at all... just skipped them. I eliminated the NA line and still no luck.

I then linked to another folder I had just downloaded... a guy on youtube had a link to his entire folder structure. He had the xml file in his slides folder.
A little different then what you wrote me... as you can see by the below his filenames have an underscore before the letter.
<slides>
<slide>
<question format="([a-z])_a\.jpg" />
<clue format="q([0-9]{1,3})c\.jpg" />
<answer format="([a-z])_b\.jpg" />
<mpaa = "N/A">
</slide>
</slides>
Unfortunately this did the same thing... would not play at all.

So right now the only way I can get them to play is with no xml at all... but does not play properly.

....also was just wondering why in the xml for the answer is it 1,2 when the question and clue have 1,3? Although I decided to try it both ways and still no luck.


RE: [RELEASE] Cinema Experience - the new Home Theater Experience Script - bluenote - 2014-01-13

Is anyone successfully using this with mysql?


RE: [RELEASE] Cinema Experience - the new Home Theater Experience Script - giftie - 2014-01-13

(2014-01-13, 05:36)bluenote Wrote: Is anyone successfully using this with mysql?

Why wouldn't this work with MySQL? It's doesn't access the database directly.

(2014-01-13, 05:34)huttdes Wrote:
(2014-01-13, 05:05)giftie Wrote: In each of the Trivia slide folders(if they have different naming schemes) there needs to be a slides.xml file.

The slides.xml file for the first pattern needs to look like this:
PHP Code:
<slides>
    <
slide>
        <
slide rating="">
        <
question format=".([0-9]{1,3})+a.jpg" />
        <
clue format="N/A" />
        <
answer format=".([0-9]{1,2})+b.jpg" />
    </
slide>
</
slides

The slides.xml file for the second pattern needs to look like this:
PHP Code:
<slides>
    <
slide>
        <
slide rating="G">
        <
question format=".([0-9]{1,3})+_q.jpg" />
        <
clue format=".([0-9]{1,3})+_c.jpg" />
        <
answer format=".([0-9]{1,2})+_a.jpg" />
    </
slide>
</
slides>
[/
php

I tried the top one and the slides would not play at all... just skipped them. I eliminated the NA line and still no luck.

I then linked to another folder I had just downloaded... a guy on youtube had a link to his entire folder structure. He had the xml file in his slides folder.
A little different then what you wrote me... as you can see by the below his filenames have an underscore before the letter.
<slides>
<slide>
<question format="([a-z])_a\.jpg" />
<clue format="q([0-9]{1,3})c\.jpg" />
<answer format="([a-z])_b\.jpg" />
<mpaa = "N/A">
</slide>
</slides>
Unfortunately this did the same thing... would not play at all.

So right now the only way I can get them to play is with no xml at all... but does not play properly.

The xml file is needed to sort the order. It is really difficult to diagnose anything with out a debug log. The slides.xml files I provided, should work.