This commit is contained in:
2023-12-26 14:56:21 -06:00
parent 6a8399a9e5
commit eef503ba31
2 changed files with 30 additions and 8 deletions

View File

@@ -1,5 +1,5 @@
VERS='2.5.60-12262023'
VERS='2.5.61-12262023'
noheader=' update service dailytemp confsync '

View File

@@ -131,7 +131,6 @@ CHECKTEMPSENSOR(){
elif [[ "${1}" = *"FAN"* ]]; then
temp_c=$(cat /sys/class/hwmon/hwmon2/fan1_input)
fi
elif [ "${PW_SENSOR_TYPE[${1}]}" == "remotesystem" ]; then
temp_c=$(ssh -q -o ConnectTimeout=1 -o ConnectionAttempts=1 root@${PW_REMOTE_SENSORS[${1}]} vcgencmd measure_temp)
if [ "${temp_c}" != "" ]; then
@@ -327,9 +326,14 @@ CHECKTEMP_SERVICE(){
temp_h=$(echo ${INFO} | jq -r '.device0 .obs[].humidity')
elif [ "${PW_SENSOR_TYPE[${SENSORa}]}" == "system" ]; then
temp_c=$(vcgencmd measure_temp)
temp_c=${temp_c%\'*}; temp_c=${temp_c#*=}
temp_h=''
if [[ "${1}" = *"CPU"* ]]; then
temp_c=$(vcgencmd measure_temp)
temp_c=${temp_c%\'*}; temp_c=${temp_c#*=}
temp_h=''
elif [[ "${1}" = *"FAN"* ]]; then
temp_c=$(cat /sys/class/hwmon/hwmon2/fan1_input)
temp_h=''
fi
elif [ "${PW_SENSOR_TYPE[${SENSORa}]}" == "remotesystem" ]; then
temp_c=$(ssh root@${PW_REMOTE_SENSORS[${SENSOR}]} vcgencmd measure_temp)
@@ -364,8 +368,20 @@ CHECKTEMP_SERVICE(){
logtemp=${PW_LOGFOLDER}/log-temp-${SENSOR}
if [ "${temp_c}" != "null" ] && [ "${temp_c}" != "" ]; then
[ "${PW_SENSOR_TYPE[${SENSORa}]}" == "cpu" ] && GAUGE="CPU-USAGE" || GAUGE="TEMP"
[ "${PW_SENSOR_TYPE[${SENSORa}]}" == "cpu" ] && GAUGESH='%' || GAUGESH="'F"
if [ "${PW_SENSOR_TYPE[${SENSORa}]}" == "cpu" ]; then
GAUGE="CPU-USAGE"
elif [ "${PW_SENSOR_TYPE[${SENSORa}]}" == "system" ] && [[ "${SENSORa}" = *"FAN"* ]]; then
GAUGE="RPM"
else
GAUGE="TEMP"
fi
if [ "${PW_SENSOR_TYPE[${SENSORa}]}" == "cpu" ]; then
GAUGESH='%'
elif [ "${PW_SENSOR_TYPE[${SENSORa}]}" == "system" ] && [[ "${SENSORa}" = *"FAN"* ]]; then
GAUGESH="'RPM"
else
GAUGESH="'F"
fi
[ -f ${PW_TMPFOLDER}/${SENSOR}.* ] && rm -f ${PW_TMPFOLDER}/${SENSOR}.*
if [ -f ${PW_TMPFOLDER}/${SENSOR}-error.sent ]; then
SENDNOTICE "${SENSOR} Data" "${SENSOR} is reporting data again"
@@ -377,7 +393,13 @@ CHECKTEMP_SERVICE(){
if [ "${SENSOR}" == "ServerRoomTH" ]; then
temp_f=`echo "scale=2; ${temp_c}*1.8+32+${PW_ServerRoomTH_Dev}" | bc`
else
[ "${PW_SENSOR_TYPE[${SENSOR}]}" == "cpu" ] && temp_f=$(echo "scale=2; $temp_c/1" | bc -l) || temp_f=$(bc <<< "scale=2; ${temp_c}*1.8+32")
if [ "${PW_SENSOR_TYPE[${SENSOR}]}" == "cpu" ]; then
temp_f=$(echo "scale=2; $temp_c/1" | bc -l)
elif [ "${PW_SENSOR_TYPE[${SENSORa}]}" == "system" ] && [[ "${SENSORa}" = *"FAN"* ]]; then
temp_f=${temp_c}
else
temp_f=$(bc <<< "scale=2; ${temp_c}*1.8+32")
fi
(( $(bc <<<"${temp_f} < 1") )) && [[ "${temp_f}" = *"."* ]] && temp_f="0${temp_f}"
fi