Update powerwall.sh
This commit is contained in:
@@ -77,6 +77,8 @@ 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 10 ] && relog=1 || relog=0
|
||||||
for SENSOR in ${!SENSOR_ID[@]}; do
|
for SENSOR in ${!SENSOR_ID[@]}; do
|
||||||
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`
|
||||||
@@ -89,8 +91,6 @@ CHECKTEMP_SERVICE(){
|
|||||||
temp_h=''
|
temp_h=''
|
||||||
fi
|
fi
|
||||||
datetime=`date +'%Y-%m-%d %H:%M:%S'`
|
datetime=`date +'%Y-%m-%d %H:%M:%S'`
|
||||||
errtime=$(expr `date +%s` - $(stat -c %Y ${logtemp}))
|
|
||||||
[ $errtime -ge 10 ] && relog=1 || relog=0
|
|
||||||
|
|
||||||
if [ "$temp_c" != "null" ] && [ "$temp_c" != "" ]; then
|
if [ "$temp_c" != "null" ] && [ "$temp_c" != "" ]; then
|
||||||
temp_f=`echo "scale=2; $temp_c*1.8 + 32" | bc`
|
temp_f=`echo "scale=2; $temp_c*1.8 + 32" | bc`
|
||||||
|
|||||||
Reference in New Issue
Block a user