diff options
author | root <root@ka-ata-killa.ourano.james.local> | 2021-05-28 19:47:21 +0100 |
---|---|---|
committer | root <root@ka-ata-killa.ourano.james.local> | 2021-05-28 19:47:21 +0100 |
commit | 9b51ae6f7cd5c6e3f480d446a186a46a5bab8bfa (patch) | |
tree | 3f414fc920adffdf14c71270a7bc8e42f00fd286 /boiler-monster/mr3020/usr | |
parent | 4560c3d1250f0392ebbdde25ff72053046d72da5 (diff) | |
download | heating-9b51ae6f7cd5c6e3f480d446a186a46a5bab8bfa.tar.gz heating-9b51ae6f7cd5c6e3f480d446a186a46a5bab8bfa.tar.bz2 heating-9b51ae6f7cd5c6e3f480d446a186a46a5bab8bfa.zip |
fish
Diffstat (limited to 'boiler-monster/mr3020/usr')
-rwxr-xr-x | boiler-monster/mr3020/usr/bin/thermostat | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/boiler-monster/mr3020/usr/bin/thermostat b/boiler-monster/mr3020/usr/bin/thermostat index 91e2e7b..8fcc071 100755 --- a/boiler-monster/mr3020/usr/bin/thermostat +++ b/boiler-monster/mr3020/usr/bin/thermostat @@ -20,8 +20,20 @@ logger -t thermostat " outside is $OUTSIDE" # towel radiators +FUZZY=0 + for i in laundry_radiator bathroom_radiator; do O="$(mosquitto_sub -t stat/$i/OPEN -h ${M} -W 1 -C 1)" + P="$(mosquitto_sub -t stat/$i/POWER -h ${M} -W 1 -C 1)" + + if [ "$P" == "OFF" -a "$O" == "1" ]; then + FUZZY=1 + O=0 + fi + + if [ "$P" == "ON" -a "$O" == "0" ]; then + FUZZY=1 + fi W=0 if [ "$O" == "1" ]; then @@ -36,6 +48,18 @@ done 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)" + P="$(mosquitto_sub -t stat/$i/POWER -h ${M} -W 1 -C 1)" + + if [ "$P" == "OFF" -a "$O" == "1" ]; then + FUZZY=1 + O=0 + fi + + if [ "$P" == "ON" -a "$O" == "0" ]; then + FUZZY=1 + fi + + T="$(mosquitto_sub -t stat/$i/TEMPERATURE -h ${M} -W 1 -C 1 | sed -e 's/\..*$//g') " D="$(expr $T - $OUTSIDE)" @@ -63,7 +87,10 @@ if [ $R -gt $MAX ]; then R=$MAX fi - +if [ "$FUZZY" -eq 1 ]; then + logger -t thermostat "Fuzzy=1, stopping pump" + R=0 +fi if [ ! -f "${LOCK}" ]; then |