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