diff options
author | fishsoupisgood <github@madingley.org> | 2021-01-12 16:58:31 +0000 |
---|---|---|
committer | fishsoupisgood <github@madingley.org> | 2021-01-12 16:58:31 +0000 |
commit | 7c6887eaaf812b63bab6c5e134f80a2ef36aeb31 (patch) | |
tree | 4b4b0d371107ae1b8540ca1618cb9aa796b72616 /boiler-monster/mr3020/usr | |
parent | f4b573fe337a436d5e2b20be4be031d77376d609 (diff) | |
download | heating-7c6887eaaf812b63bab6c5e134f80a2ef36aeb31.tar.gz heating-7c6887eaaf812b63bab6c5e134f80a2ef36aeb31.tar.bz2 heating-7c6887eaaf812b63bab6c5e134f80a2ef36aeb31.zip |
works
Diffstat (limited to 'boiler-monster/mr3020/usr')
-rwxr-xr-x | boiler-monster/mr3020/usr/bin/thermostat | 14 |
1 files changed, 9 insertions, 5 deletions
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" |