From 61994fd6c66c81676314ec42d7fc31fbb4a5c63b Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Sun, 11 Sep 2022 14:25:22 -0500 Subject: [PATCH] Update powerwall.sh --- powerwall.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/powerwall.sh b/powerwall.sh index 28b6d1f2..6d7feb79 100755 --- a/powerwall.sh +++ b/powerwall.sh @@ -115,8 +115,11 @@ CHECKACV_SERVICE(){ while true do INPUTACV=$(curl -s "http://10.10.0.61/stats.json" | jq '.inputs .inV') + datetime="${temp_d} ${temp_t}" + datetime=$(TZ=UTC0 date -d "${datetime}" +%s) + datetime=`date -d @${datetime} +'%Y-%m-%d %H:%M:%S'` if [ ${INPUTACV%.*} -gt 105 ]; then - + echo "($datetime) normal voltage: ${INPUTACV}V" fi sleep 30 done # & @@ -193,7 +196,7 @@ if [ ${action-x} ]; then if [ "${2}" = "stop" ]; then service_pid=`systemctl show --property MainPID --value ${SERVICE_NAME[${3}]}` /bin/kill -9 $service_pid - /bin/systemctl stop $srvcname + #/bin/systemctl stop $srvcname #/usr/bin/killall bash else @@ -204,11 +207,11 @@ if [ ${action-x} ]; then if [ "${2}" = "stop" ]; then service_pid=`systemctl show --property MainPID --value ${SERVICE_NAME[${3}]}` /bin/kill -9 $service_pid - /bin/systemctl stop $srvcname + #/bin/systemctl stop $srvcname #/usr/bin/killall bash else - CHECKACV_SERVICE ${2} + CHECKACV_SERVICE fi ;; esac