Update powerwall.sh

This commit is contained in:
2022-09-30 22:40:30 -05:00
parent a161e161a8
commit c796e6521c

View File

@@ -113,6 +113,18 @@ CHECKTEMP_SERVICE(){
done # & 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(){ CHECKACV_SERVICE(){
voltstatus=0 voltstatus=0
battstatus=0 battstatus=0
@@ -272,6 +284,7 @@ if [ ${action-x} ]; then
startall) STARTALL_SERVICES;; startall) STARTALL_SERVICES;;
restartall) RESTART_SERVICES;; restartall) RESTART_SERVICES;;
checktemp) CHECKTEMP ${2};; checktemp) CHECKTEMP ${2};;
checkpower) CHECKPOWER;;
checktemp_service) checktemp_service)
if [ "${2}" = "stop" ]; then if [ "${2}" = "stop" ]; then
STOP_SERVICE ${3} STOP_SERVICE ${3}