adapted other scripts to new averageing method
parent
4f6ee9d2e2
commit
62f3acb635
|
@ -7,7 +7,8 @@ p="$(
|
|||
awk '{print $2}')"
|
||||
if [ "$p" != "" ]
|
||||
then
|
||||
echo "$p" > /run/presency
|
||||
:
|
||||
# echo "$p" > /run/presency # handled now in realtime code
|
||||
else
|
||||
logger $0 cannot access people counter. fallback to dhcp value guessing
|
||||
fi
|
||||
|
|
|
@ -9,7 +9,7 @@ else
|
|||
DEV=""
|
||||
fi
|
||||
STATSFILE="/run/peoplecounter$DEV"
|
||||
SAMPLES=12 # how many records to keep in file
|
||||
SAMPLES=20 # how many records to keep in file
|
||||
INTERVAL=10 # how long to wait between polls
|
||||
MAXFILE="/run/peoplecountermax$DEV"
|
||||
PRESENCY="/run/presency$DEV" # value shown on website
|
||||
|
|
|
@ -2,12 +2,12 @@
|
|||
# this script only makes sense if there is a good people counter installed
|
||||
if [ "$1" = "closed" ] && [ "$2" = "open" ]
|
||||
then
|
||||
p="$(cat /run/presency)"
|
||||
p="$(tail -1 /run/peoplecounter)"
|
||||
if [ "$p" != "0" ]
|
||||
then
|
||||
logger $(basename $0) There are $p people, closed door from inside. Waiting 1 min.
|
||||
sleep 60
|
||||
p="$(cat /run/presency)"
|
||||
p="$(tail -1 /run/peoplecounter)"
|
||||
if [ "$p" = "0" ]
|
||||
then
|
||||
logger $(basename $0) There are $p people, after 1 min wait. All OK.
|
||||
|
|
Loading…
Reference in New Issue