diff --git a/powerwall.sh b/powerwall.sh index 34b82b5c..077954f5 100755 --- a/powerwall.sh +++ b/powerwall.sh @@ -125,7 +125,6 @@ CHECKTEMPSENSOR(){ if [ "${PW_SENSOR_TYPE[${1}]}" == "mqtt" ]; then mqtt_message=`${mqtt_conn} -t tele/${1}/SENSOR -C 1` echo ${mqtt_message} | cut -d':' -f 6 | cut -d',' -f 1 | read temp_c - [ "${1}" == "ServerRoomTH" ] && temp_c=`echo "scale=1; ${temp_c}-4" | bc` elif [ "${PW_SENSOR_TYPE[${1}]}" == "system" ]; then temp_c=$(vcgencmd measure_temp) @@ -152,6 +151,7 @@ CHECKTEMPSENSOR(){ if [ "${temp_c}" != "null" ] && [ "${temp_c}" != "" ]; then [ "${PW_SENSOR_TYPE[${1}]}" == "cpu" ] && temp_f=$(echo "scale=2; $temp_c/1" | bc -l) || temp_f=$(bc <<< "scale=1; ${temp_c}*1.8+32") + [ "${1}" == "ServerRoomTH" ] && temp_f=`echo "scale=1; ${temp_f}-4" | bc` # echo "HERE: '${temp_c}' -> '${temp_f}'" # echo -en "" c=0; spct=''; spc1=`expr 6 - ${#temp_f}`; until [ ${c} = ${spc1} ]; do spct="${spct} "; c=`expr ${c} + 1`; done @@ -324,7 +324,9 @@ CHECKTEMP_SERVICE(){ rm -f ${PW_TMPFOLDER}/${SENSOR}-error.reading fi + [ "${PW_SENSOR_TYPE[${SENSOR}]}" == "cpu" ] && temp_f=$(echo "scale=2; $temp_c/1" | bc -l) || temp_f=$(echo "scale=2; ${temp_c}*1.8 + 32" | bc) + [ "${SENSOR}" == "ServerRoomTH" ] && temp_f=`echo "scale=2; ${temp_f}-4" | bc` echo "HERE: ${SENSOR} - ${temp_f} - ${temp_warn} - ${temp_crit} - ${temp_crit_sys}" if [ "${PW_SENSOR_TYPE[${SENSORa}]}" != "esxi" ]; then