From 7c6887eaaf812b63bab6c5e134f80a2ef36aeb31 Mon Sep 17 00:00:00 2001 From: fishsoupisgood Date: Tue, 12 Jan 2021 16:58:31 +0000 Subject: works --- boiler-monster/mr3020/usr/bin/thermostat | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'boiler-monster/mr3020/usr') diff --git a/boiler-monster/mr3020/usr/bin/thermostat b/boiler-monster/mr3020/usr/bin/thermostat index 1689964..af99a4a 100755 --- a/boiler-monster/mr3020/usr/bin/thermostat +++ b/boiler-monster/mr3020/usr/bin/thermostat @@ -1,10 +1,12 @@ #!/bin/sh -LOCK=/var/lock/LCK..ttyATH0 +LOCK=/var/lock/LCK..ttyATH0.stm32 M=10.32.139.1 WATERS=0 -MAX=70 +MAX=65 + +OUTSIDE="$(mosquitto_sub -t tele/weather/tempc -h ${M} -W 1 -C 1 | sed -e 's/\..*$//g') " # conventions # POWER is power to valve coil @@ -30,13 +32,15 @@ done #... others where we care about the delta -for i in kstudy_radiator bedroom_radiator spare_bedroom_radiator dd_radiator1 dd_radiator2 dd_radiator3 hall_radiator kitchen_radiator music_room_radiator; do +for i in kstudy_radiator bedroom_radiator spare_bedroom_radiator dd_radiator1 dd_radiator2 dd_radiator3 hall_radiator kitchen_radiator music_room_radiator 2fl_stair_radiator 2fl_main_radiator; do O="$(mosquitto_sub -t stat/$i/OPEN -h ${M} -W 1 -C 1)" - D="$(mosquitto_sub -t stat/$i/DELTA -h ${M} -W 1 -C 1 | sed -e 's/\..*$//g') " + T="$(mosquitto_sub -t stat/$i/TEMPERATURE -h ${M} -W 1 -C 1 | sed -e 's/\..*$//g') " + + D="$(expr $T - $OUTSIDE)" W=0 if [ "$O" == "1" ]; then - W=$[ $D * 3 + 40] + W="$( expr \( \( \( $D * 2 \) / 3 \) + 55 \) )" fi logger -t thermostat " $i O=$O D=$D W=$W" -- cgit v1.2.3