From e35764d9e66b508664e69cc51af6a36b1664c603 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Fri, 30 Sep 2022 22:22:08 -0500 Subject: [PATCH] Update powerwall.sh --- powerwall.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/powerwall.sh b/powerwall.sh index 04a56230..0039360d 100755 --- a/powerwall.sh +++ b/powerwall.sh @@ -119,6 +119,7 @@ CHECKACV_SERVICE(){ while true do INPUTACV=$(curl -s "http://10.10.0.61/stats.json" | jq '.inputs .inV') + BATTVOLT=$(curl -s "http://10.10.0.61/stats.json" | jq '.inputs .battV') datetime=`date +'%Y-%m-%d %H:%M:%S'` if [ ${INPUTACV} -ge ${min_acvolt} ]; then if [ $voltstatus -eq 3 ]; then @@ -137,12 +138,11 @@ CHECKACV_SERVICE(){ else [ $VERBOSE = true ] && echo "($datetime) LOW voltage: ${INPUTACV}V" if [ $voltstatus -lt 3 ]; then - echo -e "($datetime) Power off or low voltage detected\nVOLTAGE: ${INPUTACV}V" | mail -s "POWER ALERT - LOW POWER!!" $email_alert + echo -e "($datetime) Power off or low voltage detected\nVOLTAGE: ${INPUTACV}V\nBATT VOLTAGE: ${BATTVOLT}V" | mail -s "POWER ALERT - LOW POWER!!" $email_alert [ $VERBOSE = true ] && echo "($datetime) alert sent" last_battvolt=$BATTVOLT fi voltstatus=3 - BATTVOLT=$(curl -s "http://10.10.0.61/stats.json" | jq '.inputs .battV') if [ ${BATTVOLT%.*} -lt ${min_battvolt} ] && [ ${BATTVOLT%.*} -gt ${min_battvolt_sys} ]; then [ $VERBOSE = true ] && echo "($datetime) LOW BATTERY voltage: ${BATTVOLT}V" if [ $battstatus -lt 2 ]; then