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.