Update powerwall.sh

This commit is contained in:
2023-10-28 15:27:58 -05:00
parent db64c55a0a
commit 2b8091e9ad

View File

@@ -179,8 +179,7 @@ CHECKTEMP_SERVICE(){
cw=20 cw=20
declare -A last_temp declare -A last_temp
while true; do while true; do
start=`date +%s` # start=`date +%s`
echo go
if [ ! -f ${PW_TMPFOLDER}/temp.* ] && [ $(date +%H)$(date +%M) -ge 0700 ] && [ $(date +%H)$(date +%M) -lt 0705 ]; then if [ ! -f ${PW_TMPFOLDER}/temp.* ] && [ $(date +%H)$(date +%M) -ge 0700 ] && [ $(date +%H)$(date +%M) -lt 0705 ]; then
if [ ! -f ${PW_TMPFOLDER}/.sentdaily ] || [ $(expr `date +%s` - $(stat -c %Y ${PW_TMPFOLDER}/.sentdaily)) -gt 600 ]; then if [ ! -f ${PW_TMPFOLDER}/.sentdaily ] || [ $(expr `date +%s` - $(stat -c %Y ${PW_TMPFOLDER}/.sentdaily)) -gt 600 ]; then
touch ${PW_TMPFOLDER}/.sentdaily touch ${PW_TMPFOLDER}/.sentdaily
@@ -425,8 +424,8 @@ Previous Temp: ${last_temp[${SENSOR}]}'F"
done done
end=`date +%s`; runtime=$((end-start)); echo "runtime: ${runtime}, pausing for 60secs..." # end=`date +%s`; runtime=$((end-start)); echo "runtime: ${runtime}, pausing for 60secs..."
sleep 60 sleep 60
done # & done # &
} }
@@ -1159,11 +1158,11 @@ fi
if [ "${3}" = "start" ] || [ "${3}" = "" ]; then if [ "${3}" = "start" ] || [ "${3}" = "" ]; then
if [ "${2}" = "temp" ]; then if [ "${2}" = "temp" ]; then
SENDNOTICE "Temp Monitor Startup" "$(DAILYTEMP)" & SENDNOTICE "Temp Monitor Startup" "$(DAILYTEMP)" &
CHECKTEMP_SERVICE & CHECKTEMP_SERVICE
elif [ "${2}" = "power" ]; then elif [ "${2}" = "power" ]; then
CHECKPOWER_SERVICE & CHECKPOWER_SERVICE
elif [ "${2}" = "powerlogger" ]; then elif [ "${2}" = "powerlogger" ]; then
POWERLOGGER_SERVICE & POWERLOGGER_SERVICE
fi fi
elif [ "${3}" = "stop" ]; then elif [ "${3}" = "stop" ]; then