Phillips Light Bulb Diary:

The Phillips Light Bulb project was recently featured in the Herald Scotland and Deadline News, and as part of the development team behind the work, I thought it would be helpful to document how the project was developed and the code behind the project.

How it all came together:

In August 2014 Jamie Cross, Co-Investigator of the Off the Grid asked myself and Margus Lind to join another project that he was leading in collaboration with Knoydart Foundation, Local Energy Scotland and Community Energy Scotland.

The project was conceived following the development of a few data visualisations to try and find a way to translate the data from this tracker, and fragility of this micro-hydro into something more meaningful for the community without creating panic.

Tracker Hydro

Sitting in the Knoydart bunkhouse, the three of us were joined by Kyle Smith operations manager of Knoydart Foundation and Benny Talbot from Community Energy Scotland. We were trying to find a way to engage with the community and tourists about how to have better awareness of energy consumption to avoid power cuts and develop ways to use the surplus energy.

After a couple of hours of writing down ideas and sketches, Kyle enquired as to whether we had seen the new Phillips smart light bulbs. None of us have heard about them before, however after a few more hours of research, the next day Margus developed the first hack of the light bulb. We managed on our last night in Knoydart to install it on one of the computers in the community library. The purpose was to change the color of the light bulb according to the community energy consumption.

And this is what we left there for the following 3 months.

Phillips Hue in the library

First evaluation:

We ran focus groups, interviewed people and made various versions of our visualisations. Finally the community were happy with three final designs.

focus group

1:Smart light bulb

2:The new Power of knoydart website

3:Data kettle (a widget for windows computers that shows the amount of energy consumption as a water level in a kettle).

When we went back to Knoydart at the end of same year, we found out that not many people knew about our Power of knoydart website. Furthermore all of the lights in the library have been removed, and sadly not many people installed our kettle on their computers.

Not knowing about our website or the kettle widget was because of reasons as simple as: some lost the link to the page, some didn't know about it, and some found it unreliable that the page was often down.

The lights being moved from the library was again because our script lost communication with data server and the light bulb.


To solve the advertising problem Jamie printed out 300 water proof stickers that could be put in different locations as a point of reference. We've got one on our meeting room at Design informatics, here at University of Edinburgh!

To solve the reliability problem, we asked Chris Barker to join our team. The two of us developed a new and clean page for Power of Knoydart, made it more resilient and made an easy installation for the data kettle and we all advertised it on any medium that we could, for example Twitter, Facebook and other social networks.

The last problem was to draw attention to the light bulb. We needed to bring it to somewhere more public and in the view of both tourists and the community. We made a new version of the code which is documented and accessible on here: Power of Knoydart

Open source code and documentation:

I will publish the Phillips Python code on the Power of Knoydart website in the next couple of days. Here's how to do it yourself:

Here's how we hacked the Phillips light:

Get yourself a:

Raspberry pie (Instead of using a big computer, use one of these to save power and easy installation)

Phillips Hue

Miniature wifi (You need this to connect to the internet)

First You need to install a couple of libraries on the Raspberry pie in order to talk to the Phillips Hue light bulb.

Here's the list of libraries:

interp (You need this to convert numerical ranges, for example in our case if we're using 10kwh of electricity convert it to a range of green and if it's more that 140 - 180 convert it to a range of red)

phue (This is the important library that let's you speak with the smart bulb)

That's it. Install these by googling or ducking their name and python together.

And here's the simple code:

'''IP address of the Phillips Hue'''
b = phue.Bridge(
'''You can get it from their online console.'''

And then, changing light bulbs color according to your data, in my case it was a number between 0-180

if num>150 and num<=180: #num has the number I mentioned, the data you want to visualise into light colors.
    hue=int(interp(r,[150,180],[5000,1])) #interp will interpolate the values to the range I want here is red
elif num>100 and num<=150:
    hue=int(interp(r,[100,150],[15000,10000]))#here is yellow
elif num>0 and num<=100:
bri=255 #brightness of the light
sat=254 #saturation of the light
lights = b.lights #this will give me the list of light bulbs to iterate through
command = {#preparing a command to send to the Phillips Hue controller
        'transitiontime': 3,#how long to take to change to a new color.
        'on': True,
        'bri': 255,
        'hue': hue,
        'sat': 255
for l in lights:#iterate through and change colors.
    b.set_light(, command)