Open Source Ambilight LEDs on a Raspberry Pi for $100

I made this for about $100 with a Raspberry Pi and no soldering:

Fluid Sim Hue Test on YouTube

I’ve always thought that Philips Ambilight TVs were cool. They do what you see in that video: shine the edge colors past the TV. But it was always a “nice to have,” so when I was buying my TV I prioritized other features. Later, Philips launched the Hue Play HDMI Sync Box, which would let you create an Ambilight effect with Hue light strips. Again, cool, but not $300-and-tied-to-a-proprietary-system cool.

BTW, the generic name for “Ambilight” is “bias lighting,” so I’m going to start writing that instead. Aside from looking cool, I’ve had some eye strain issues with my TV and heard that bias lighting could help with that. After using it for about a week I can say that yes, it does!

I’ve also known that LED light strips are really cool to work with, but it’s been years since I soldered anything so it was all pretty intimidating. Also intimidating: flashing microcontrollers like the ESP32. I’ve always felt more comfortable with a Raspberry Pi because it’s a Unix system; I know this. When I found out that I could build a bias lighting system for about $100 with a Raspberry Pi and no soldering, I jumped on it. It started with this video guide from DrZzs:

The magic behind it is Hyperion, an open source system for doing bias lighting based on an HDMI input source. I had no idea something like that existed, and now it’s glued to the back of my TV. As a bonus, there are a bunch of fun effects so you can use it as an ambient RGB light when your TV is off. I can also control it with Home Assistant!

Here’s what I wound up buying:


DrZzs recommends these 150 LED/5m strips but I bought these 300 LED/5m version. In retrospect, the 150 LEDs would probably have been better because they are lower power and we don’t need very high resolution for this. I have a 55″ TV and used 212 LEDs from the strip.

Power Supply

Someone on reddit suggested a 20W power supply to go along with the higher power usage for a 300 LED/5m strip. I prefer the 10W power supply that DrZzs linked to for two reasons:

  1. The 20W supply requires you to wire your own power cord in
  2. The 10W supply comes with a barrel connector that makes plugging everything in easy

Remember, I’m threading the needle between “excited for bias lighting” and “too complicated to bother with,” so convenience matters.

I was worried that the 10W supply wouldn’t be enough for the 300 LED strip, and technically it isn’t. The conservative estimate for amperage is 0.06A/LED, so 300 LEDs could need as much as 18A. Also I followed DrZzs tip around 15:30 to power the Raspberry Pi from the same power supply, which recommends 2.5A. However, the more realistic calculation for LEDs is 0.02A/LED and 350mA for the Pi, so my final power estimate is about 4.5A. Plenty of power from a 10A supply.

HDMI Capture

The HDMI Capture Loop that DrZzs linked to in his description is sold out on Amazon so I went with a solution I found in the reddit comments. DrZzs’s recommendation is a capture loop – it sits inline with the HDMI between the source and TV, and sends a capture to the Pi via USB.

I got this 4K HDMI splitter and this 1080p USB capture card. It means more HDMI cables behind my TV, but also helps with my cable management because my TV’s inputs are separate from the TV. So the HDMI splitter sits in my media console while the Pi is on the back of the TV.


These little wires are actually a huge part of what makes this project accessible to me. When I’ve seen LED projects before, you’ve had to solder wires to a ESP32 and then to the tiny contact strips. What I like about this project is that I grab a female-to-female wire, plug it in to a GPIO pin on the Pi, and plug it on to the male connector of the LED strip. Done. Connected.

These corner connectors are great for making the LED strips sit flat. When I was roughing the LEDs in, I just made loops at the corners to get a bend, but these make it look much better. It took me a few tries to figure out that the corners and strips go under the pins, but I got there eventually. Also the pins weren’t perfectly aligned with the copper bits on the LED strip, at least until I nudged them into place.


I did run in to some problems, or at least went off script from the tutorial video. First, instead of using Raspbian and manually installing Hyperion like in the video, I used a Pi image put out by Hyperion called Hyperbian. Download the image, flash it to an SD card, set up the WLAN and it’s good to go.

Second, the LED strips on the Pi just did not work right when I connected the data pin to GPIO 18. I think DrZzs glosses over the importance of having the Pi and the LED light strip share a common ground. The lights were fuzzy and not powering all the way until I grounded the LEDs to the Pi. Just like I have a wire going from the GPIO 18 pin on the Pi to the data pin on the LEDs, I added another wire going from the ground pin on the LED strip to a ground pin on the Pi. Suddenly everything lit up perfectly.

The last gotcha was that there was quite a bit of lag between the TV screen and the LEDs. If you don’t notice latency, don’t go looking for it. You will be cursed with the knowledge that it’s there. I’m not going to mention it to my family so they don’t notice it. I did make good progress on reducing the latency though, and I’ll outline how in a future post.

This was a fun project and I’m much more comfortable with LED strips now. I’m looking for other places in my house to install them. It’s also been fun to see which scenes have been really enhanced by the lights. I’ll end with one of my favorite examples so far, from Mary Poppins:

iOS Widgets for Home Assistant with Workflow

One of the key principles of home automation is being able to control things quickly and easily. I don’t want to have to unlock my phone, open an app, wait for it to load, and then finally find the device I want to control.

I like that SmartThings supports the Today screen widgets in iOS. They let me swipe dow on my locked phone and trigger a routine. For example, I have a button set up to run “Good Night” when I get to bed, which turns off lights, locks the door, and sets the thermostat.

I wanted the same in Home Assistant. It turns out that Workflow is perfect for this.

If you have the Workflow app installed, here’s an example workflow you can customize.

To make this, I created a new “Today Widget” workflow in the app. Basically we are going to create a call to the Home Assistant RESTful API, so to start you need to add a URL action. This should be in the form of https://your-home-assistant-site/api/services/domain/service. For example, if we want to toggle the bedroom lights of the Home Assistant demo site we would put in the URL

Next, add the “Get Contents of URL” action. Set the Method to POST, under headers add “x-ha-access” as the key and your Home Assistant password as the value. Set the Request Body to JSON and add any service parameters in the Request body. In our example we send a text value for “entity_id” as “group.bedroom”.

At this point you should be all ready to try it out! Here’s what it looks like:

Screenshot of the finished workflow

(note that is not my real passphrase)

Workflow is a great way to build easy-access buttons to run things in Home Assistant. Along with the Home Assistant native app, I think Workflow is a must-have for any iOS user.

My Home Automation Rules

In my last post about smart homes, I promised to outline what I have automated. A lot of home automation talk is about the gizmos and I don’t think enough is about the actual automation. These are actual automations; things a computer does to my house for me.

Our front porch light turns on at sunset. It turns off when we go to bed – I don’t want to contribute too much to light pollution by leaving it on all night. We manually hit a “Good Night” widget in iOS’s Notification Center to trigger this.

We also have interior lights come on at sunset if no one is home, as determined by the location of our phones, so that the dogs don’t get stuck alone in the dark. They don’t seem to mind the darkness but I feel bad enough to have created a rule to automate this.

We do not turn on the lights automatically when we are home. Sometimes it’s dark before sunset, sometimes it’s light after.  It’s less weird to manually turn on the lights. I might try to use some luminescence sensors to do this in the future.

The thermostat goes into energy saving mode when we are away from the house. High temperature in the summer, low in the winter. It uses less energy to return the house to normal temperature than it does to maintain normal temperature when no one is home. If you are going to do this, be sure to create a “Guest” mode for when you have a babysitter / houseguest.

The thermostat also changes to cooler temperatures when we go to sleep. It’s like having a programmable thermostat that is based around us instead of a clock.

I have an app that turns the furnace fan on for 10 minutes every hour, to even out the temperatures in the house. Our bedroom is closed off during the day so it’s extra warm in the summer and extra cool in the winter. It’s nice to come to bed and have the bedroom a normal temperature.

Our door from our house to our garage (as opposed to garage door) unlocks when we arrive home. This is awesome because we have an RFID key on our Honda, which means you can get in the house without ever having to take your keys out of your purse or pocket.

If the garage door is open when we go to bed, we get a push notification. It’s a handy reminder for when we accidentally leave it open.

If the smoke alarm goes off, all the smart lights in the house come on.

I’ve been purposefully vague about how I set all this up. Partly its because its in SmartThings and my goal is to move to Home Assistant. Partly its because you can do this stuff with most smart home systems.

I’m happy to answer questions in the comments if anyone wants to know how I did something. I’d also love to hear other automation rules that you love.

What’s the stupidest/weirdest project you used a RPi for?

This thread on reddit has some really fun ideas for a Raspberry Pi. Some of my favorites:

The NoIR module is a camera for the Raspberry Pi with no infrared filter, which means you can use IR LEDs to light up a room without anyone seeing.

Photo credit: Multicherry (CC) BY-SA

Smart Home Advice At The End of 2016


My friend, a recent dad, asked me for some advice on what smart home stuff he should get. I figured I’d share my response with everyone. This is just an overview of the stuff I recommend for him, a savvy dev-turned-leader. He’ll be reading this, so if you have suggestions or alternatives, leave them in the comments.

To start with, the whole smart home thing is still in the hobbyist phase. I define “hobby” as something you throw time and money at in order to fix problems you created for yourself. Smart homes are a great way to turn time and money into problems!

When things work, however, it’s great to have the house anticipate your routines.

Hub: SmartThings

It’s possible to roll things together without a hub but I like having a central place for everything. By centralizing all your smart home gizmos with a hub, they can talk to each other.  Metcalf’s Law means that the more you add to your hub, the better it gets.

SmartThings is The Wirecutter’s pick. SmartThings is also reasonably open and easy to get started with;  I like the SmartRules app for simple conditional programming. It works with most stuff, has a healthy ecosystem and can be hacked through their dev portal.

You can set up “routines” which are basically saying “turn this stuff on/off”. The routines can be tied to triggers like time of day, sunrise/sunset,or leaving/coming home.

There are a few drawbacks. The SmartThings-branded hardware is slightly cheaper but locks you into their ecosystem thanks to the looseness of the Zigbee protocol. If you stick to more open protocols like Z-Wave (I like stuff from Aeon Labs and Jasco/GE;  Monoprice has some cheaper stuff too), you’ll be fine if you decide to switch systems later on. SmartThings is also cloud-based, but their availability has been pretty solid lately.

It doesn’t support HomeKit natively. You’d need to install the Node.js app Homebridge on a computer in your house. HomeKit is what allows Siri to control things, and also give you a nice swipe-up control panel for lights in iOS 10.

While I use currently SmartThings, I’m really looking forward to moving to Home Assistant as my hub. It’s open source and supports a ton of platforms. Home Assistant is a whole other time suck and so you may not want to start off with it. The biggest thing that’s stopping me (aside from the time thing) is the iOS app. We use the Widgets in Notification Center to trigger routines, and the iOS app detects whether we’re home or not. When it’s solid I plan on migrating all my SmartThings stuff to Home Assistant.

Lights: Not Smart Bulbs

If at all possible, use Z-Wave in-wall switches and plug-in outlets (Wirecutter’s recommendations). One of my goals with home automation is that you should never have to use a phone to do anything. Guests will appreciate not needing an instruction manual to turn on the light.

In SmartThings you can set plugs and switches to turn on/turn off/dim together, so you can have multiple lights in a room all controlled by a single switch. Another nice thing about smart lighting is turn everything off from bed. The plug-in outlets are great at Christmas time too.

In-wall switches require a neutral wire. Open up your switches and look before you buy anything. My house has neutral wires for the overhead lights but not for the switches that control outlets, which makes things much more difficult.

Thermostat: Ecobee 3

I don’t have this thermostat (I have a super-dumb Z-Wave thermostat controlled by rules from SmartThings). The Wirecutter recommends the Nest. That said, the Ecobee has a big following and has impressed me by supporting occupancy sensors (that work with Home Assistant) to make sure that the temperature is right where people are. I’ve hacked some stuff together a poor facsimile with a Z-Wave temperature sensor, but this is a much more straight forward way to go.

I am a fan of smart thermostats in general. Being able to reduce energy usage when you’re out of the house is a no-brainer in terms of efficiency. Being able to turn up the heat from bed is pretty great too.

You will want to check if your thermostat has a C-wire – if not you’ll need to plug the thermostat into the wall. The reasons I went with my thermostat is partly because I don’t have a C-wire and partly because Z-Wave doesn’t rely on the cloud.

Cameras: I dunno, maybe a Foscam?

You’ll probably be happy with one of the Wirecutter’s choices.

Checking whether a kid is up without opening the door is fantastic. That’s all I really use my cameras for.

I have these Insteon-branded Foscams and the video quality is pretty bad but they were cheap and they work. They don’t require any cloud anything – they host their own webserver right on board. They work great at night and if the kids mess with them I can steer them back into position. Here’s a cheap HD Foscam.

Everything else:

Smart locks can be neat. There are some security concerns, but there are also security concerns with consumer-grade dumb locks and first floor windows so you’ll probably be fine if you get one. Never getting locked out of your house is pretty nice too.

Motion sensors can be handy too, for triggering scenes or turning on lights. I like my Amazon Echo but the Google Home looks like it’ll be really good in the near future.

Did you happen to notice my continuous digs at the cloud? I’m a big fan of keeping control of my home in my home and having the lights keep working even if the internet is out. I don’t want to have to dig my switches out of the wall when a cloud company goes out of business. Personal preference.

That’s it for the stuff. Next up will be actual automation rules that to tie the stuff together.

How to put Amazon Echo shopping list items in Wunderlist

First off, if you use iOS and don’t have an Echo, use Kitchen Sync for your shopping list. It organizes everything by shopping aisle and works with iCloud so it’s super easy to share a list with your family. Plus Adam is a good guy.

We use Wunderlist for our shopping list, so I set up an IFTTT recipe to put our Echo’s shopping list into Wunderlist.

Here’s how you can too:

  1. Go to Mail to Wunderlist Settings and set your Gmail address to go to your shopping list.
  2. Add this recipe (be sure to put as the email address):IFTTT Recipe: Add Alexa shopping list items to Wunderlist connects amazon-alexa to gmail//

Some caveats: IFTTT checks the shopping list roughly every 15 minutes, so if something is time sensitive you’re better off using the Wunderlist app. It also doesn’t update the Alexa shopping list when you check it off in Wunderlist, but who looks at the Alexa shopping list anyway?

My Life With SmartThings (so far)

I’ve been using SmartThings for home automation for about 6 months now and figured it’s worth getting some of my thoughts down.

I’ll start in this post with what I’ve got set up:

5 GE Link LED bulbs in my family room. I actually needed to get an updated firmware for these to work, so I put in a support ticket on a Saturday after noon and got a response saying the firmware was updated in less than 10 minutes. I was impressed enough with their support to remember all that.

When I started going down the home automation path I was thinking about what I had done with X-10 many years ago and expected outlet switches to be the way to go. It turns out that a $15 LED bulb is cheaper than a $40 outlet switch.

I originally had them set to come on at sunset, but that became kind of annoying because it was still light out, so now we just turn them on with the app. Still easier than turning on 5 lights individually, and I can turn them off from my bed.

My bedroom lamps on some Z-Wave outlet switches. It’s been extremely nice to come upstairs to a lit room; the placement of outlets and switches in our bedroom made it annoying to turn on lights when we got into the bedroom. But I also have to open the app to turn off the lights, which can be annoying. (I’m hoping the iOS 8 widget will smooth this process)

A water sensor in my basement. I’m paranoid about water down there and this gives me peace of mind. I also moved it to my bathroom after doing some plumbing so that I knew I wouldn’t walk into a flood zone some morning.

A smoke/carbon monoxide sensor, also for peace of mind and if my family is out and there were an emergency I could get the fire department over ASAP (assuming that the internet didn’t go out first).

A window sensor in my daughter’s room so that my wife and I can figure out if we left it open without having to wake her.

2 super cheap IP cameras – again, great for checking on a toddler without waking her. The second one is deployed to watch the front door, mostly so I can see what the dogs are barking at while I’m in the basement. When baby #2 comes in October that one will get moved to childcare duties as well

Finally, SmartThings can host applications, so I’ve installed SmartTiles (née ActiON Desktop) as a simple way for house guests like my mother-in-law to turn stuff off and on:

The thing I like about this hobby (and it’s totally a hobby) is that it can be iterative and cumulative. When I want to play around with it, I can start adding new things and integrating them. Then, when I don’t have the energy to mess around with it, I can let it coast in its current configuration for a while until I’m game to playing with it again.

What I want to focus on next is providing more physical access (switches and buttons) so that I don’t have to use the app (and so that house guests don’t need a web interface).