Presence detection via motion sensors

A well-functioning presence detection is essential for a smarthome. This is the first way to implement a series of very interesting functions. The following solution uses a combination of motion sensors and contact sensors on the doors.


In my solution, I distinguish between 3 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.

Whether it is dark outside can be detected very simple by using the in openHAB integrated Astro Binding.

In addition to the three states, there are “Recommendation” states. These are:

Depending on whether one is present or not, the shutter are automatically controlled, the outdoor lighting is active and presence simulation is started.

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.


All used openHAB rules are part of my deployment project and can be tried or downloaded there. Alternatively, the openHAB rules can also be obtained directly from my Github Repository.

You like this page?
You can support me by visiting my advertising partners. Just click on the banner below.