From 3c1b3ff112251de114297f535dc8a924d6b6c93d Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Wed, 10 Apr 2024 20:06:43 -0500 Subject: [PATCH] Update temp.inc.sh --- inc/temp.inc.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/inc/temp.inc.sh b/inc/temp.inc.sh index 25686542..8b3b7c44 100644 --- a/inc/temp.inc.sh +++ b/inc/temp.inc.sh @@ -981,7 +981,7 @@ Previous Temp: ${last_temp}${GAUGESH}" if [ ! -f ${PW_TMPFOLDER}/${SENSOR}-error.reading ]; then touch ${PW_TMPFOLDER}/${SENSOR}-error.reading - elif [ $(expr `date +%s` - $(stat -c %Y ${PW_TMPFOLDER}/${SENSOR}-error.reading)) -ge 60 ]; then + elif [ ! -f ${PW_TMPFOLDER}/${SENSOR}.disable ] && [ $(expr `date +%s` - $(stat -c %Y ${PW_TMPFOLDER}/${SENSOR}-error.reading)) -ge 60 ]; then if [ "${SENSOR}" == "ServerRoomTemp" ] && ([ ! -f ${PW_TMPFOLDER}/${SENSOR}.restart ] || ([ -f ${PW_TMPFOLDER}/${SENSOR}.restart ] && [ $(expr `date +%s` - $(stat -c %Y ${PW_TMPFOLDER}/${SENSOR}.restart)) -ge 900 ])); then touch ${PW_TMPFOLDER}/${SENSOR}.restart SENDNOTICE "Restarting TG-Outlet-2 to restart ServerRoomTemp" "ERROR reading ServerRoomTemp" @@ -989,10 +989,11 @@ Previous Temp: ${last_temp}${GAUGESH}" sleep 2s RUN=$(curl -m 8 -s -H "Authorization: Bearer ${PW_ESPHOME_API}" -H "Content-Type: application/json" -d '{"entity_id": "switch.smart_15em_plug_in_2_socket"}' http://10.10.1.180:8123/api/services/switch/turn_on) - elif [ ! -f ${PW_TMPFOLDER}/${SENSOR}.disable ] && ([ ! -f ${PW_TMPFOLDER}/${SENSOR}-error.sent ] || ([ -f ${PW_TMPFOLDER}/${SENSOR}-error.sent ] && [ $(expr `date +%s` - $(stat -c %Y ${PW_TMPFOLDER}/${SENSOR}-error.sent)) -ge $(echo "scale=0; ${PW_RENOTIFY_TIMEOUT}*60" | bc) ])); then + elif [ ! -f ${PW_TMPFOLDER}/${SENSOR}-error.sent ] || ([ -f ${PW_TMPFOLDER}/${SENSOR}-error.sent ] && [ $(expr `date +%s` - $(stat -c %Y ${PW_TMPFOLDER}/${SENSOR}-error.sent)) -ge $(echo "scale=0; ${PW_RENOTIFY_TIMEOUT}*60" | bc) ]); then touch ${PW_TMPFOLDER}/${SENSOR}-error.sent SENDNOTICE "${SENSOR} Sensor ERROR" "ERROR reading sensor data" 1 echo "($(date +'%Y-%m-%d %H:%M:%S')) - ${SENSOR} Sensor - ERROR reading sensor data" >> ${logtemp} + fi fi