From 642ee237f957a23920a42ac19475032d7d51f137 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Wed, 22 Nov 2023 14:49:35 -0600 Subject: [PATCH] Update powerwall.sh --- powerwall.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/powerwall.sh b/powerwall.sh index f10e9bbf..7436331b 100755 --- a/powerwall.sh +++ b/powerwall.sh @@ -554,7 +554,17 @@ CHECKPOWER(){ [[ "${OUTPUTW}" == *"."* ]] && [[ "${OUTPUTW}" != *".0"* ]] && OUTPUTW=`printf "%'.2f\n" ${OUTPUTW}` || OUTPUTW=`printf "%'.0f\n" ${OUTPUTW}` BATTV=`echo ${INVSTATSINFO} | jq '.inputs .battV'` BATTA=`echo ${INVSTATSINFO} | jq '.inputs .xfA'` - [[ "${BATTA}" == *"-"* ]] && BATTA_disp="${idsCL[Green]}${BATTA}'amps - Charging" || BATTA_disp="${idsCL[LightRed]}${BATTA}'amps - Discharging" + if (( $(bc <<<"${BATTV} > 54.8") )); then + if (( $(bc <<<"${BATTV} > 58") )); then + BATTA_disp="${idsCL[Green]}${BATTA}'amps - Bulk Charging" + else + BATTA_disp="${idsCL[Green]}${BATTA}'amps - Float Charging" + fi + elif [ "${BATTA}" == "-0.1"]; then + BATTA_disp="${idsCL[LightRed]}${BATTA}'amps - Standby" + else + BATTA_disp="${idsCL[LightRed]}${BATTA}'amps - Discharging" + fi fi echo -e "${idsCL[White]}Inverter Input Volts ${idsCL[Default]}: ${idsCL[Green]}${INPUTV}'volts"