This commit is contained in:
2024-11-04 18:12:18 -06:00
parent ee539df097
commit 47772b3d80
2 changed files with 21 additions and 3 deletions

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env bash
VERS='2.7.119-11032024'
VERS='2.7.120-11042024'
noheader=' update service dailytemp confsync -r -report test '

View File

@@ -675,6 +675,13 @@ CHECKTEMPSENSOR(){
elif [ "${PW_SENSOR_TYPE[${1}]}" == "tuya" ]; then
IFS=: read -r temp_c temp_h <<< $(GET_TUYA_TEMP ${1}); unset IFS
elif [ "${PW_SENSOR_TYPE[${1}]}" == "midea" ]; then
IFS='~' read -r token key <<< ${PW_SENSOR_DEVICEID[${1}]}; unset IFS
info=$(midea-beautiful-air-cli status --ip ${PW_REMOTE_SENSORS[${1}]} --token ${token} --key ${key})
temp_c=$(echo "${info}" | grep indoor | awk ' {print $3}')
target=$(echo "${info}" | grep target | awk ' {print $3}')
elif [ "${PW_SENSOR_TYPE[${1}]}" == "lacrosse" ]; then
if ! INFO=$(curl -m 8 -s --get -d "deviceid=${PW_SENSOR_DEVICEID[${SENSOR}]}" -d "limit=1" -d "metric=1" -d "timezone=2" https://decent-destiny-704.appspot.com/laxservices/device_info.php) ; then TIMEOUT=1; fi
if [ "${INFO}" != "" ]; then
@@ -945,7 +952,14 @@ CHECKTEMP_SERVICE_RUNSENSOR(){
elif [ "${PW_SENSOR_TYPE[${1}]}" == "tuya" ]; then
IFS=: read -r temp_c temp_h <<< $(GET_TUYA_TEMP ${1}); unset IFS
elif [ "${PW_SENSOR_TYPE[${1}]}" == "midea" ]; then
IFS='~' read -r token key <<< ${PW_SENSOR_DEVICEID[${1}]}; unset IFS
info=$(midea-beautiful-air-cli status --ip ${PW_REMOTE_SENSORS[${1}]} --token ${token} --key ${key})
temp_c=$(echo "${info}" | grep indoor | awk ' {print $3}')
target=$(echo "scale=2; $(echo "${info}" | grep target | awk ' {print $3}')/1" | bc -l)
elif [ "${PW_SENSOR_TYPE[${SENSOR}]}" == "lacrosse" ]; then
INFO=$(curl -m 5 -s --get -d "deviceid=${PW_SENSOR_DEVICEID[${SENSOR}]}" -d "limit=1" -d "metric=1" -d "timezone=2" https://decent-destiny-704.appspot.com/laxservices/device_info.php | jq)
if [[ "${SENSOR}" = *"-Probe" ]]; then
@@ -1307,7 +1321,11 @@ Previous Temp: ${last_temp}${GAUGESH}"
fi
fi
QRY=""
elif [ "${SENSOR}" == "AC" ]; then
${mysql_conn} -e "USE servermonitor; INSERT INTO sensor_data (\`sensorid\`, \`date\`, \`temp\`) VALUES ('38',CONVERT_TZ('$(date +'%Y-%m-%d %H:%M:%S')', 'America/Chicago', 'UTC'),'${target}')"
QRY="USE servermonitor; INSERT INTO sensor_data (\`sensorid\`, \`date\`, \`temp\`) VALUES ('${PW_SENSOR_ID[${SENSOR}]}',CONVERT_TZ('$(date +'%Y-%m-%d %H:%M:%S')', 'America/Chicago', 'UTC'),'${temp_f}')"
else
QRY="USE servermonitor; INSERT INTO sensor_data (\`sensorid\`, \`date\`, \`temp\`) VALUES ('${PW_SENSOR_ID[${SENSORa}]}',CONVERT_TZ('$(date +'%Y-%m-%d %H:%M:%S')', 'America/Chicago', 'UTC'),'${temp_f}')"