automating lightbulbs with LiFX and IFTTT

Author
Stuart
Category
blog
Date

If you’ve seen the transcripts or video from some of my talks, you may have noticed that I’ve talked about LIFX lightbulbs and If This Then That (IFTTT). LIFX are Wi-Fi enabled lightbulbs which can be controlled via their app, the Internet, a couple of different programming languages and - it seems - magic at times. IFTTT is an amazing website which lets you connect up lots of different web services, for instance: IF I leave my office THEN turn off my office light.

If you want to follow along at home, you need to get yourself one or more LIFX bulbs and an IFTTT account. That done, get your Designated Pair of Hands™ to plug the bulbs into any normal light socket and connect them to your home Wi-Fi network. You can then use the iOS or Android app to configure your bulbs, turn them on and off, change the colour and a whole host of other things.

IFTTT is divided into two parts, Triggers and Actions. The triggers are the “If” part of the process, and the Actions are the “That” part of the process. There are Triggers and Actions for everything from YouTube to the Nest Thermostat, and over 150 other web services. Or Channels as IFTTT calls them.

Some things I do with my LIFX lightbulbs and IFTTT:

These three recipes simulate sunrise, sunset and finally turn lights off every night, to maintain a good routine and maximise whatever alertness and energy I can access. We make the lights go red in the evening to reduce blue spectrum light from my environment.[^red-light, and we simulate dawn every morning to invert the process.

Simulating sunrise at 6:15 AM each morning

IFTTT Recipe: At 6:15 AM each morning, slowly bring the house lights up from Orange to daylight. connects date-time to lifx

Simulating sunset beginning at 8:30 PM each evening

IFTTT Recipe: Simulate sunset every day at 8:30 PM. connects date-time to lifx

Lights out and being put to bed by the Internet at 10 PM every night. :-)

IFTTT Recipe: Lights out! connects date-time to lifx

Toggle my office lights when I send an email with the subject: #toggle-office

For something a little bit more complex, you need to set up the email channel on IFTTT. After that, every time you send an email to trigger@recipe.ifttt.com with the subject line: #toggle-office, your chosen light will toggle on or off.

IFTTT Recipe: If send an email with the subject: '#toggle-office', then toggle my Office lights on/off. connects email to lifx

Medication Reminder

To get a medication reminder once every three days at 8:30 AM you will need a Google calendar account and to activate the Google Calendar Channel. Then, add the name of the medication and the date and time you need to take it to your calendar and let IFTTT do the rest. Obviously you can change the time and date to suit your medication requirements. PLEASE DO NOT RELY ON THIS REMINDER FOR ANY LIFE-SAVING MEDICATION, IT IS AN AID TO MEMORY AND NOTHING ELSE.

IFTTT Recipe: If a search on Google calendar matches 'medication',  breathe all lights in the house. connects google-calendar to lifx

I also use a number of different shell scripts to to trigger different events on different lightbulbs around the house, I’ll be happy to share them should anybody need them.

Please let me know if you get stuck with anything, and I’ll be happy to help!

hardware, software, accessibility, light bulbs, and Stuart

comments powered by Disqus