This commit is contained in:
2023-12-04 09:38:43 -06:00
parent 1490c4bf8b
commit 54a88b07dd
2 changed files with 5 additions and 3 deletions

View File

@@ -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'

View File

@@ -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