diff --git a/powerwall.sh b/powerwall.sh index 5a122592..7e63e739 100755 --- a/powerwall.sh +++ b/powerwall.sh @@ -35,7 +35,7 @@ CHECKTEMP(){ } CHECKTEMP_SERVICE(){ - last_temp=1 + last_temp=0 mqtt_message=`${mqtt_conn} -t tele/${1}/SENSOR -C 1` while true do @@ -82,7 +82,7 @@ CHECKTEMP_SERVICE(){ echo "alert sent" last_temp=1 fi - [ "$last_temp" == "1" ] && echo "NORMAL TEMP: $temp_f°F" | mail -s "${1} TEMP NORMAL" $email_alert + [ "$last_temp" == "0" ] && echo "NORMAL TEMP: $temp_f°F" | mail -s "${1} TEMP NORMAL" $email_alert; last_temp=1 echo "($datetime) normal: $temp_f°F" fi