update
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
VERS='2.7.92-08222024'
|
VERS='2.7.93-08222024'
|
||||||
|
|
||||||
noheader=' update service dailytemp confsync -r -report test '
|
noheader=' update service dailytemp confsync -r -report test '
|
||||||
|
|
||||||
|
|||||||
@@ -1562,6 +1562,21 @@ SENDTEMP(){
|
|||||||
temp_c=`IDS_NUMBER_FORMAT $(echo ${INFO} | jq -r '.device0 .obs[].ambient_temp') 2 yes`
|
temp_c=`IDS_NUMBER_FORMAT $(echo ${INFO} | jq -r '.device0 .obs[].ambient_temp') 2 yes`
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
elif [ "${PW_SENSOR_TYPE[${SENSORa}]}" == "esphome" ]; then
|
||||||
|
if ! temp_c=$(curl -m 5 -s GET -H "Authorization: Bearer ${PW_ESPHOME_API}" ${PW_HOMEASSISTANT_URL}/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 5 -s GET -H "Authorization: Bearer ${PW_ESPHOME_API}" ${PW_HOMEASSISTANT_URL}/api/states/sensor.${PW_SENSOR_DEVICEID[${SENSORa}]}_humidity | jq -r '.state') 2 yes`
|
||||||
|
else
|
||||||
|
temp_c=''
|
||||||
|
fi
|
||||||
|
|
||||||
|
elif [ "${PW_SENSOR_TYPE[${SENSORa}]}" == "espdev" ]; then
|
||||||
|
if ! temp_c=$(curl -m 8 -s http://${PW_REMOTE_SENSORS[${SENSORa}]}:8090/sensor/${PW_SENSOR_DEVICEID[${SENSORa}]} | jq '.value'); then TIMEOUT=1; fi
|
||||||
|
if [ "${temp_c}" != "" ]; then
|
||||||
|
temp_h=`IDS_NUMBER_FORMAT $(curl -m 8 -s http://${PW_REMOTE_SENSORS[${SENSORa}]}:8090/sensor/${PW_SENSOR_DEVICEID[${SENSORa}]/temperature/humidity} | jq '.value') 2 yes`
|
||||||
|
fi
|
||||||
|
|
||||||
elif [ "${PW_SENSOR_TYPE[${SENSORa}]}" == "system" ]; then
|
elif [ "${PW_SENSOR_TYPE[${SENSORa}]}" == "system" ]; then
|
||||||
if [[ "${SENSORa}" = *"CPU"* ]]; then
|
if [[ "${SENSORa}" = *"CPU"* ]]; then
|
||||||
temp_c=$(vcgencmd measure_temp)
|
temp_c=$(vcgencmd measure_temp)
|
||||||
@@ -1569,6 +1584,7 @@ SENDTEMP(){
|
|||||||
elif [[ "${SENSORa}" = *"FAN"* ]]; then
|
elif [[ "${SENSORa}" = *"FAN"* ]]; then
|
||||||
temp_c=$(cat ${PW_FANINPUT})
|
temp_c=$(cat ${PW_FANINPUT})
|
||||||
fi
|
fi
|
||||||
|
|
||||||
elif [ "${PW_SENSOR_TYPE[${SENSORa}]}" == "remotesystem" ]; then
|
elif [ "${PW_SENSOR_TYPE[${SENSORa}]}" == "remotesystem" ]; then
|
||||||
temp_c=$(ssh -q -o ConnectTimeout=3 -o ConnectionAttempts=1 root@${PW_REMOTE_SENSORS[${SENSORa}]} vcgencmd measure_temp)
|
temp_c=$(ssh -q -o ConnectTimeout=3 -o ConnectionAttempts=1 root@${PW_REMOTE_SENSORS[${SENSORa}]} vcgencmd measure_temp)
|
||||||
if [ "${temp_c}" != "" ]; then
|
if [ "${temp_c}" != "" ]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user