Update powerwall.sh

This commit is contained in:
2022-09-03 12:19:57 -05:00
parent e9b8f1d42c
commit 2fcaaa3e80

View File

@@ -37,15 +37,13 @@ CHECKTEMP(){
CHECKTEMP_SERVICE(){
mqtt_message=`${mqtt_conn} -t tele/${1}/SENSOR -C 1`
echo $mqtt_message | cut -d':' -f 6 | cut -d',' -f 1 | read temp_c
echo $mqtt_message | cut -d'T' -f 2 | cut -d"\"" -f 3 | read temp_d
echo $mqtt_message | cut -d'T' -f 3 | cut -d"\"" -f 1 | read temp_t
while true
do
${mqtt_conn} -t tele/${1}/SENSOR | while read -r mqtt_message
do
echo $mqtt_message | cut -d':' -f 6 | cut -d',' -f 1 | read temp_c
echo $mqtt_message | cut -d'T' -f 2 | cut -d"\"" -f 3 | read temp_d
echo $mqtt_message | cut -d'T' -f 3 | cut -d"\"" -f 1 | read temp_t
if [ "$temp_c" != "null" ] && [ "$temp_c" != "" ]; then
temp_f=`echo "scale=2; $temp_c*1.8 + 32" | bc`
#echo "$temp_c -> $temp_f"