In the presence detection and the detection of the current situation of the residents, I distinguish between three possible states.
Whether someone is present I make depending on the frontdoor. When it was opened / closed and there is no motion in the hallway, the system knows that you are away. Otherwise one is present.
The sleep state can be determined in the following manner. If you are present, it is dark outside and you have turned off the last light, the system knows that you are sleeping now. That you waked up is detected as soon as one of the motion sensor is active.
In addition to the three states, there are "Recommendation" states. These are:
In addition, after the system has detected that one has stood up, some lights are turned on automatically on the way to the living room.