From 1e6d87a65c425c7f8d0e930b8e9a02a8efcd4ab6 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Wed, 16 Aug 2023 17:51:32 -0500 Subject: [PATCH] Update powerwall.sh --- powerwall.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/powerwall.sh b/powerwall.sh index 0302d298..7ab8c2ac 100755 --- a/powerwall.sh +++ b/powerwall.sh @@ -175,22 +175,22 @@ CHECKTEMP_SERVICE(){ for SENSOR in "${SENSORS_CHECK[@]}"; do - if [ "${PW_SENSOR_TYPE[${SENSOR}]}" == "mqtt" ]; then + if [ "${PW_SENSOR_TYPE[${SENSORa}]}" == "mqtt" ]; then mqtt_message=`${mqtt_conn} -t tele/${SENSOR}/SENSOR -C 1` echo $mqtt_message | cut -d':' -f 7 | cut -d',' -f 1 | read temp_h echo $mqtt_message | cut -d':' -f 6 | cut -d',' -f 1 | read temp_c - elif [ "${PW_SENSOR_TYPE[${SENSOR}]}" == "system" ]; then + elif [ "${PW_SENSOR_TYPE[${SENSORa}]}" == "system" ]; then temp_c=$(vcgencmd measure_temp) temp_c=${temp_c%\'*}; temp_c=${temp_c#*=} temp_h='' - elif [ "${PW_SENSOR_TYPE[${SENSOR}]}" == "remotesystem" ]; then + elif [ "${PW_SENSOR_TYPE[${SENSORa}]}" == "remotesystem" ]; then temp_c=$(ssh root@${PW_REMOTE_SENSORS[${SENSOR}]} vcgencmd measure_temp) temp_c=${temp_c%\'*}; temp_c=${temp_c#*=} temp_h='' - elif [ "${PW_SENSOR_TYPE[${SENSOR}]}" == "esxi" ]; then + elif [ "${PW_SENSOR_TYPE[${SENSORa}]}" == "esxi" ]; then temp_c=$(echo ${SENSOR} | cut -d'p' -f2 | awk '/ / {print $2}' | sed -e 's/C//g'); temp_c=${temp_c/ /} temp_warn=$(echo ${SENSOR} | cut -d'p' -f2 | awk '/ / {print $7}' | sed -e 's/C//g'); temp_warn=${temp_warn/ /} temp_crit=$(echo ${SENSOR} | cut -d'p' -f2 | awk '/ / {print $4}' | sed -e 's/C//g'); temp_crit=${temp_crit/ /}