This commit is contained in:
2023-12-22 19:40:05 -06:00
parent 64548c82ee
commit 4499d0bcf2
2 changed files with 11 additions and 9 deletions

View File

@@ -1,5 +1,5 @@
VERS='2.5.50-12222023'
VERS='2.5.51-12222023'
noheader=' update service dailytemp confsync '

View File

@@ -526,14 +526,16 @@ Previous Temp: ${last_temp[${SENSOR//-/}]}${GAUGESH}"
fi
elif [ "${PW_HOST_ADDRESSES[${SENSORa}]}" == "" ]; then #sensor down
if [ ! -f ${PW_TMPFOLDER}/${SENSORa}.down ] || [ $(expr `date +%s` - $(stat -c %Y ${PW_TMPFOLDER}/${SENSORa}.down)) -ge 1800 ]; then
SENDNOTICE "${SENSORa} ERROR" "${SENSORa} Sensor is down" 1
echo "($(date +'%Y-%m-%d %H:%M:%S')) - ${SENSORa} - ${SENSORa} Sensor is down" >> ${logtemp}
touch ${PW_TMPFOLDER}/${SENSORa}.down
fi
# elif [ "${PW_HOST_ADDRESSES[${SENSORa}]}" == "" ]; then #sensor down
else
[ ! -f ${PW_TMPFOLDER}/${SENSORa}.down ] && touch ${PW_TMPFOLDER}/${SENSORa}.down
if [ ! -f ${PW_TMPFOLDER}/${SENSORa}-error.reading ]; then
touch ${PW_TMPFOLDER}/${SENSORa}-error.reading
elif ([ ! -f ${PW_TMPFOLDER}/${SENSORa}-error.sent ] && [ $(expr `date +%s` - $(stat -c %Y ${PW_TMPFOLDER}/${SENSORa}-error.reading)) -ge 60 ]) || ([ -f ${PW_TMPFOLDER}/${SENSORa}-error.sent ] && [ $(expr `date +%s` - $(stat -c %Y ${PW_TMPFOLDER}/${SENSORa}-error.sent)) -ge $(echo "scale=0; ${PW_RENOTIFY_TIMEOUT}*60" | bc) ]); then
SENDNOTICE "${SENSORa} Sensor ERROR" "ERROR reading sensor data" 1
echo "($(date +'%Y-%m-%d %H:%M:%S')) - ${SENSORa} Sensor - ERROR reading sensor data" >> ${logtemp}
touch ${PW_TMPFOLDER}/${SENSORa}-error.reading
fi
fi
done