How to set up motion-triggered smart lights as an Alexa routine


This routine makes it easy to see down the hallway, but the dark blue doesn’t interfere with night vision.

Last year I wrote a review of the beautiful Govee Lyra lightbar and showed that it can be paired with a motion sensor. But I haven’t really gone into detail on how to do that and how to think about setting up smart home triggers and actions.

In this article we will do just that. We use the Hue motion sensor as a sensor trigger, the Lyra light bar as the device that takes action and Alexa as the voice trigger and control mechanism.

It’s important to choose devices that work with Alexa’s Routines. Routines are small widgets that control how smart devices behave.

motion sensor: I chose the motion sensor Hue motion sensor. I chose it because it was one of the few motion sensors that uses AAA batteries, which means the sensor should run for about two years without changing the battery. I don’t like having to regularly change the batteries on my smart devices. I prefer to set them up and just let them run. A downside is that the Hue motion sensor requires it Hue Bridgebut since I already had one for my Hue lights, there wasn’t really a barrier to entry.

Smart Lights: My goal was to turn the light on and off in a particularly dark hallway. That Govee Lyra was perfect to fit in a corner and light up the room with a pretty shade of blue. So I decided to use that.

alexa: We have Alexa devices throughout the house and have built our smart home infrastructure around them. So it made sense that we would use the Alexa Routines feature for this application as well.

Almost every smart home provider has some kind of proprietary app to control their offerings. In most cases, before you can have Alexa control a device, it must first be controlled by the provider’s app. I won’t go into detail on either the Hue app or the Govee app as each provider’s app is different.

The most important thing is that you need to make sure you have an account (since there is an internet component), install the app and configure your device to be controlled by this app. In the Hue app, I named my motion sensor “Hall Motion Sensor”.

Once you have verified that the device can be controlled by the provider’s app, you can proceed to the next step.

Alexa Skills are like little add-on plugins for Alexa. While some skills teach Alexa fart (installed more than 116,000 times) or burp (installed more than 1,400 times), other skills will help you order pizza or learn the Elements. However, the capabilities we are interested in are those provided by smart device vendors to control their devices.

To find a skill, open your Alexa app, press the More icon at the bottom of the page, then select Skills & Games from the menu. After that, click the magnifying glass icon to search for a skill. In my case I was looking for Hue. Repeat this and the next step for Govee (and any other lights that need to be controlled).


After searching and finding the device vendor skill, you should associate the skill. Most of the time, this involves clicking the Activate button and then logging in with the username and password you used when setting up an account with the provider.

My Govee skill is already enabled in the Alexa app as you can see in the screenshot below.


This is the core of the process. If Alexa Skills are like plugins, Routines are like Actions – small scripts that interact with Alexa and the plugin-controlled devices. Vendors write the skills that power the devices, but you can easily set up a routine by selecting options on a form.

We’ll start by opening the Alexa app, pressing the More icon at the bottom of the screen, then tapping Routines. To add a new routine, tap the plus sign at the top right of the screen.


Below is the blank screen for the new routine. Tap first Enter the name of the routine. We call ours Hallway Motion.


The trigger is the event that causes the routine to run. To define a trigger in Alexa, click When that happens on the routine screen. You’ll see a whole bunch of categories. Choose Smart Home for our motion sensor. Smart Home controls most smart home devices.


The Alexa app presents you with a list of devices that can act as triggers. These are the devices that were previously linked to Alexa as skills. In my case, I have three sensors, the Hue Motion Sensor, an Echo Show that can detect motion, and a temperature sensor called “Upstairs” because it’s…wait for it…upstairs.

let’s click Hall motion sensor.


This next screen gives us a few options. First we need to decide whether we want the trigger to fire when it senses motion or when it doesn’t. Since we want the light to come on when motion is detected, we set When Motion Is… to recognized.


Back on the New Routine screen, let’s click Add action. Again we see a number of categories. Most likely, your action category list will be longer than your trigger category list. That’s because most homes have more things that can be turned on and off than devices that send status updates.

In our case we will choose again smart home. As you can see, you can apply the action to all devices, just one light, a group of lights, or a scene. We only want to turn on a single light, so let’s select it lighting.


All your smart lights are shown with names. i will choose lyre and then tap Next. Here I have the choice of what I want to set. I want to turn the light on fully and make it blue.


Once you have configured the light, press Next, and you are returned to the main screen of the routine. blow Save on computerand you are done.


As this back hallway is very dark, we prefer to leave the lights on. That means if we want to turn off the light, we can just say, “Alexa, turn off Lyra” and it goes off.

I also set up another routine, this time triggered by a schedule that turns off the Lyra about half an hour after sunrise. This is done by creating a new routine, setting “When this happens” to Schedule, defining the time on the schedule form (sunrise and sunset are included), and then setting the action to “Add” to turn Lyra off.

Once you get comfortable with routines, you can make all sorts of changes. We have a few other lights in the house that come on at sunset and go out at sunrise. When I first started playing with routines, I set Alexa to play “Here comes the sun” early in the morning to wake up to, but I slept through. It was fun, but a plain old loud alarm sound works better for me.

So what about you? What routines have you set up? Let us know in the comments below.

You can follow my daily project updates on social media. Be sure to follow me on Twitter at @DavidGewirtzon Facebook at, on Instagram at and on YouTube at

Leave a Reply

Your email address will not be published. Required fields are marked *