I’ve been experimenting with building a more natural night routine using Aqara sensors with Apple HomeKit, instead of relying on fixed schedules or manually triggering scenes.
The idea is to make the home gradually shift into “night mode” based on actual behavior rather than time alone.
Setup idea:
Using Aqara motion sensors, door/window sensors, and light sensors with HomeKit automations, the flow would work like this:
If no motion is detected in the living room and kitchen for 20–30 minutes:
- Turn off main lights gradually
- Dim hallway lights to a low level
When bedroom motion is detected after around 10:30 PM:
- Turn on soft warm lighting at low brightness
- Activate a “Good Night” scene
When the bedroom door closes:
- Wait 5–10 minutes
- Then turn off remaining lights
- Activate sleep mode (and lock doors if supported)
Optional improvement:
If motion is detected in the hallway during the night, turn on a very dim night light automatically for safety.
The goal is to make the system feel adaptive rather than rigid. If I stay up late, it adjusts. If I go to bed early, it still works without needing manual control.
I feel like this makes the home feel more “aware” instead of just following schedules.
Has anyone built something similar with Aqara and HomeKit?
What sensors or conditions worked best for you?
Any issues with false triggers or delays?
Would you improve this logic or add anything else?
Would be great to hear how others are setting up their automations.
4 Likes
@sina_ahmadi_asa This is a fantastic approach to smart home automation!
I love how you’re focusing on behavior-based triggers rather than rigid schedules—that’s exactly what makes a smart home feel truly “intelligent” rather than just automated.
Your night routine logic is well thought out. A few observations that might complement your setup:
Night Mode Considerations:
The Aqara Alert System actually has built-in “Home,” “Away,” and “Night” modes that are mutually exclusive, where Night Mode is specifically designed for nighttime scenarios with recommended settings to turn off triggering conditions for devices in rest areas like bedrooms. This could integrate nicely with your sleep mode activation.
Motion & Light Sensor P2 + HomeKit:
For your bedroom motion detection after 10:30 PM, the Motion and Light Sensor P2 works with Apple Home, though advanced settings require connection to the Aqara Home app with a Matter Controller (M3, M100, G5 Pro, or G410). This gives you more granular control over brightness-based automations.
Similar Automation Patterns:
There’s actually a similar nighttime convenience automation where motion detection after 10 PM triggers soft lighting for elderly care, which aligns perfectly with your hallway night light idea.
Questions for the Community:
- Have you experienced any false triggers with motion sensors during night mode?
- Are you using the Aqara Hub M3 for Matter support with HomeKit?
- Have you considered adding brightness conditions to prevent lights from turning on if ambient light is already sufficient?
This information comes from community discussions and user experience summaries and may vary by environment. Please verify carefully.
Thanks for sharing such a thoughtful automation setup! Would love to hear how it evolves and if you discover any edge cases during testing. 

1 Like