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!

Lorem ipsum dolor sit amet, sea eu causae aperiri periculis, iusto affert soleat an sea, soluta petentium inciderint nec no. Dolorum reprimique ullamcorper sed ad. Ei quo malorum singulis, tota mundi feugait ut pro. Choro utamur inimicus ex sea. Tota dicit te usu. Sea ad erant possim reformidans. An modus detraxit postulant vel. Per no habeo ludus qualisque. Vix legere singulis legendos et, an cum eius soluta accumsan. Facer discere no nec.
   Join Now

Download the Kodi Add-on Today!

Lorem ipsum dolor sit amet, sea eu causae aperiri periculis, iusto affert soleat an sea, soluta petentium inciderint nec no. Dolorum reprimique ullamcorper sed ad. Ei quo malorum singulis, tota mundi feugait ut pro. Choro utamur inimicus ex sea. Tota dicit te usu. Sea ad erant possim reformidans. An modus detraxit postulant vel. Per no habeo ludus qualisque. Vix legere singulis legendos et, an cum eius soluta accumsan. Facer discere no nec.
  • 0

Question

So it's been driving me nuts the past few nights running upstairs to attempt to fix code, then test it out back downstairs (yeah I could do it downstairs but trying to read the code on the TV screen from the couch hurts my eyes :) )  Anyways.  My pain, is your gain, incase anyone else is wanting to do the same.

I will have 5 hue lights, two on the sides of the couch, and 3 shining on the walls, however right now I only have 2, with a 3rd on the way today.   When it's time for Trivia, I use the Vibrant slides, so I want the lights to do a color loop, however I want each light independent of the other bulbs, basically I don't want the whole room green, then red, then blue, etc.  What I've been running in to is one light does job, but the others just stay at a constant color

Heres my code: (IP and Username removed)


# Turn the lights on to a white with a 3 second transitiontime
http://<removed>/groups/10/action
PUT:{"on":true,"sat":75,"bri":254,"hue":41432,"effect":"none", "transitiontime":30}

# Turn on each light and start the color loop, wait 1 seconds before turning on the next light
# else they all turn the same color at once
http://<removed>/lights/30/state
PUT:{"sat":254, "effect":"colorloop"}

#wait 1 second before setting the next light
sleep://1000

http://<removed>/lights/29/state
PUT:{"sat":254, "effect":"colorloop"}


 

So ideally what should happen is the lights turn on to their white-ish color, and then 1 by 1 they should be all color looping after waiting 1 second before going on to the next light.  However what's happening is just the one light is color looping while the other transitions to a blue light (the bulb is already at Hue:  41432 and Bri: 254 so when I tell it to saturate to 254 it goes from white to blue) but not picking up on the color loop

It took me a while to figure out why, turns out it's that initial transition time of 3 seconds.   While the bulb is transitioning it's not paying attention to the effects command, but does listen to the saturation command.

So how to fix this?   While I could remove the initial transition time I don't want the lights to abruptly turn on, so instead let's pause the script again.  This time adding an additional sleep command right after all the lights turn on.

so my final code looks like:


# Turn the lights on to a white with a 3 second transitiontime
http://<removed>/groups/10/action
PUT:{"on":true,"sat":75,"bri":254,"hue":41432,"effect":"none", "transitiontime":30}

#wait 3 seconds for the transition to finish
sleep://3000

# Turn on each light and start the color loop, wait 1 seconds before turning on the next light
# else they all turn the same color at once
http://<removed>/lights/30/state
PUT:{"sat":254, "effect":"colorloop"}

#wait 1 second before setting the next light
sleep://1000

http://<removed>/lights/29/state
PUT:{"sat":254, "effect":"colorloop"}


 

Now like I said I only have 2 bulbs in the room right now and I imagine if I had all 5 (god these buggers are expensive!) right away I suspect I would have picked up on the problem right away because as I sleep for 1 second between each bulb that transition would have eventually been completed on the other bulbs leaving it look like only 1 or 2 bulbs didn't catch the code while the rest did.

  • Upvote 2

Share this post


Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0

That is absolutely awesome. If you'd like, write a guide and post it in the guides section. This is exactly the kind of community involvement I love to see. Great work!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

About Us

CinemaVision began in 2014 as a collaboration to create content for use with your home theater, offering movie trivia slides and video bumpers. It has since grown to be THE PREMIER WAY to create and customize your preshow experience. Download the CinemaVision add-on for Kodi today from the official Kodi repository, and easily create a sequence of trivia, videos, trailers, home automation triggers and more that will bring the experience of a movie theater straight to your screen!

×

Important Information

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