Update powerwall.sh
This commit is contained in:
11
powerwall.sh
11
powerwall.sh
@@ -118,7 +118,7 @@ CHECKACV_SERVICE(){
|
||||
do
|
||||
INPUTACV=$(curl -s "http://10.10.0.61/stats.json" | jq '.inputs .inV')
|
||||
datetime=`date +'%Y-%m-%d %H:%M:%S'`
|
||||
if [ ${INPUTACV} -ge ${min_volt} ]; then
|
||||
if [ ${INPUTACV} -ge ${min_acvolt} ]; then
|
||||
if [ $voltstatus -eq 3 ]; then
|
||||
[ $VERBOSE = true ] && echo "($datetime) back to normal voltage: ${INPUTACV}V"
|
||||
echo -e "($datetime) Normal voltage detected\nVOLTAGE: ${INPUTACV}V" | mail -s "POWER NOMINAL AGAIN" $email_alert
|
||||
@@ -132,7 +132,7 @@ CHECKACV_SERVICE(){
|
||||
fi
|
||||
voltstatus=1
|
||||
else
|
||||
echo "($datetime) LOW voltage: ${INPUTACV}V"
|
||||
[ $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
|
||||
[ $VERBOSE = true ] && echo "($datetime) alert sent"
|
||||
@@ -140,7 +140,12 @@ CHECKACV_SERVICE(){
|
||||
voltstatus=3
|
||||
BATTVOLT=$(curl -s "http://10.10.0.61/stats.json" | jq '.inputs ..battV')
|
||||
[ $VERBOSE = true ] && echo "($datetime) Battery Voltage: ${BATTVOLT}V"
|
||||
|
||||
if [ ${BATTVOLT%.*} -lt ${min_acvolt} ]; then
|
||||
[ $VERBOSE = true ] && echo "($datetime) LOW BATTERY voltage: ${BATTVOLT}V"
|
||||
[ $VERBOSE = true ] && echo "($datetime) Shutting down server..."
|
||||
|
||||
|
||||
fi
|
||||
fi
|
||||
sleep 10
|
||||
done # &
|
||||
|
||||
Reference in New Issue
Block a user