Jump to content

Welcome, Guest!

Be a part of CinemaVision today! Once registered and logged in, you will have access to public chat and your own private messenger, you can view and contribute guides, collaborate on the forums, review downloads, give reputation to your fellow members, contribute content and so much more. Registering is quick and completely free, so what are you waiting for?
   Sign In    Sign Up

Become a RedCarpet Club Member Today!

   Join Now
  • 0
Sign in to follow this  
btiltman

Anyone using LIFX bulbs with Cinemavision?

Question

I have some lifx bulbs. Can anyone suggest where to get info on how to incorporate control of these into CinemaVision?

I presume some sort of script file is required but really don't know where to look to get started.

If someone can point me somewhere where I can read up on this, that would be great (or is there a sample script around here?)

Share this post


Link to post
Share on other sites

25 answers to this question

Recommended Posts

  • 0
2 hours ago, btiltman said:

I have some lifx bulbs. Can anyone suggest where to get info on how to incorporate control of these into CinemaVision?

I presume some sort of script file is required but really don't know where to look to get started.

If someone can point me somewhere where I can read up on this, that would be great (or is there a sample script around here?)

Hey there! I came across the API documentation here. I'll help you put together some Actions if you test them for me so I can put them up for everyone to download. :) Could also use help writing a guide for folks, if you're interested in helping put that together. Here's a guide on creating Actions if you want to tackle it yourself.

 

Share this post


Link to post
Share on other sites
  • 0
1 hour ago, Ragnarok said:

Hey there! I came across the API documentation here. I'll help you put together some Actions if you test them for me so I can put them up for everyone to download. :) Could also use help writing a guide for folks, if you're interested in helping put that together. Here's a guide on creating Actions if you want to tackle it yourself.

Hiya!   Happy to have a go at this with your help :-)

 

 

Share this post


Link to post
Share on other sites
  • 0
24 minutes ago, btiltman said:

Hiya!   Happy to have a go at this with your help :-)

I'll try to get some example Action Files set up and shoot them your way. Would you mind putting together a high-level setup guide for LIFX? Take a look at the Philips Hue guide as an example of what we'd like to put together. Ultimately, how to set up a scene is the main thing I'd like to cover.

Share this post


Link to post
Share on other sites
  • 0

Hi I too would be interested in this. Having numerous LIFX bulbs in my house most of which are around a shared living/kitchen area (2x in kitchen, 1x in living area, 2x in lamps).

Ive been looking automating these bulbs with cinema vision but haven't got very far. There is a kodi service (http://forum.kodi.tv/showthread.php?tid=222594) based on python script that works well in that when you start a movie it will turn the lights off, when you pause or finish the movie lights come back on. Similar for TV but they've set it up to dim to blue lights instead of the lights turning off. The problem is it does this all the time unless you disable the service.  When using cinema vision the lights are triggered off as soon as one starts. 

I was thinking it would work well to dim lights a little during the intro/pre show time (trivia, intro video bumpers adds, trailers etc) and then to dim further/off when the main feature starts. It would be ideal to also have the light come up a little when movie gets paused and when the credit roll (I've seen in mentioned on the forum that this has been a feature request). 

I haven't got any script writing/coding experience  but was going to see if there was someway to look at the python scripts already around and see if they could be used in the home automation script suggestion guide from the kodi forum. No idea if would work. However more than happy to test and help write a guide

Share this post


Link to post
Share on other sites
  • 0
9 hours ago, btiltman said:

No worries.......   I haven't had these long but have set up a few scenes. 

 

7 hours ago, Grennesa said:

Hi I too would be interested in this. Having numerous LIFX bulbs in my house most of which are around a shared living/kitchen area (2x in kitchen, 1x in living area, 2x in lamps).

Ive been looking automating these bulbs with cinema vision but haven't got very far. There is a kodi service (http://forum.kodi.tv/showthread.php?tid=222594) based on python script that works well in that when you start a movie it will turn the lights off, when you pause or finish the movie lights come back on. Similar for TV but they've set it up to dim to blue lights instead of the lights turning off. The problem is it does this all the time unless you disable the service.  When using cinema vision the lights are triggered off as soon as one starts. 

I was thinking it would work well to dim lights a little during the intro/pre show time (trivia, intro video bumpers adds, trailers etc) and then to dim further/off when the main feature starts. It would be ideal to also have the light come up a little when movie gets paused and when the credit roll (I've seen in mentioned on the forum that this has been a feature request). 

I haven't got any script writing/coding experience  but was going to see if there was someway to look at the python scripts already around and see if they could be used in the home automation script suggestion guide from the kodi forum. No idea if would work. However more than happy to test and help write a guide

Alright, so if I'm not reading the documentation incorrectly...

# This CinemaVision Action file uses a PUT method to set the scene of LIFX lights
#
# Visit "https://api.developer.lifx.com/" for more information on LIFX lights
# Visit "https://api.developer.lifx.com/docs/selectors" for more information on the LIFX selectors
# Visit "https://api.developer.lifx.com/v1/docs/colors" for the LIFX color guide
#
# Duration values can be any number (seconds) between 0.0 and 3155760000.0 (100 years)
# Brightness values can be any number between 0.0 and 1.0
# The minimum brightness does not turn off the light
# All integers must be a whole number + decimal (i.e 1.0, 2.0) 
#
# Replace <lifx_scene_uuid> with the UUID of your LIFX scene
# Replace <lifx_duration> with the amount of time in seconds you'd like the transition to take
# Replace <lifx_app_token> with your LIFX token

# Activate a scene
https://api.lifx.com/v1/scenes/scene_uuid:<lifx_scene_uuid>/activate
HEADERS: {"Authorization": "Bearer <lifx_app_token>"}
PUT: duration=<lifx_duration>

If you guys can confirm this works, I'll start banging out some Action Files for LIFX.

Share this post


Link to post
Share on other sites
  • 0
3 hours ago, Ragnarok said:

If you guys can confirm this works, I'll start banging out some Action Files for LIFX.

So, true story. LIFX is making us change the way we do Actions slightly for some of the advanced features. We're working on building support for it now, but the above should work.

Share this post


Link to post
Share on other sites
  • 0

Hi So Ive

1.) Got a personal API from cloud lifx which I already had from using the LIFX Kodi script as mentioned above. 

2.) Worked out how to find out the UUID of the scenes I've created using ( curl -H "Authorization: Bearer < personal cloud API from https://cloud.lifx.com> "https://api.lifx.com/v1beta1/scenes/") plugging that into terminal for OSX gives you a list of info including the UUIDs for the scenes Ive created. 

3.) Used your action file with the UUID, API and duration saved as a .cvaction file. However it gets a error line 1 "first action line must have the form :<protocol://<protocol data>

Ive tried adding a hash above #activate a scene without luck. Could it be because its an Https protocol and not http?

Share this post


Link to post
Share on other sites
  • 0

I have never used actions before. I am testing it in the Add-On configuration field for 'Execute Action on Sequence Pause' and using the 'Test' button. Is that ok for testing?

Anyway, in the Parse window I get:

HTTP Response{"Error":Invalid JSON} 

It's ok, sorted it out, see below:

-------------------------

# Activate a scene
https://api.lifx.com/v1/scenes/scene_id:cd6d6596-2896-4c2e-962e-ce2ac9727eef/activate
HEADERS: {"Authorization": "Bearer c8e39a                                                                                       4098730"}
PUT:  {"duration":20.0}

This worked! (So your sample didnt have the right format for the PUT?) also forgot to point out used scene_id instead of scene_uid (not sure if that is relevant yet)

Edited by btiltman
  • Upvote 1

Share this post


Link to post
Share on other sites
  • 0

Well played! I'll let our developer know what you found. We're making modifications to the way we handle Action files  that will allow you to include multiple strings of data in one Action, and I'm hoping to get it in 1.0.12 before we release it as stable. I'll put together some more Actions for you to test and shoot them your way tomorrow.

Share this post


Link to post
Share on other sites
  • 0
3 hours ago, btiltman said:

I have never used actions before. I am testing it in the Add-On configuration field for 'Execute Action on Sequence Pause' and using the 'Test' button. Is that ok for testing?

Anyway, in the Parse window I get:

HTTP Response{"Error":Invalid JSON} 

-------------------------

# Activate a scene
https://api.lifx.com/v1/scenes/scene_id:<Uid>/activate
HEADERS: {"Authorization": "Bearer <API>}
PUT: {"duration":20.0}

This worked! (So your sample didnt have the right format for the PUT?)

Ive moved over to using Notepad ++ on a windows machine and getting some progress. But still not working.

Your version of the PUT: {"duration":20.0} doesnt work for me Btiltman. Comes back with a "selector is invalid error"

And like you using the  PUT: duration= gives me a Invalid JSON error. Will continue to test different variations.

Also just a thought also Btiltman, you might want to think about getting an new API for your lights as I think now anyone could control your lights after that last post. ;)

 

 

Edited by Grennesa

Share this post


Link to post
Share on other sites
  • 0

Ok got it working too , the other difference is  the https://api.lifx.com/v1/scenes/scene_id:<uid>/activate so it should read

Quote

# This CinemaVision Action file uses a PUT method to set the scene of LIFX lights
#
# Visit "https://api.developer.lifx.com/" for more information on LIFX lights
# Visit "https://api.developer.lifx.com/docs/selectors" for more information on the LIFX selectors
# Visit "https://api.developer.lifx.com/v1/docs/colors" for the LIFX color guide
#
# Duration values can be any number (seconds) between 0.0 and 3155760000.0 (100 years)
# Brightness values can be any number between 0.0 and 1.0
# The minimum brightness does not turn off the light
# All integers must be a whole number + decimal (i.e 1.0, 2.0)
#
# Replace <lifx_scene_uuid> with the UUID of your LIFX scene
# Replace <lifx_duration> with the amount of time in seconds you'd like the transition to take
# Replace <lifx_app_token> with your LIFX token

# Activate a scene
https://api.lifx.com/v1/scenes/scene_id: <uid of scene>/activate
HEADERS: {"Authorization": "Bearer <Personal API>"}
PUT: {"duration":<time>}

 

You can go to test your details at the bottom of this page to see if it work https://api.developer.lifx.com/docs/activate-scene

 

Edited by Grennesa

Share this post


Link to post
Share on other sites
  • 0

PUT:  

33 minutes ago, Grennesa said:

Ive moved over to using Notepad ++ on a windows machine and getting some progress. But still not working.

Your version of the PUT: {"duration":20.0} doesnt work for me Btiltman. Comes back with a "selector is invalid error"

And like you using the  PUT: duration= gives me a Invalid JSON error. Will continue to test different variations.

Also just a thought also Btiltman, you might want to think about getting an new API for your lights as I think now anyone could control your lights after that last post. ;)

 

 

Try scene_id instead of scene_uid    ?

Whilst it is only a test api key. Maybe delete part of it from your quote for me in case someone decides to confuse me during testing  :-)  (I have already done so in my original post)

 

12 minutes ago, Grennesa said:

 

You can go to test your details at the bottom of this page to see if it work https://api.developer.lifx.com/docs/activate-scene

 

Yep that's how I worked it out in the first place  :-)

Edited by btiltman
Must have posted at the same time there eh? LOL

Share this post


Link to post
Share on other sites
  • 0

Ok I've posted a quick guide for everyone based on whats been found so far.

Would be amazing to somehow trigger a different scene once the movie was paused but no idea how or if this is possible. 

 

Share this post


Link to post
Share on other sites
  • 0

Its says its pending approval on my end, so maybe its got to be ticked off by one of the mods? Here is what I wrote

This is a quick guide to link your LIFX bulbs to cinema vision allowing you to trigger scenes throughout the sequence of pre-movie entertainment, the feature and after the feature. There is probably a number of ways of doing this but this is just the way I worked out with the help of Ragnarok and Btiltman.

Unfortunately, this method won’t allow the lights to turn back on if you pause the movie and will also need the movie to completely finish before a scene to trigger the lights to turn back on will run (rather than when the credits start).

This is my first guide and I'm sure there are better ways and  fancier things one can do. If you know how then please feel free to add this to the guide.

 

The Basics

You will need:

1.)   At least one LIFX bulb (http://www.lifx.com/).  But the more you have the more impressive you'll be :D  (No I don't work for them).

2.)    A phone with the LIFX app on it

3.)    Kodi with cinemavision

4.)   A computer to create action files

 

Step 1.) Setting up your LIFX Bulbs

1.)    First set up your bulbs as discussed here: https://support.lifx.com/hc/en-us/sections/201713683-Getting-Started

      2.)    Set up LIFX Cloud as discussed here: https://support.lifx.com/hc/en-us/articles/202522970-LIFX-Cloud-Setup

     3.)    Create Scenes you want to trigger on your phone using the LIFX app https://support.lifx.com/hc/en-us/articles/204074724-Scenes-in-the-LIFX-app.

I use three scenes to control 5 light bulbs; one for pre-movie entertainment (lights in the living and kitchen room around 50%), one for the movie (two lights on at 5% with a blue hue with the rest off) and one for after the movie (all lights back to normal) 

*When creating a scene you have the ability to turn other lights off (by including them while they are off) or leaving lights out of the scene entirely so they are not affected by not including them in the scene (in my case a front  door light will stay on).

Step 2.) Generate an API for your LIFX bulbs

1.)    Log into https://cloud.lifx.com/settings with your username and password from your LIFX cloud account your created in step 1.)

2.)    Click on the generate a new token/API call it cinemavision(or whatever you want).

3.)    Copy and paste the super long string of numbers and digits somewhere safe (Ie word/txt file).

 

Step 3.)  Cinemavision Action File(s)

1.)    I've created three action files to trigger three different scenes (a preshow, movie and post movie action file).

2.)    You will need the scene(s) UUID(s) (a unique ID of those scenes) that you made while setting up your bulbs

3.)    Go to https://api.developer.lifx.com/docs/list-scenes and scroll down to the bottom where it says Try it.

4.)    Copy and paste the token/API  you generated in step 2.) into the user information (where the key is in the below image) and click Try it.

5.)    You will see a whole heap of information scroll through until you find the UUID(s) (the top one) for your scenes.  Below you can see  where the UUID for my movie about to start scene should be located (not the second one in the list).

 

UUID.jpg

6.)   You can test you’ve got the right UUID and API token by going to https://api.developer.lifx.com/docs/activate-scene and entering in your UUID and API along with a duration (time taken for effect to occur) then click try it. It should trigger said scene at your house like Magic if you’ve got the right digits.

7.)    If that works, next create a Cinemavision action file, (I initially tried to create one in Mac OSX textedit and didn't work) using Notepad ++ or any other text editor.

 

# This CinemaVision Action file uses a PUT method to set the scene of LIFX lights
#
# Visit "https://api.developer.lifx.com/" for more information on LIFX lights
# Visit "https://api.developer.lifx.com/docs/selectors" for more information on the LIFX selectors
# Visit "https://api.developer.lifx.com/v1/docs/colors" for the LIFX color guide
#
# Duration values can be any number (seconds) between 0.0 and 3155760000.0 (100 years)
# Brightness values can be any number between 0.0 and 1.0
# The minimum brightness does not turn off the light
# All integers must be a whole number + decimal (i.e 1.0, 2.0) 
#
# Replace <lifx_scene_uuid> with the UUID of your LIFX scene
# Replace <lifx_duration> with the amount of time in seconds you'd like the transition to take
# Replace <lifx_app_token> with your LIFX token

# Activate a scene
https://api.lifx.com/v1/scenes/scene_id:<lifx_scene_uuid>/activate
HEADERS: {"Authorization": "Bearer <lifx_app_token>"}
PUT: {"duration":<lifx_duration>}

8.)    Copy the code above (Thanks to  Ragnarok and Btiltman ) into Notepad++ and replace the information with the UUID of the scene you want to trigger, your API and how long you would like your scene to fade in over (use full digits).

*Note that your UUID, API and time should replace all text from <> (i.e first digit replaces the < symbol and the last digit replaces where the > was)

9.)    Save as a xx.cvaction file (e.g start.cvaction), repeat for the other two scenes.  

10.)     Place these files in the Action folder part of the Cinemavision directory on your HTPC.

11)     Finally set up the action in cinemavision addon in KODI exactly where you want to set them to fire (I have placed an action to trigger dimming of the lights to 50% at the start of trivia, turning off all but two lights dimmed to 5% at the commencement of the PSA and back to full lights after the feature film.

12.)     You can check everything works by launching test in the cinemavision action setup (just below where you designate which file you want to trigger.

13.)    Thats it, sit back and enjoy the experience of impressing your friends and family.

 

 

 

 

 

 

start.cvaction

Edited by Grennesa

Share this post


Link to post
Share on other sites
  • 0
5 hours ago, Grennesa said:

Ok I've posted a quick guide for everyone based on whats been found so far.

Would be amazing to somehow trigger a different scene once the movie was paused but no idea how or if this is possible. 

 

Thanks so much for doing this! I'll approve it here in a second.

4 hours ago, btiltman said:

Where did you put it.....   can't seem to find it anywhere?

When folks post new guides, staff has to approve them. This is just in case we have some rogue person out there that wants to spam vulgar material. That way it doesnt get added to the site and scraped by Google. We don't want to become a porn site. :)

Share this post


Link to post
Share on other sites
  • 0

Alright the guide and LIFX Actions are up. I standardized it and added some things, so let me know if it's on par or if I missed the mark with my edits. I'm still putting some of the Actions together, but the important ones are there.

 

Share this post


Link to post
Share on other sites
  • 0

Looks good to me :D

Great job Grenessa & Ragnarok!

Ragnarok - you need to do a quick edit of the LIFX Guide subheading, it still says Philips Hue in there.  What's the CLIP API Debugger?  Is that left over from the Philips Hue docs as well?

 

 

Edited by btiltman
  • Upvote 1

Share this post


Link to post
Share on other sites
  • 0
46 minutes ago, btiltman said:

Looks good to me :D

Great job Grenessa & Ragnarok!

Ragnarok - you need to do a quick edit of the LIFX Guide subheading, it still says Philips Hue in there.  What's the CLIP API Debugger?  Is that left over from the Philips Hue docs as well?

 

 

Whoops! :)

  • Upvote 1

Share this post


Link to post
Share on other sites
  • 0

Just tested it all  out and it all works well at my end, including the pause and abort features.  So I've updated the guide to reflect this (I had put in something about the lights not changing while pausing). 

Guide looks far more pro now Ragnarok.

The only thought would be to have an ability to trigger an action a specific time marker be that from a txt file within the movie folder or some other way (i.e when the credits roll) so the light start coming up then.  

But its a great start on the whole I'm pretty happy. 

 

 

Edited by Grennesa
  • Upvote 1

Share this post


Link to post
Share on other sites
  • 0
On 7/20/2016 at 10:02 AM, Grennesa said:

Just tested it all  out and it all works well at my end, including the pause and abort features.  So I've updated the guide to reflect this (I had put in something about the lights not changing while pausing). 

Guide looks far more pro now Ragnarok.

The only thought would be to have an ability to trigger an action a specific time marker be that from a txt file within the movie folder or some other way (i.e when the credits roll) so the light start coming up then.  

But its a great start on the whole I'm pretty happy. 

 

 

Have you done one for 'resume' that turns the lights back off after a pause?  I can seem to get the format for the power:off command right

Share this post


Link to post
Share on other sites
  • 0
On 23 July 2016 at 4:34 PM, btiltman said:

Have you done one for 'resume' that turns the lights back off after a pause?  I can seem to get the format for the power:off command right

I just copied the file I used for my main feature and renamed it to be a resume file and that worked for me

Share this post


Link to post
Share on other sites
  • 0
22 minutes ago, Grennesa said:

I just copied the file I used for my main feature and renamed it to be a resume file and that worked for me

There's also a setting that replays the last Action, that way if you pause anywhere in your sequence it simply resets.

Share this post


Link to post
Share on other sites
  • 0
19 hours ago, Grennesa said:

I just copied the file I used for my main feature and renamed it to be a resume file and that worked for me

I don't want to use a scene on resume, I want to turn them completely off using the Power Off setting for that 'Group', as a scene can only go down to 1%. I will keep playing with it. I can get it to work in the cloud debug window but for some reason I can't translate it properly into the action file. 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Guidelines and Terms of Use.