Update powerwall.sh

This commit is contained in:
2023-12-11 17:44:32 -06:00
parent 20e555eede
commit 1e32f9633b

View File

@@ -318,14 +318,13 @@ CHECKTEMP_SERVICE(){
if (( $(bc <<< "${temp_f} < ${temp_warn}") )); then
echo 2
if (( $(bc <<< "${last_temp[${SENSOR}]} > 1") )); then
echo 3
SENDNOTICE "${SENSOR} BACK TO NORMAL" "NORMAL TEMP: ${temp_f}${GAUGESH}
Previous Temp: ${last_temp[${SENSOR}]}${GAUGESH}"
echo -e "($(date +'%Y-%m-%d %H:%M:%S')) - ${temp_f}${GAUGESH} - Back to NORMAL ${GAUGE} - Previous ${GAUGE}: ${last_temp[${SENSOR}]}${GAUGESH}" >> ${logtemp}
echo -e "($(date +'%Y-%m-%d %H:%M:%S')) - ${temp_f}${GAUGESH} - ${SENSOR} - Back to NORMAL ${GAUGE}" >> ${PW_LOGFILE}
# [ "$(compgen -G "${PW_TMPFOLDER}/power.*.off")" != "" ] && rm -f ${PW_TMPFOLDER}/power.*.off
elif (( $(bc <<< "${temp_diff} = 0") )); then
elif (( $(bc <<< "${last_temp[${SENSOR}]} = 0") )); then
echo 4
# SENDNOTICE "${SENSOR} TEMP NORMAL" "Service Startup
# NORMAL TEMP: ${temp_f}${GAUGESH}"
@@ -334,11 +333,9 @@ Previous Temp: ${last_temp[${SENSOR}]}${GAUGESH}"
# [ "$(compgen -G "${PW_TMPFOLDER}/power.*.off")" != "" ] && rm -f ${PW_TMPFOLDER}/power.*.off
elif [ "${relog}" == "1" ]; then
echo 5
echo "($(date +'%Y-%m-%d %H:%M:%S')) - ${temp_f}${GAUGESH} - Normal ${GAUGE}" >> ${logtemp}
fi
echo 6
rm -f ${PW_TMPFOLDER}/temp.*
rm -f ${PW_TMPFOLDER}/power.${SENSORa}.off
last_temp[${SENSOR}]=1