Update powerwall.sh

This commit is contained in:
2022-09-30 22:22:08 -05:00
parent c66941383c
commit e35764d9e6

View File

@@ -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