Poll: Most Desired Feature To Be Added
Other Movie Ratings
Download Movie Trailers
Home Automation scripting
Other Movie Streaming Location
Trivia Intro Fixed
Cartoon Video Option
More Videos for before Feature(s) - Specify how many
[Show Results]
 

[RELEASE] Cinema Experience - the new Home Theater Experience Script

  Thread Rating:
  • 24 Votes - 4.83 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
jer78 Offline
Junior Member
Posts: 26
Joined: Dec 2013
Reputation: 0
Post: #3391
(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
find quote
opeters Offline
Member
Posts: 76
Joined: Oct 2009
Reputation: 0
Post: #3392
(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/viewtopi...f=1&t=5138 Seens to be a Python plugin HTTPIE that makes things easy.
find quote
opeters Offline
Member
Posts: 76
Joined: Oct 2009
Reputation: 0
Post: #3393
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
find quote
jer78 Offline
Junior Member
Posts: 26
Joined: Dec 2013
Reputation: 0
Post: #3394
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!
find quote
nikeb Offline
Junior Member
Posts: 4
Joined: Jan 2014
Reputation: 0
Location: Italy
Post: #3395
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
find quote
jer78 Offline
Junior Member
Posts: 26
Joined: Dec 2013
Reputation: 0
Post: #3396
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!
find quote
giftie Online
Skilled Python Coder
Posts: 2,364
Joined: Mar 2010
Reputation: 54
Location: Calgary, Alberta
Post: #3397
(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.

[Image: e4f63e45ba34fe4695b3bb08eb2499d8e4ee484e...4c076g.jpg]
For troubleshooting and bug reporting please make sure you read this first you can also use XBMC Log Uploader Script.
Cinema Experience
Cinema Experience Wiki
cdART Manager
fanart.tv


find quote
huttdes Offline
Donor
Posts: 153
Joined: Sep 2008
Reputation: 0
Post: #3398
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.
find quote
RagnaroktA Offline
Senior Member
Posts: 155
Joined: Feb 2013
Reputation: 7
Location: Dallas
Post: #3399
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.

[Image: CinemaVision Logo (PayPal).png]
Ratings Videos, Introduction Videos, Trivia Slides and more...

CinemaVision for Cinema Experience | Cinema Experience Wiki
find quote
huttdes Offline
Donor
Posts: 153
Joined: Sep 2008
Reputation: 0
Post: #3400
(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?
find quote
giftie Online
Skilled Python Coder
Posts: 2,364
Joined: Mar 2010
Reputation: 54
Location: Calgary, Alberta
Post: #3401
(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.

[Image: e4f63e45ba34fe4695b3bb08eb2499d8e4ee484e...4c076g.jpg]
For troubleshooting and bug reporting please make sure you read this first you can also use XBMC Log Uploader Script.
Cinema Experience
Cinema Experience Wiki
cdART Manager
fanart.tv


find quote
giftie Online
Skilled Python Coder
Posts: 2,364
Joined: Mar 2010
Reputation: 54
Location: Calgary, Alberta
Post: #3402
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]

[Image: e4f63e45ba34fe4695b3bb08eb2499d8e4ee484e...4c076g.jpg]
For troubleshooting and bug reporting please make sure you read this first you can also use XBMC Log Uploader Script.
Cinema Experience
Cinema Experience Wiki
cdART Manager
fanart.tv


find quote
huttdes Offline
Donor
Posts: 153
Joined: Sep 2008
Reputation: 0
Post: #3403
(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.
(This post was last modified: 2014-01-13 05:52 by huttdes.)
find quote
bluenote Offline
Fan
Posts: 315
Joined: May 2010
Reputation: 0
Post: #3404
Is anyone successfully using this with mysql?
find quote
giftie Online
Skilled Python Coder
Posts: 2,364
Joined: Mar 2010
Reputation: 54
Location: Calgary, Alberta
Post: #3405
(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.

[Image: e4f63e45ba34fe4695b3bb08eb2499d8e4ee484e...4c076g.jpg]
For troubleshooting and bug reporting please make sure you read this first you can also use XBMC Log Uploader Script.
Cinema Experience
Cinema Experience Wiki
cdART Manager
fanart.tv


(This post was last modified: 2014-01-13 05:44 by giftie.)
find quote
Post Reply