Update powerwall.sh

This commit is contained in:
2023-08-16 17:56:37 -05:00
parent cbcad42cdc
commit 4cfd640320

View File

@@ -191,14 +191,20 @@ CHECKTEMP_SERVICE(){
temp_h=''
elif [ "${PW_SENSOR_TYPE[${SENSORa}]}" == "esxi" ]; then
temp_c=$(echo ${SENSOR} | cut -d'p' -f2 | awk '/ / {print $2}' | sed -e 's/C//g'); temp_c=${temp_c/ /}
temp_warn=$(echo ${SENSOR} | cut -d'p' -f2 | awk '/ / {print $7}' | sed -e 's/C//g'); temp_warn=${temp_warn/ /}
temp_crit=$(echo ${SENSOR} | cut -d'p' -f2 | awk '/ / {print $4}' | sed -e 's/C//g'); temp_crit=${temp_crit/ /}
temp_crit_sys=$(echo ${SENSOR} | cut -d'p' -f2 | awk '/ / {print $4}' | sed -e 's/C//g'); temp_crit_sys=${temp_crit_sys/ /}
temp_c=$(echo ${SENSOR} | cut -d'p' -f2 | awk '/ / {print $2}' | sed -e 's/C//g'); temp_c=${temp_c/ /}
temp_warn=$(echo ${SENSOR} | cut -d'p' -f2 | awk '/ / {print $7}' | sed -e 's/C//g'); #temp_warn=${temp_warn/ /}
temp_crit=$(echo ${SENSOR} | cut -d'p' -f2 | awk '/ / {print $4}' | sed -e 's/C//g'); #temp_crit=${temp_crit/ /}
temp_crit_sys=$(echo ${SENSOR} | cut -d'p' -f2 | awk '/ / {print $4}' | sed -e 's/C//g'); #temp_crit_sys=${temp_crit_sys/ /}
temp_warn=`echo $(bc <<< "scale=2; (${temp_warn/ /}*1.8+32)/1") | awk '{print int($1+0.5)}'`
temp_crit=`echo $(bc <<< "scale=2; (${temp_crit/ /}*1.8+32)/1") | awk '{print int($1+0.5)}'`
temp_crit_sys=`echo $(bc <<< "scale=2; (${temp_crit_sys/ /}*1.8+32)/1") | awk '{print int($1+0.5)}'`
temp_h=''
vSENSOR=$(echo ${SENSOR} | cut -d'T' -f1 | xargs)
SENSOR="${SENSORa}-${vSENSOR// /_}"
echo "HERE: ${SENSOR} - ${temp_c} - ${temp_warn} - ${temp_crit}"
echo "HERE: ${SENSOR} - ${temp_c} - ${temp_warn} - ${temp_crit} - ${temp_crit_sys}"
fi