If you love tinkering, ESPHome is a fantastic way to build custom smart home devices. This open-source firmware framework gives you local control over smart home devices that support open standards.
For smart home deployments, there are a lot of ways to track the presence of individuals in a room. There are motion detection sensors that use mmWave and PIR, and you can also use simple detection ...