From 68d777b78d57c63eb9d87e25bec1aac3d0696c16 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Wed, 10 Apr 2024 10:43:18 -0500 Subject: [PATCH] Update temp.inc.sh --- inc/temp.inc.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/inc/temp.inc.sh b/inc/temp.inc.sh index 3c64e6e5..5a12b457 100644 --- a/inc/temp.inc.sh +++ b/inc/temp.inc.sh @@ -359,11 +359,11 @@ CHECKTEMPSENSOR(){ echo ${mqtt_message} | cut -d':' -f 7 | cut -d',' -f 1 | read temp_h elif [ "${PW_SENSOR_TYPE[${1}]}" == "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[${1}]}_temperature | jq '.state') ; then TIMEOUT=1; fi + 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[${1}]}_temperature | jq -r '.state') ; then TIMEOUT=1; fi echo "HERE: '${temp_c}'" 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[${1}]}_humidity | jq '.state') 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[${1}]}_humidity | jq -r '.state') 2 yes` else temp_c='' fi