Update powerwall.sh

This commit is contained in:
2023-08-14 22:48:38 -05:00
parent edd4f7be3d
commit 4dc6578bfb

View File

@@ -146,9 +146,10 @@ AVERAGETEMP(){
CHECKTEMP_SERVICE(){ CHECKTEMP_SERVICE(){
cw=20 cw=20
declare -A last_temp declare -A last_temp
while true; do # while true; do
for SENSOR in ${!PW_SENSOR_ID[@]}; do for SENSOR in ${!PW_SENSOR_ID[@]}; do
echo $SENSOR
logtemp=${PW_LOGFOLDER}/log-temp-${SENSOR} logtemp=${PW_LOGFOLDER}/log-temp-${SENSOR}
[ ! -f ${logtemp} ] && touch ${logtemp} [ ! -f ${logtemp} ] && touch ${logtemp}
logtime=$(expr `date +%s` - $(stat -c %Y ${logtemp})) logtime=$(expr `date +%s` - $(stat -c %Y ${logtemp}))
@@ -195,7 +196,7 @@ CHECKTEMP_SERVICE(){
echo ${PW_TEMP_THRESHOLDS[${SENSOR}]} | cut -d',' -f 2 | read temp_crit echo ${PW_TEMP_THRESHOLDS[${SENSOR}]} | cut -d',' -f 2 | read temp_crit
echo ${PW_TEMP_THRESHOLDS[${SENSOR}]} | cut -d',' -f 3 | read temp_crit_sys echo ${PW_TEMP_THRESHOLDS[${SENSOR}]} | cut -d',' -f 3 | read temp_crit_sys
echo "HERE: ${SENSOR} - ${temp_f} - ${temp_warn} - ${temnp_crit}" echo "HERE: ${SENSOR} - ${temp_f} - ${temp_warn} - ${temp_crit}"
if [ "${last_temp[${SENSOR}]}" != "" ]; then if [ "${last_temp[${SENSOR}]}" != "" ]; then
temp_diff=`expr ${last_temp[${SENSOR}]%.*} - ${temp_f%.*}` temp_diff=`expr ${last_temp[${SENSOR}]%.*} - ${temp_f%.*}`
@@ -309,7 +310,7 @@ CHECKTEMP_SERVICE(){
sleep 10 sleep 10
done # & # done # &
} }