Room occupancy detection


I have been searching for solution for 2 days and still can’t find any that suits my needs.

I have set up multiple PIR sensors that publishes on seperate MQTT topics every time when motion has been detected. I would like to create entity that would inform about room occupancy. Set to true if motion detected within 5 minutes from any of 3 different PIR sensors inside single room else set to false.

Any idea how to achieve that without interfering with PIR duration time?

I suggest setup the following:

  1. input_boolean for room occupancy
  2. automation(s) to set the input_boolean to on if motion detected
  3. automation(s) to turn off the input_boolean to off if no motion for 5 minutes

Depending on how your PIR sensors publish, you may require another rule to set the trigger of the PIR sensor to off also (I have RF sensors that only ever tell me they are on, I need to set them to off by a rule)

1 Like

I had the same problem and i’ve been archive the target with bianry sensor.

  - platform: template
        device_class: motion
        friendly_name: "Sensore Bagno"
        value_template: "{{is_state ('binary_sensor.motion_sensor_158d0001232507', 'on')               or is_state ('binary_sensor.motion_sensor_158d000132e942', 'on') or is_state ('binary_sensor.motion_sensor_158d00013f8c44', 'on')}}"

NIce one @andree .

It seems your motion detectors change to an off state on their own too.

If that is the case, you could also use a group to get the same outcome. If any of the detectors in the group is on, the status of the group is on. If all off, the status of the group is off.