Update powerwall.sh
This commit is contained in:
25
powerwall.sh
25
powerwall.sh
@@ -113,13 +113,25 @@ CHECKTEMP_SERVICE(){
|
||||
done # &
|
||||
}
|
||||
|
||||
CHECKPOWER(){
|
||||
INPUTV=$(curl -s "http://10.10.0.61/stats.json" | jq '.inputs .inV')
|
||||
INPUTA=$(curl -s "http://10.10.0.61/stats.json" | jq '.inputs .inA')
|
||||
OUTPUTV=$(curl -s "http://10.10.0.61/stats.json" | jq '.outputs .outV')
|
||||
OUTPUTA=$(curl -s "http://10.10.0.61/stats.json" | jq '.outputs .outA')
|
||||
BATTV=$(curl -s "http://10.10.0.61/stats.json" | jq '.inputs .battV')
|
||||
BATTA=$(curl -s "http://10.10.0.61/stats.json" | jq '.inputs .xfA')
|
||||
echo "Input Power: ${INPUTV}V / ${INPUTA}A"
|
||||
echo "Output Power: ${OUTPUTV}V / ${OUTPUTA}A"
|
||||
echo "Battery Power: ${BATTV}V / ${BATTA}A"
|
||||
}
|
||||
|
||||
CHECKACV_SERVICE(){
|
||||
voltstatus=0
|
||||
battstatus=0
|
||||
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')
|
||||
voltstatus=0
|
||||
battstatus=0
|
||||
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
|
||||
@@ -272,6 +284,7 @@ if [ ${action-x} ]; then
|
||||
startall) STARTALL_SERVICES;;
|
||||
restartall) RESTART_SERVICES;;
|
||||
checktemp) CHECKTEMP ${2};;
|
||||
checkpower) CHECKPOWER;;
|
||||
checktemp_service)
|
||||
if [ "${2}" = "stop" ]; then
|
||||
STOP_SERVICE ${3}
|
||||
|
||||
Reference in New Issue
Block a user