Update powerwall.sh
This commit is contained in:
@@ -119,6 +119,7 @@ CHECKACV_SERVICE(){
|
|||||||
while true
|
while true
|
||||||
do
|
do
|
||||||
INPUTACV=$(curl -s "http://10.10.0.61/stats.json" | jq '.inputs .inV')
|
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'`
|
datetime=`date +'%Y-%m-%d %H:%M:%S'`
|
||||||
if [ ${INPUTACV} -ge ${min_acvolt} ]; then
|
if [ ${INPUTACV} -ge ${min_acvolt} ]; then
|
||||||
if [ $voltstatus -eq 3 ]; then
|
if [ $voltstatus -eq 3 ]; then
|
||||||
@@ -137,12 +138,11 @@ CHECKACV_SERVICE(){
|
|||||||
else
|
else
|
||||||
[ $VERBOSE = true ] && echo "($datetime) LOW voltage: ${INPUTACV}V"
|
[ $VERBOSE = true ] && echo "($datetime) LOW voltage: ${INPUTACV}V"
|
||||||
if [ $voltstatus -lt 3 ]; then
|
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"
|
[ $VERBOSE = true ] && echo "($datetime) alert sent"
|
||||||
last_battvolt=$BATTVOLT
|
last_battvolt=$BATTVOLT
|
||||||
fi
|
fi
|
||||||
voltstatus=3
|
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
|
if [ ${BATTVOLT%.*} -lt ${min_battvolt} ] && [ ${BATTVOLT%.*} -gt ${min_battvolt_sys} ]; then
|
||||||
[ $VERBOSE = true ] && echo "($datetime) LOW BATTERY voltage: ${BATTVOLT}V"
|
[ $VERBOSE = true ] && echo "($datetime) LOW BATTERY voltage: ${BATTVOLT}V"
|
||||||
if [ $battstatus -lt 2 ]; then
|
if [ $battstatus -lt 2 ]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user