CNET también está disponible en español.

Ir a español

Don't show this again

Smart Home

How to fall asleep to a voice-activated sunset

Want your lights to lull you into a peaceful slumber? With the right bulbs and a little help from IFTTT, you can ask Alexa or Google to fade them out as you fall asleep.

Chris Monroe/CNET

If you're anything like me, you sometimes struggle to fall asleep at the end of the day. One thing I've found that really seems to help: having a light in my bedroom that slowly fades out as I drift off.

There are lots of smart bulbs that can do the job quite nicely, but you'll want to put some thought into how you're going to trigger the fade each night. A lot of bulbs will let you schedule a fadeout to run at a specific time, but most of us don't go to bed at the same time every night. For my money, the better approach is to kick things off with a simple voice command as you climb into bed. If you want to try it out for yourself, here's how to do it:

Step 1: Get the right gadgets

lifx-google-home.jpg

To make this work, you'll need a smart speaker that lets you create custom voice commands on IFTTT (Google Home and Amazon Echo devices will both work) as well as an IFTTT-compatible smart bulb that lets you customize fade durations (Lifx is one of your only options).

Taylor Martin/CNET

Voice control platforms like Siri, Alexa and Google Assistant can all turn your lights on and off when you ask, but none of them can tell your lights to slowly fade out. For that, we'll need a little help from IFTTT. Both Alexa and Google Assistant can trigger anything on IFTTT with a custom voice command, so either one will work. Siri doesn't have an IFTTT channel, so she's out -- sorry, HomeKit fans.

Your lighting options are even more limited. Lots of smart bulbs work with IFTTT, but you've only got two options that let you trigger timed fades. The first is the WeMo Lighting IFTTT channel, which supports Belkin's now-discontinued WeMo LEDs as well as a number of smart bulbs from Osram. The other, easier option is Lifx -- not only does its IFTTT channel let you trigger customizable timed fades, but its bulbs use Wi-Fi and don't require an extra hub device like the Osram and Belkin bulbs do. Just screw one in, sync with it on your phone and you'll be good to go. For the sake of this post, let's assume that's what you're going with.

As for your two assistant options, the only difference is that Google offers options for crafting your custom voice command that are more flexible and robust than what you'll get with Alexa. You don't need to start your command off with the word "trigger" like you do with Alexa, for instance, and you also get the option of adding in one or two extra variations on the phrasing. You can even tell Google Assistant what to say in response to your command, which is nice if you enjoy having an artificially intelligent, disembodied voice in your bedroom tell you not to let the bedbugs bite.

At any rate, either assistant will work, just so long as you have a way to talk to it in your bedroom. An Amazon Echo Dot (£49.99 at Amazon.co.uk) or a Google Home Mini on your nightstand will do the job just fine.

Step 2: Set everything up

Once you've got the devices you need, you'll need to connect with everything. Lifx, Alexa and Google Assistant all make this pretty simple -- just screw in your bulb or plug in your speaker, then follow the instructions in its app to pair it with your phone.

Next, you'll need to get up and running with IFTTT, which is also pretty easy. To do so, download the IFTTT app or go to IFTTT's website and set up a free account. Once you're logged in, you'll need to activate the channels for your devices. To do so, go to IFTTT's list of services and find the Lifx channel for your bulbs and either the Alexa or Google Assistant channel for your speaker. Click "connect" in each one and follow the instructions to bring IFTTT into the fold.

img-5447

Screenshot by Ry Crist/CNET

Step 3: Fine-tune your trigger command

IFTTT is short for "if this, then that," and that's the basic structure when you're using the platform to link two devices together. In this case, we're going to make a rule (IFTTT used to called them "recipes" but now calls them "applets") that tells our Lifx bulb to fade out over 45 minutes whenever we trigger it with an Alexa voice command (the steps are essentially the same if you're using Google -- just swap the Google Assistant channel in for the Amazon Alexa channel where necessary).

To make it, just tap the little plus icon in the IFTTT app to start putting the pieces together. Up first: the voice command (the "if this" part of the Applet). Select the Amazon Alexa channel as your trigger service, then select "Say a specific phrase" as the trigger. That specific phrase is what you'll say after saying, "Alexa, trigger..." so pick something that won't be too tough to remember or too clunky to say. I went with, "a sleep fade," which makes the trigger command, "Alexa, trigger a sleep fade."

As mentioned before, you don't need to say "trigger" before saying your customized phrase if you're using Google Assistant -- you'll just say, "OK Google," or, "Hey Google" to wake the speaker up, then you'll say whatever phrase you've chosen.

img-5448

Screenshot by Ry Crist/CNET

Step 4: Customize your action

Next, you need to craft the action -- the "then that" part of the equation. That'd be your smart bulb fading out.

To do so, just continue to follow the instructions in the IFTTT app's Applet creator. Like before, it'll ask you to pick which service you want to use, and this time, you'll select Lifx. From there, select "Turn lights off" as your action of choice. IFTTT will ask you which lights you want to turn off -- you can pick a single bulb, or if you've grouped your bulbs in the Lifx app, an entire room of bulbs. And, critically, it also asks you to select a fade duration. From my own experience, I've found 45 minutes to be a good length, but go with whatever you like.

That should do it. The IFTTT app will give you one last look at your applet before you confirm its creation. Just tap "Finish" and you'll be all set.

htsunrise

Tyler Lizenby/CNET

Step 5: Hit the sack

All that's left to do now is finish a busy day, retire for the evening, and tell Alexa or Google Assistant to hit the lights.

Don't feel like you need to stop there, though. For instance, if you want, you could create another IFTTT applet that changes the color of your Lifx bulb to a random shade each evening before bed (this works even if the bulb isn't actually shining). Then, when you turn the bulb on and activate your sleep fade, it'll be a different color each night.

If you don't have a voice-activated smart speaker handy, don't worry, because there are lots of other ways for you to trigger this applet. You could, for instance, sync up with an IFTTT-friendly wearable, or just use IFTTT's "Do" buttons to create a shortcut on your phone that triggers the fade with a single tap. For even easier access, try adding that shortcut into your iPhone (£699.00 at Apple) or Android device's home screen using the IFTTT widget.

And hey, no matter what you want to do, you'll have an easier time being creative if you get a good night's rest. There's nothing that isn't smart about that.