Update powerwall.sh

This commit is contained in:
2023-08-14 19:37:39 -05:00
parent 7db18a435a
commit 1996a6a9a3

View File

@@ -76,7 +76,7 @@ CHECKTEMP(){
CHECKTEMPSENSOR(){
echo ${PW_TEMP_THRESHOLDS[${1}]} | cut -d',' -f 1 | read temp_warn
echo ${PW_TEMP_THRESHOLDS[${1}]} | cut -d',' -f 2 | read temp_crit
[ "${PW_SENSOR_TYPE[${1}]}" != "esxi" ] && average=$(AVERAGETEMP ${PW_SENSOR_ID[${1}]} 3) || average=0
[ "${PW_SENSOR_TYPE[${1}]}" != "esxi" ] && average=$(AVERAGETEMP ${PW_SENSOR_ID[${1}]} 3) || average=''
if [ "${PW_SENSOR_TYPE[${1}]}" == "mqtt" ]; then
mqtt_message=`${mqtt_conn} -t tele/${1}/SENSOR -C 1`
@@ -106,8 +106,8 @@ CHECKTEMPSENSOR(){
c=0; spct=''; spc1=`expr 6 - ${#temp_f}`; until [ $c = ${spc1} ]; do spct="${spct} "; c=`expr ${c} + 1`; done
c=0; spca=''; spc1=`expr 6 - ${#average}`; until [ $c = ${spc1} ]; do spca="${spca} "; c=`expr ${c} + 1`; done
if [ ${average} -eq 0 ]; then
averagedisp=' '
if [ "${average}" == "" ]; then
averagedisp=''
elif [ $(bc -l <<< "${average} >= ${temp_warn}") -eq 1 ] && [ $(bc -l <<< "${average} < ${temp_crit}") -eq 1 ]; then
averagedisp="${idsCL[Yellow]}${average}'F"
elif [ $(bc -l <<< "${average} >= ${temp_crit}") -eq 1 ]; then