I have a sensor in my bathroom that switches the light on when you enter and the extractor fan. Two issues I have found, 1) lights go on during the day (although there may be a setting I could change) 2) if the door gets left open (pesky kids) it tends to stay on.
No idea if this helps! [emoji3]