Update powerwall.sh

This commit is contained in:
2023-05-15 17:17:50 -05:00
parent 68d9f9859d
commit f1bc261b9c

View File

@@ -150,16 +150,16 @@ Shutting down system servers!!" 1
Previous Temp: ${last_temp[${SENSOR}]}'F"
echo -e "($datetime) - ${SENSOR} - ${temp_f}'F - Back to NORMAL TEMP - Previous Temp: ${last_temp[${SENSOR}]}'F" >> ${logtemp}
echo "($datetime) - ${SENSOR} - ${temp_f}F - alert sent" >> ${logtemp}
[[ -f $FOLDER/shutdown.* ]] && rm -f ${FOLDER}/shutdown.*
[ "$(compgen -G "${FOLDER}/shutdown.*")" != "" ] && rm -f ${FOLDER}/shutdown.*
elif [ ${last_temp[${SENSOR}]} -eq 0 ]; then
SENDNOTICE "${SENSOR} TEMP NORMAL" "($datetime) Service Startup
NORMAL TEMP: ${temp_f}'F"
echo -e "($datetime) - ${SENSOR} - ${temp_f}'F - Service Startup - NORMAL TEMP" >> ${logtemp}
[[ -f $FOLDER/shutdown.* ]] && rm -f ${FOLDER}/shutdown.*
[ "$(compgen -G "${FOLDER}/shutdown.*")" != "" ] && rm -f ${FOLDER}/shutdown.*
fi
last_temp[${SENSOR}]=1
[ $relog -eq 1 ] && echo "($datetime) - ${SENSOR} - ${temp_f}F - Normal Temp" >> ${logtemp}
[[ -f $FOLDER/shutdown.* ]] && rm -f ${FOLDER}/shutdown.*
[ "$(compgen -G "${FOLDER}/shutdown.*")" != "" ] && rm -f ${FOLDER}/shutdown.*
fi
if [ "${temp_h}" != "" ]; then
QRY="USE servermonitor; INSERT INTO sensor_data (\`sensorid\`, \`date\`, \`temp\`, \`hum\`) VALUES ('${SENSOR_ID[${SENSOR}]}','${datetime}','${temp_f}','${temp_h}')"