From 2379b9eb4a713e3a30a30d07bd4c060fb62306d9 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Wed, 10 Apr 2024 10:54:09 -0500 Subject: [PATCH] Update temp.inc.sh --- inc/temp.inc.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/inc/temp.inc.sh b/inc/temp.inc.sh index 1404be47..a9346e9d 100644 --- a/inc/temp.inc.sh +++ b/inc/temp.inc.sh @@ -620,10 +620,10 @@ CHECKTEMP_SERVICE_RUNSENSOR(){ echo ${mqtt_message} | cut -d':' -f 6 | cut -d',' -f 1 | read temp_c elif [ "${PW_SENSOR_TYPE[${SENSORa}]}" == "esphome" ]; then - if ! temp_c=$(curl -m 8 -s GET -H "Authorization: Bearer ${PW_ESPHOME_API}" http://10.10.1.180:8123/api/states/sensor.${PW_SENSOR_DEVICEID[${SENSORa}]}_temperature | jq -r '.state') ; then TIMEOUT=1; fi + if ! temp_c=$(curl -m 5 -s GET -H "Authorization: Bearer ${PW_ESPHOME_API}" http://10.10.1.180:8123/api/states/sensor.${PW_SENSOR_DEVICEID[${SENSORa}]}_temperature | jq -r '.state') ; then TIMEOUT=1; fi if [ "${temp_c}" != "" ]; then temp_f=`IDS_NUMBER_FORMAT ${temp_c} 2 yes` - temp_h=`IDS_NUMBER_FORMAT $(curl -m 8 -s GET -H "Authorization: Bearer ${PW_ESPHOME_API}" http://10.10.1.180:8123/api/states/sensor.${PW_SENSOR_DEVICEID[${SENSORa}]}_humidity | jq -r '.state') 2 yes` + temp_h=`IDS_NUMBER_FORMAT $(curl -m 5 -s GET -H "Authorization: Bearer ${PW_ESPHOME_API}" http://10.10.1.180:8123/api/states/sensor.${PW_SENSOR_DEVICEID[${SENSORa}]}_humidity | jq -r '.state') 2 yes` else temp_c='' fi @@ -730,7 +730,7 @@ CHECKTEMP_SERVICE_RUNSENSOR(){ (( $(bc <<<"${temp_f} < 1") )) && [[ "${temp_f}" = *"."* ]] && temp_f="0${temp_f}" fi - # echo "HERE: [${SENSOR//-/}] - ${last_temp} - ${temp_c} - ${temp_f} - ${temp_warn} - ${temp_crit} - ${temp_crit_sys}" + echo "HERE: [${SENSOR//-/}] - ${last_temp} - ${temp_c} - ${temp_f} - ${temp_warn} - ${temp_crit} - ${temp_crit_sys}" # [ ! "${temp_c}" ] || [ ! "${temp_f}" ] || [ ! "${temp_warn}" ] || [ ! "${temp_crit}" ] || [ ! "${temp_crit_sys}" ] && echo "VALUE NOT FOUND" if [ "${PW_SENSOR_TYPE[${SENSORa}]}" != "esxi" ]; then