Lesson 5: Motion Magic (Using the Zigbee Motion Sensor to Trigger Automations)
Today, your smart home gets reactive. In this lesson, you’ll learn how to set up the Zigbee motion sensor from your kit and use it to automate your lights, smart plugs, and scenes based on movement.
Start by pairing the motion sensor in Home Assistant by going to Settings > Devices & Services > ZHA > Add Device. To enter pairing mode, either press the small reset button (often using a pin) or remove and reinsert the battery. Once detected, rename it (e.g., “Hallway Motion”) and assign it to a room.
Mount the sensor in a high-traffic area—above a doorway, down a hallway, or near your desk. It works best when motion crosses its field of view at an angle, rather than head-on. Once installed, wave your hand in front of the sensor and check that it changes from “Clear” to “Detected” in Home Assistant.
Then, build your first motion automation:
- Go to Settings > Automations > + Add Automation
- Trigger: Motion Sensor detects motion
- Condition: Only after sunset (Sun condition)
- Action: Turn on a light (like your RGB bulb) or smart plug
Now create a second automation to turn the light off after inactivity:
- Trigger: Motion Sensor changes to “Clear”
- Action: Wait 2 minutes → Then turn off the light
This setup enables your lights to turn on when you walk into a room and off when you leave—no switches needed.
Creative Bonus Challenge:
Create a glowing motion path using two smart bulbs. When motion is detected:
- Instantly turn on Bulb 1 (e.g., soft white)
- Wait 2 seconds
- Then turn on Bulb 2 with a different color (e.g., blue or red)
- Add an automation to fade them out after a few minutes of no motion
By the end of this lesson, you’ll know how to:
- Pair and mount your Zigbee motion sensor
- Detect movement and track it in Home Assistant
- Automate your devices based on motion and time
- Build visually dynamic effects triggered by movement
In the next lesson, you’ll listen in on your environment with the temperature and humidity sensor and control devices like a fan based on the weather inside your home.