From 9d71219f33f901cad30020c6ea041e59fe59e6f3 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Sat, 3 Sep 2022 12:17:51 -0500 Subject: [PATCH] Update powerwall.sh --- powerwall.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/powerwall.sh b/powerwall.sh index 56b0296d..313019d4 100755 --- a/powerwall.sh +++ b/powerwall.sh @@ -38,6 +38,8 @@ CHECKTEMP(){ CHECKTEMP_SERVICE(){ mqtt_message=`${mqtt_conn} -t tele/${1}/SENSOR -C 1` echo $mqtt_message | cut -d':' -f 6 | cut -d',' -f 1 | read temp_c + echo $mqtt_message | cut -d'T' -f 2 | cut -d"\"" -f 3 | read temp_d + echo $mqtt_message | cut -d'T' -f 3 | cut -d"\"" -f 1 | read temp_t if [ "$temp_c" != "null" ] && [ "$temp_c" != "" ]; then temp_f=`echo "scale=2; $temp_c*1.8 + 32" | bc` #echo "$temp_c -> $temp_f" @@ -47,13 +49,13 @@ CHECKTEMP_SERVICE(){ if [ $(bc -l <<< "$temp_f >= $temp_warn") -eq 1 ] && [ $(bc -l <<< "$temp_f < $temp_crit") -eq 1 ]; then #echo "WARNING TEMP: $temp_f°F" | mail -s "${1} TEMP WARNING" $email_alert - echo "WARNING: $temp_f°F" + echo "WARNING: $temp_f°F ($temp_d @ $temp_t)" elif [ $(bc -l <<< "$temp_f >= $temp_crit") -eq 1 ]; then #echo "CRITICAL TEMP: $temp_f°F" | mail -s "${1} TEMP CRITICAL" $email_alert - echo "CRITICAL: $temp_f°F" + echo "CRITICAL: $temp_f°F ($temp_d @ $temp_t)" else #echo "NORMAL TEMP: $temp_f°F" | mail -s "${1} TEMP NORMAL" $email_alert - echo "normal: $temp_f°F" + echo "normal: $temp_f°F ($temp_d @ $temp_t)" fi fi