Passage Sensor to Count People in a Room

I have a room with a single point of entry and would like to keep track of how many people are inside it. It seems straightforward to have some kind of passage sensor in the doorway that can detect motion and direction.

I’ve seen some DIY solutions but can only find one commercial product that seems compatible:

https://www.homematic-ip.com/en/products/detail/homematic-ip-passage-sensor-with-direction-recognition.html

Does anyone have experience with it? It seems risky to buy a Homematic gateway and this expensive sensor without knowing how well it works. Are there any alternatives?

Another idea I have is to use the Raspberry PI camera module, Appdaemon and OpenCV to detect motion and direction. Has anyone done anything similar?

2 motion sensors should do it.
order in which they get activated will give you the direction, then you can count up or down

A “Simpler” answer may be a pair of DIY “trip wires”?

Laser pointer each side of the door way (chest height), pointed to a ESP8266 with a light sensor set up with an automation in HA:

  • If sensor inside room goes dark, then sensor outside the room goes dark, decrease counter by 1.
  • If sensor outside room goes dark, then sensor inside the room goes dark, increase counter by 1.
  • I imagine you would also want a cooldown on the sensor though in case you walk through swinging your arms or something.

It’s something I’ve thought of for turning on lights etc without relying on motion (“If Livingroom occupancy >0 then light.livingroom=on”). Also you get the bonus of having a cool visible laser trip wire to tie into the alarm system. If you used a cheap laser pointer (button cell) it may even work powered from the ESP.

The wife wasn’t up for turning our house into a scene from mission impossible though… :frowning:

I thought about that as well. However, in my experience with my Hue motion sensor, there is a cool down of around 10 seconds until “no motion” is detected. This would confuse the system if multiple people enter or leave at the same time, which happens quite often.

ok, replace PIR with 2 lasers?
check this out

Thanks for the suggestion. As cool as it sounds, I think hooking up the pi camera module is as far as I’m willing to go in terms of hardware DIY. Your solution is a bit above my level :slight_smile:

I only thought of that as my wife has an aversion to cameras in the house unless we are out (so using one for occupancy would be counter intuitive :slight_smile:

Post up if you get it working because using it for the front door would be a good idea for me.

I actually don’t like the idea of a camera in the house either, but for this application I imagine one could just severely limit the view of the camera. I’ll let you know if I try it out.

Hi everyone,
there is something i found online

Arduino function visitor couter video

Do you think is possible to do something similar with an esp32 esphome and home assistant?

Thank you!

Marco

Heh, that’s pretty neat.

Just use the VL53L1X sensor and this project for ESPhome

1 Like

I tried with roode but I have real difficulties in the setup and the parameters.
Do you have suggestions on distances?
Thanks

Unfortunately, I haven’t used the sensor for a long time and maybe something has changed.
I use LD2410B presence sensors

I see almost everybody switched to radar sensors in order to have presence detection.

My only concern is to have a radar emitting microwaves h24 in my bedroom, I would love to limit the emitting devices in my house, that’s why I want to have the vl53l1x or other new laser sensors…

If I take all the radiation of mobile networks, wifi and others, I think that this is really negligible.

finaly i manage to have a people counter that works!

with a VL53L1x and an esp8266