Update powerwall.sh

This commit is contained in:
2023-08-16 17:51:32 -05:00
parent bc7f912fdd
commit 1e6d87a65c

View File

@@ -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/ /}