Voice Activated Sunrise & Sunset Emulation with Smart Lights

I’ve slowly been equipping my Amazon Echo, aka Alexa, with connected hardware, and the next step was a smart light for the bedroom. I wanted a bulb that was full color, required no hub, integrated directly with Amazon Echo and had IFTTT integration. The only bulb that fit that criteria was the Lifx Multicolor Wi-Fi Smart LED Bulb. I also wanted to get an Amazon Echo Dot just for the bedroom.

First a brief warning about smart lights in the bedroom:

After I got everything all set up, there was a power outage in the middle of the night and I learned the hard way that “smart bulbs” have a really dumb design flaw because I was jolted awake by a giant supernova coming from the lamp. After much research I discovered there is not a single smart bulb that will maintain its current off state in the event of a power outage.

In the manufacturers view any state change resulting in electricity being terminated and restarting whether from a power outage or from flipping a light switch off and on should be treated as if the intention was from a mechanical switch turning on and therefore should always turn  the light on to achieve user expectations of traditional light switch operation. However we are dealing with an entirely new generational set up of devices here that should have new expectations of operation. The real switch that users are engaging with is not at the wall, it is by voice, by an app, or by a multitude of other possibilities that we are inventing and re-inventing.

Anybody who comes home to a house with every light on, or has been woken up in the middle of the night knows the status quo for this is not working, and at the very least we as users should have a choice for how our lights respond when the power comes on. It’s not like it would take much effort for manufacturers to accommodate such a feature by adding the option the settings for each light, but until they come around I had to come up with a solution.

So how can I keep my smart bulbs from turning on after a power outage? I was curious about how other IOT devices would react to the same scenario so I tested my Wemo Switches and found they remained inactive when power was restored even if they were in the active state when they lost power. So the plan I came up with is to use a Wemo Switch at the wall and then plug the lamp with the attached smart bulb into that and always keep the Wemo turned on so I can activate the smart bulb. In the event of a power outage I would just have to turn on the switch when needed.

This won’t be a solution for someone who wants their whole house to have smart bulbs. In that case I would recommend to skip smart bulbs entirely and instead install smart wall switches. You’ll save a lot more in the end.

 

You will first need to set up the Echo & the Lifx bulb according to their directions. You will then need to add the Lifx skill to Alexa to finish the main integration.

IFTTT
The greatest advantage of IFTTT is that it can greatly simplify the commands you say to your Echo. Instead of saying Alexa tell Life-ex to change bedroom to orange you can instead say Alexa trigger orange.  It gets better though because you can create more advanced settings, and that is how I achieved my sunrise and sunset routines.

Note: if you want to decrease your syllables even more, change the trigger word to be Echo instead of Alexa. It also de-anthropomorphizes the cloud service which I prefer.

To get started, you need to associate both your Lifx account and your Amazon account with your IFTTT account.

Check out all the Lifx Applets on IFTTT.

Sunrise
There are two options you might like, you can either have the light act like an alarm and run at a set time on specific days, or you can use a voice trigger to activate the sunrise whenever you start to wake up.  I’m only focusing on the voice activated transition since the alarm is pretty straight forward.

To do a proper lighting transition consists of creating the starting light color & brightness and then having the light transition to the final light color & brightness. It would be great if we could accomplish this with one easy voice activated step, but due to the nature of the available IFTTT applets, only Lifx can create applets that are more complex and do multiple things. For now we will have to create two Lifx Change Color applets.

Setting the sunrise scene:

  1. Turn On a new Lifx Change Color applet
  2. Customize the applet name, Lifx Change Color (twilight)
  3. For ‘What Phrase?’ enter twilight
  4. Select the light(s) you want affected in the dropdown
  5. Ignore the color for now
  6. Click Save
  7. Click the gear icon to edit the advanced options for the applet
  8. Under Advanced Options enter: brightness: 0; color: #000000;
  9. Click Save

Activating the sunrise transition:

  1. Turn On a new Lifx Change Color applet
  2. Customize the applet name, Lifx Change Color (sunrise)
  3. For ‘What Phrase?’ enter sunrise
  4. Select the light(s) you want affected in the dropdown
  5. Click Save
  6. Click the gear icon to edit the advanced options for the applet
  7. Under Advanced Options enter: transition_duration: 180; brightness: 1; color: #009BDE;
  8. Click Save

Now you should be able to say echo trigger twilight followed by echo trigger sunrise. Over 3 minutes (180 seconds) your light will transition from black to a bright blue. The color #009BDE was the closest match to the color from my Philips GoLITE Blu Energy Light.

Sunset
This is a great way to fall asleep, and since it is voice activated you don’t have to be constrained to a set timer. It is nice to trigger the sunset scene at any point in the night to put you in the getting ready for bed mindset and start producing melatonin. Then when you go to bed you can activate the sunset transition and easily fall asleep.

Setting the sunset scene:

  1. Turn On a new Lifx Change Color applet
  2. Customize the applet name, Lifx Change Color (evening)
  3. For ‘What Phrase?’ enter evening
  4. Select the light(s) you want affected in the dropdown
  5. Ignore the color for now
  6. Click Save
  7. Click the gear icon to edit the advanced options for the applet
  8. Set Color: Hot White
  9. Set Brightness 50%
  10. Turn on first? Yes
  11. Transition duration: 5 seconds
  12. Click Save

Activating the sunset transition:

  1. Turn On a new Lifx Change Color applet
  2. Customize the applet name, Lifx Change Color (sunset)
  3. For ‘What Phrase?’ enter sunset
  4. Select the light(s) you want affected in the dropdown
  5. Click Save
  6. Click the gear icon to edit the advanced options for the applet
  7. Under Advanced Options enter: transition_duration: 1800; brightness: 0; color: #E08A00;
  8. Click Save

Now you should be able to say echo trigger evening followed by echo trigger sunset. This says over 30 minutes (1800 seconds) transition from 50% brightness to 0% and from the Hot White color to #E08A00.

Leave a Reply