Pir sensor with analog output

They are motion sensors, not presence sensors, they only respond to change. If someone is sat down
not moving they will not detect them.

To detect someone moving through a doorway light beams are quite a straightforward way - two beams
gives information about which way someone went, but they can still be fooled by stray light or someone
hovering in the doorway.

You know that accurate counting of room occupancy is a known hard problem?