I’m thinking about the best way to switch lights on and off in the bathroom. Switching off after X minutes of no motion means there will often be cases of lights going off when someone is sitting on the toilet or showering (unless adding another motion sensor for the shower).
My idea is to switch on whenever motion is detected, but then also have a door sensor to aid in switching lights off. That is, something like this:
- Switch on when motion is detected OR when door is opened if lights are off.
- Switch off after 1 minute of no motion, unless motion detected after door is closed (that is, someone entering the bathroom, rather than just closing from outside).
- If motion detected after door is closed, leave lights on until door opens again. I.e. switch lights off X seconds after door is opened again, UNLESS new motion is detected before that time period (such as if someone is opening an unlocked door, then lights should not be switched off, to let someone play with it, like children who are not locking the door).
I will most likely use SharpTools as a dashboard. But if I create riles there they will run in the cloud. Is the above possible using local automations? WebCoRE is also run in the cloud? Or does someone have better ideas for when to switch lights off?
I also realize that if motion is detected BEFORE the door is closed, the sensor may not detect motion again until after the sensor reset period (by default 60 seconds for the Aqara Motion Sensor, I think). Then the above scenario would not work…
To turn lights on and off with movement, what works best for me is to do 2 automations.
If movement detected, then turn on the light
if no movement detected (or no movement for x time), then turn off light
This way you don’t stay in the dark or turn on as soon as you move a little
Yeah, but you can be in the toilet for more than X minutes without the sensor detecting motion. That’s why I thought a combination with a door sensor would be better for presence detection. I guess I could just set the no motion time to 5 minuets and if someone stays longer without motion they will just have to wave.
Exactly what I do…
Motion sensor is placed on bathroom ceiling to include shower area, toilet sometimes turns off early but never the bathroom. Using single smart lighting rule rather than 2 automations and coupled with illuminance sensor but the end result is the same
you need a presence sensor , there are several ultrasound sensors available.
But now I have an issue with washing machine, when it washes, the sensor sees the motion and keeps lights on
I think these automations could be greatly simplified, and will work more reliably, if you increase this time to something like 10-15 minutes. I usually use 15 minutes of no-motion, from a single or multiple motion sensors, for all of my occupancy automations. This allows some buffer for sitting still for a bit, ducking around a blind corner, etc.
The shorter feedback time creates illusion that home is smart and understands your intentions.
15 min delay ruins the magic.