This is how you automate your rooms
Switching lights on only when someone is in the room is a form of presence detection. You can even choose specific lighting scenarios depending on who is in the room. With room-assistant on some Raspberry Pi’s at home, you can have Home Assistant perform actions based on the rooms in which people are located.