Track how many people are present in a room using a laser sensor barrier attached to a Raspberry Pi counting people entering and leaving the room
curl -i -XPOST "http://presencepi:8086/query?db=presence" -H 'Authorization: Token user:passwd' --data-urlencode "q=SELECT "Presence" FROM "People" WHERE "MotionSensor" = 'Eingang' GROUP BY * ORDER BY DESC LIMIT 1"
curl -i -XPOST "http://presencepi:8086/write?db=presence" -H 'Authorization: Token user:passwd' --data-binary 'People,MotionSensor=Eingang Presence=$(CURRENT_PEOPLE_IN_ROOM + 1)i,Cumulative=1i,Control=1i'
curl -i -XPOST "http://presencepi:8086/write?db=presence" -H 'Authorization: Token user:passwd' --data-binary 'People,MotionSensor=Eingang Presence=$(CURRENT_PEOPLE_IN_ROOM - 1)i,Control=-1i'
curl -i -XPOST "http://presencepi:8086/write?db=presence" -H 'Authorization: Token user:passwd' --data-binary 'People,MotionSensor=Eingang Presence=0i,Control=0i'
- Raspberry Pi 3b
- Photoresistor GL5516 on light sensor module LM393
- Laserdiode module 15 * 6 mm, 5 V
- some case