diff --git a/scripts/dhcp2presency.sh b/scripts/dhcp2presency.sh index 04c6fe3..ad6f262 100755 --- a/scripts/dhcp2presency.sh +++ b/scripts/dhcp2presency.sh @@ -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 diff --git a/scripts/peoplecounter-realtime.sh b/scripts/peoplecounter-realtime.sh index cc80e4a..6ebb1f6 100755 --- a/scripts/peoplecounter-realtime.sh +++ b/scripts/peoplecounter-realtime.sh @@ -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 diff --git a/scripts/upd_status.sh.d/peoplecountercheck b/scripts/upd_status.sh.d/peoplecountercheck index d5525e8..50f9e05 100755 --- a/scripts/upd_status.sh.d/peoplecountercheck +++ b/scripts/upd_status.sh.d/peoplecountercheck @@ -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.