Version 0.6.0 is out with general improvements all around. Most work is done improving the ambilight colors. All work is done by Rob Walch (thanks). Full details are available on GitHub.
Preview:
Enjoy!
Version 0.6.0 is out with general improvements all around. Most work is done improving the ambilight colors. All work is done by Rob Walch (thanks). Full details are available on GitHub.
Preview:
Enjoy!
A new version of the add-on is available on Github, version 0.5.1!
Version 0.5.1 is more stable, has better control over the advanced settings, adds debug logging and support Philips livingwhite bulbs.
Download the latest version from GitHub:
https://github.com/cees-elzinga/script.xbmc.hue.ambilight/
Should you run into any problems, please enable the “debug logging” from the advanced settings panel. It will log a bunch of information to your xbmc.log that will greatly help me to debug the issue at hand.
I’m getting a lot of feedback and I added some features that were requested. Enjoy!
Quick update: the name of the add-on changed.
Version 0.3 is out with improved ambilight mode and improved support for handling lights simultaneously.
Available at: GitHub: script.xbmc.hue
Please check the README instructions on github, you’ll need to install scripts.module.requests.
A small preview:
Note: this post old, see meethue.wordpress.com for the latest information.
Version 0.1 of the XBMC add-on is available on GitHub! Make sure you install the Python PIL library first (http://www.pythonware.com/products/pil/)
Download script.xbmc.hue at GitHub
It supports two modes of operations: “Theatre mode” and “Ambilight mode”.
The “Theatre mode” is fully functional. It will dim the lights when a movie starts playing, and turn them back on once stopped. The “Ambilight mode” needs some more work. The biggest issue is that it takes approximately 1 second to adjust the lights. The time is spent by the bridge, and I don’t see any quick way to improve it. For now – “Ambilight mode” works but will be out of sync with the video streams for at least 1 second. [update 2013-03: a new version of the add-on is available on github and has better response times]
Download script.xbmc.hue at GitHub
If you have any feedback, please leave a reply!
A preview of my add-on for XBMC that turns your Philips Hue lights in a big ambilight. Excuse the iPhone video quality..
Finding Nemo trailer
I will open-source the project soon!
This post takes the first steps into creating an add-on for XBMC that controls your Philips Hue lights.
The add-on will consist of three parts:
1. Snapping pictures of the video
2. Calculating the most dominant/average color
3. Controlling the lights
I started with calculating the average color of an image. As a sample image I used the trailer for Finding Nemo, and snapped a picture every 10 seconds.
My first, naive, approach was to resize the image and iterate over every pixel in the image. For every pixel I updated a global “red”, “green” and “blue” counter, and devided the end result with the number of pixels. This works quite well, but the average colors are a bit dull. In a similar way I calculated average HSB values. There appears to be a small bug in my code (blue pictures get an average HSB of green-ish). The first results:
In a second attempt I still iterate over every pixel, but calculate how the pictures are aligned over the Hue spectrum. See the images below, where the right pictures shows the Hue spectrum from 0 to 360 degrees and how many pixels are in the image per Hue value.
For the resulting value I divide the Hue in 10 degree sections, and use this as the most occuring Hue (+5). So in the example the most dominant section/”bin” would be 20-30, and the resulting Hue will be 20 + 5 = 25.
The results:
Next up: building a XBMC package
Update 2013-03: The XBMC add-on is available, see https://meethue.wordpress.com/2013/02/22/xbmc-add-on-improved-ambilight/