update
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
VERS='2.7.119-11032024'
|
VERS='2.7.120-11042024'
|
||||||
|
|
||||||
noheader=' update service dailytemp confsync -r -report test '
|
noheader=' update service dailytemp confsync -r -report test '
|
||||||
|
|
||||||
|
|||||||
@@ -675,6 +675,13 @@ CHECKTEMPSENSOR(){
|
|||||||
elif [ "${PW_SENSOR_TYPE[${1}]}" == "tuya" ]; then
|
elif [ "${PW_SENSOR_TYPE[${1}]}" == "tuya" ]; then
|
||||||
IFS=: read -r temp_c temp_h <<< $(GET_TUYA_TEMP ${1}); unset IFS
|
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
|
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=$(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
|
if [ "${INFO}" != "" ]; then
|
||||||
@@ -946,6 +953,13 @@ CHECKTEMP_SERVICE_RUNSENSOR(){
|
|||||||
elif [ "${PW_SENSOR_TYPE[${1}]}" == "tuya" ]; then
|
elif [ "${PW_SENSOR_TYPE[${1}]}" == "tuya" ]; then
|
||||||
IFS=: read -r temp_c temp_h <<< $(GET_TUYA_TEMP ${1}); unset IFS
|
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
|
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)
|
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
|
if [[ "${SENSOR}" = *"-Probe" ]]; then
|
||||||
@@ -1308,6 +1322,10 @@ Previous Temp: ${last_temp}${GAUGESH}"
|
|||||||
fi
|
fi
|
||||||
QRY=""
|
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
|
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}')"
|
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}')"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user