diff --git a/defaults.inc b/defaults.inc index 55b07d47..02040706 100755 --- a/defaults.inc +++ b/defaults.inc @@ -1,5 +1,5 @@ -VERS='2.5.50-12222023' +VERS='2.5.51-12222023' noheader=' update service dailytemp confsync ' diff --git a/inc/temp.inc.sh b/inc/temp.inc.sh index be132302..9430ee12 100644 --- a/inc/temp.inc.sh +++ b/inc/temp.inc.sh @@ -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