From b33a2528747418e424c846bfe7247ebb84a236ee Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Sun, 10 Nov 2024 17:11:48 -0600 Subject: [PATCH] Update temp.inc.sh --- inc/temp.inc.sh | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/inc/temp.inc.sh b/inc/temp.inc.sh index 29606072..1fb37821 100644 --- a/inc/temp.inc.sh +++ b/inc/temp.inc.sh @@ -1379,15 +1379,7 @@ 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"}' ${PW_HOMEASSISTANT_URL}/api/services/switch/turn_on) # fi - - elif [ "${SENSOR}" == "AC" ] && ([ ! -f ${PW_TMPFOLDER}/${SENSOR}.restart ] || ([ -f ${PW_TMPFOLDER}/${SENSOR}.restart ] && [ $(expr `date +%s` - $(stat -c %Y ${PW_TMPFOLDER}/${SENSOR}.restart)) -ge 900 ])); then - # if [ "${PW_REMOTE_SENSORS[${SENSOR}]}" != "" ] && [ "$(CHECK_HOST ${PW_REMOTE_SENSORS[${SENSOR}]})" != "false" ]; then - touch ${PW_TMPFOLDER}/${SENSOR}.restart - SENDNOTICE "Restarting TG-Outlet-9 to restart AC Power Sensor" "ERROR reading AC Power Sensor" - RUN=$(curl -m 8 -s -H "Authorization: Bearer ${PW_ESPHOME_API}" -H "Content-Type: application/json" -d '{"entity_id": "switch.new_plugin_5_socket_1"}' ${PW_HOMEASSISTANT_URL}/api/services/switch/turn_off) - sleep 2s - RUN=$(curl -m 8 -s -H "Authorization: Bearer ${PW_ESPHOME_API}" -H "Content-Type: application/json" -d '{"entity_id": "switch.new_plugin_5_socket_1"}' ${PW_HOMEASSISTANT_URL}/api/services/switch/turn_on) - # fi + 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 echo "($(date +'%Y-%m-%d %H:%M:%S')) - ${SENSOR} Sensor - ERROR reading sensor data" >> ${logtemp} if [ ${PW_ENABLE_RENOTIFY} -eq 1 ] || [ ! -f ${PW_TMPFOLDER}/${SENSOR}-error.sent ]; then