diff --git a/defaults.inc b/defaults.inc index a0278ec0..21174127 100755 --- a/defaults.inc +++ b/defaults.inc @@ -1,5 +1,5 @@ -VERS='2.3.346-12042023' +VERS='2.3.347-12042023' noheader=' update service dailytemp ' @@ -41,6 +41,8 @@ PW_TEMP_THRESHOLDS['Powerwall-CPU-Usage']="40,80,90" PW_TEMP_THRESHOLDS['OctoPi-CPU']="122,131,176" PW_TEMP_THRESHOLDS['OctoPi-CPU-Usage']="40,80,90" +PW_ServerRoomTH_Dev='-1' + declare -A PW_SENSOR_TYPE PW_SENSOR_TYPE['ServerRoomTH']='mqtt' PW_SENSOR_TYPE['Powerwall-CPU']='system' diff --git a/powerwall.sh b/powerwall.sh index a0b66e07..d71a4b4a 100755 --- a/powerwall.sh +++ b/powerwall.sh @@ -146,7 +146,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") (( $(bc <<<"${temp_f} < 1") )) && [[ "${temp_f}" = *"."* ]] && temp_f="0${temp_f}" - [ "${1}" == "ServerRoomTH" ] && temp_f=`echo "scale=1; ${temp_f}-4" | bc` + [ "${1}" == "ServerRoomTH" ] && temp_f=`echo "scale=1; ${temp_f}+${PW_ServerRoomTH_Dev}" | 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 @@ -317,7 +317,7 @@ CHECKTEMP_SERVICE(){ 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` + [ "${SENSOR}" == "ServerRoomTH" ] && temp_f=`echo "scale=2; ${temp_f}+${PW_ServerRoomTH_Dev" | bc` # echo "HERE: ${SENSOR} - ${temp_f} - ${temp_warn} - ${temp_crit} - ${temp_crit_sys}" if [ "${PW_SENSOR_TYPE[${SENSORa}]}" != "esxi" ]; then