update
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
VERS='2.6.64-03162024'
|
VERS='2.6.65-03162024'
|
||||||
|
|
||||||
noheader=' update service dailytemp confsync -r -report '
|
noheader=' update service dailytemp confsync -r -report '
|
||||||
|
|
||||||
|
|||||||
@@ -914,6 +914,16 @@ Previous Temp: ${last_temp}${GAUGESH}"
|
|||||||
QRY="USE servermonitor; INSERT INTO sensor_data (\`sensorid\`, \`date\`, \`temp\`, \`hum\`) VALUES ('${PW_SENSOR_ID[${SENSORa}]}','$(date +'%Y-%m-%d %H:%M:%S')','${temp_f}','${temp_h}')"
|
QRY="USE servermonitor; INSERT INTO sensor_data (\`sensorid\`, \`date\`, \`temp\`, \`hum\`) VALUES ('${PW_SENSOR_ID[${SENSORa}]}','$(date +'%Y-%m-%d %H:%M:%S')','${temp_f}','${temp_h}')"
|
||||||
else [ "${temp_f}" != "32.00" ]; then
|
else [ "${temp_f}" != "32.00" ]; then
|
||||||
QRY="USE servermonitor; INSERT INTO sensor_data (\`sensorid\`, \`date\`, \`temp\`) VALUES ('${PW_SENSOR_ID[${SENSORa}]}','$(date +'%Y-%m-%d %H:%M:%S')','${temp_f}')"
|
QRY="USE servermonitor; INSERT INTO sensor_data (\`sensorid\`, \`date\`, \`temp\`) VALUES ('${PW_SENSOR_ID[${SENSORa}]}','$(date +'%Y-%m-%d %H:%M:%S')','${temp_f}')"
|
||||||
|
|
||||||
|
elif [ "${SENSOR}" == "Powerwall-Switch" ]; then
|
||||||
|
[ ! -f ${PW_TMPFOLDER}/${SENSOR}.down ] && touch ${PW_TMPFOLDER}/${SENSOR}.down
|
||||||
|
if [ ! -f ${PW_TMPFOLDER}/${SENSOR}-error.reading ]; then
|
||||||
|
touch ${PW_TMPFOLDER}/${SENSOR}-error.reading
|
||||||
|
elif [ ! -f ${PW_TMPFOLDER}/${SENSOR}.disable ] && (([ ! -f ${PW_TMPFOLDER}/${SENSOR}-error.sent ] && [ $(expr `date +%s` - $(stat -c %Y ${PW_TMPFOLDER}/${SENSOR}-error.reading)) -ge 60 ]) || ([ -f ${PW_TMPFOLDER}/${SENSOR}-error.sent ] && [ $(expr `date +%s` - $(stat -c %Y ${PW_TMPFOLDER}/${SENSOR}-error.sent)) -ge $(echo "scale=0; ${PW_RENOTIFY_TIMEOUT}*60" | bc) ])); then
|
||||||
|
touch ${PW_TMPFOLDER}/${SENSOR}-error.sent
|
||||||
|
SENDNOTICE "${SENSOR} Sensor ERROR" "ERROR reading sensor data" 1
|
||||||
|
echo "($(date +'%Y-%m-%d %H:%M:%S')) - ${SENSOR} Sensor - ERROR reading sensor data" >> ${logtemp}
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
${mysql_conn} -e "${QRY}"
|
${mysql_conn} -e "${QRY}"
|
||||||
# if [ "${PW_SENSOR_TYPE[${SENSOR}]}" == "lacrosse" ]; then
|
# if [ "${PW_SENSOR_TYPE[${SENSOR}]}" == "lacrosse" ]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user