Just replying about Occupancy Sensor. We are required to install an occupancy sensor switch for bathroom lights. It turns on if someone walks in and turns off automatically if it detects no movement in bathroom. But, they are hilarious. They default to about 30 seconds of no movements. If on toilet or in a bathtub the lights turn off. You have to wildly wave your arms around to get the lights back on. I also discovered if your switch location is near the door in a certain direction, it turns lights on every time someone walks down the hallway.
We also have to install humidity sensor switches for bath fans. it turns the fan on if humidity detected (not relying on humans to remember to turn it on). But they are very fickle and they just randomly start turning bathroom fans on in the middle of the night or something. Very annoying.