diff --git a/defaults.inc b/defaults.inc index 88a865a6..f8544f59 100755 --- a/defaults.inc +++ b/defaults.inc @@ -1,6 +1,6 @@ #!/usr/bin/env bash -VERS='2.5.263-02062024' +VERS='2.5.264-02062024' noheader=' update service dailytemp confsync -r -report ' diff --git a/inc/temp.inc.sh b/inc/temp.inc.sh index 249ecd0a..16735aea 100644 --- a/inc/temp.inc.sh +++ b/inc/temp.inc.sh @@ -577,6 +577,11 @@ CHECKTEMP_SERVICE_RUNSENSOR(){ fi temp_h='' + elif [ "${PW_SENSOR_TYPE[${SENSORa}]}" == "ds18b20" ]; then + if ! temp_c=$(ssh -q -o ConnectTimeout=3 -o ConnectionAttempts=1 root@${PW_REMOTE_SENSORS[${1}]} cat /sys/bus/w1/devices/${PW_SENSOR_DEVICEID[${1}]}/w1_slave | tail -n1 | cut -d "=" -f2) ; then TIMEOUT=1; fi + [ "${temp_c}" != "" ] && temp_c=$(echo "scale=2; ${temp_c}/1000" | bc) + temp_h='' + fi [ ! -f ${PW_TMPFOLDER}/.lasttemp/${SENSOR} ] && echo 0 > ${PW_TMPFOLDER}/.lasttemp/${SENSOR} @@ -1019,6 +1024,11 @@ SENDTEMP(){ else temp_c=$(ssh -q -o ConnectTimeout=3 -o ConnectionAttempts=1 root@${PW_REMOTE_SENSORS[${SENSORa}]} "/opt/idssys/defaults/get-data.sh cpu-usage") fi + + elif [ "${PW_SENSOR_TYPE[${SENSORa}]}" == "ds18b20" ]; then + if ! temp_c=$(ssh -q -o ConnectTimeout=3 -o ConnectionAttempts=1 root@${PW_REMOTE_SENSORS[${1}]} cat /sys/bus/w1/devices/${PW_SENSOR_DEVICEID[${1}]}/w1_slave | tail -n1 | cut -d "=" -f2) ; then TIMEOUT=1; fi + [ "${temp_c}" != "" ] && temp_c=$(echo "scale=2; ${temp_c}/1000" | bc) + else temp_c='' fi