update
This commit is contained in:
@@ -14,11 +14,12 @@ min_battvolt_sys=47
|
|||||||
#47
|
#47
|
||||||
|
|
||||||
FOLDER='/opt/idssys/powerwall'
|
FOLDER='/opt/idssys/powerwall'
|
||||||
logfile=${FOLDER}/logfile
|
LOGFOLDER=${FOLDER}/logs
|
||||||
logacv=${FOLDER}/log-acv
|
[ ! -d ${LOGFOLDER} ] && mkdir ${LOGFOLDER}
|
||||||
|
logfile=${LOGFOLDER}/logfile
|
||||||
|
logacv=${LOGFOLDER}/log-acv
|
||||||
[ ! -f ${logacv} ] && touch ${logacv}
|
[ ! -f ${logacv} ] && touch ${logacv}
|
||||||
logtemp=${FOLDER}/log-temp
|
|
||||||
[ ! -f ${logtemp} ] && touch ${logtemp}
|
|
||||||
|
|
||||||
declare -A TEMP_THRESHOLDS
|
declare -A TEMP_THRESHOLDS
|
||||||
TEMP_THRESHOLDS['ServerRoomTH']="83,88,95"
|
TEMP_THRESHOLDS['ServerRoomTH']="83,88,95"
|
||||||
|
|||||||
@@ -77,9 +77,13 @@ CHECKTEMP_SERVICE(){
|
|||||||
cw=20
|
cw=20
|
||||||
declare -A last_temp
|
declare -A last_temp
|
||||||
while true; do
|
while true; do
|
||||||
errtime=$(expr `date +%s` - $(stat -c %Y ${logtemp}))
|
|
||||||
[ $errtime -ge 3600 ] && relog=1 || relog=0
|
|
||||||
for SENSOR in ${!SENSOR_ID[@]}; do
|
for SENSOR in ${!SENSOR_ID[@]}; do
|
||||||
|
logtemp=${LOGFOLDER}/log-temp-${SENSOR}
|
||||||
|
[ ! -f ${logtemp} ] && touch ${logtemp}
|
||||||
|
errtime=$(expr `date +%s` - $(stat -c %Y ${logtemp}))
|
||||||
|
[ $errtime -ge 3600 ] && relog=1 || relog=0
|
||||||
|
|
||||||
if [ "${SENSOR_TYPE[${SENSOR}]}" == "mqtt" ]; then
|
if [ "${SENSOR_TYPE[${SENSOR}]}" == "mqtt" ]; then
|
||||||
mqtt_message=`${mqtt_conn} -t tele/${SENSOR}/SENSOR -C 1`
|
mqtt_message=`${mqtt_conn} -t tele/${SENSOR}/SENSOR -C 1`
|
||||||
echo $mqtt_message | cut -d':' -f 7 | cut -d',' -f 1 | read temp_h
|
echo $mqtt_message | cut -d':' -f 7 | cut -d',' -f 1 | read temp_h
|
||||||
|
|||||||
Reference in New Issue
Block a user