From 8f7d82df905424c7a13914b5e8a9a122402e792d Mon Sep 17 00:00:00 2001 From: proddy Date: Thu, 7 Jan 2021 21:17:59 +0100 Subject: [PATCH] merge in flowsensor check from dev --- src/devices/boiler.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/devices/boiler.cpp b/src/devices/boiler.cpp index 2f7e84a2e..afe736533 100644 --- a/src/devices/boiler.cpp +++ b/src/devices/boiler.cpp @@ -561,7 +561,17 @@ void Boiler::check_active(const bool force) { } // check if tap water is active, bits 1 and 4 must be set - b = ((boilerState_ & 0x0A) == 0x0A); + // also check if there is a flowsensor and flow-type + static bool flowsensor = false; + if (Helpers::hasValue(wWCurFlow_) && (wWCurFlow_ > 0) && (wWType_ == 1)) { + flowsensor = true; + } + if (flowsensor) { + b = ((wWCurFlow_ > 0) && ((boilerState_ & 0x0A) == 0x0A)); + } else { + b = ((boilerState_ & 0x0A) == 0x0A); + } + val = b ? EMS_VALUE_BOOL_ON : EMS_VALUE_BOOL_OFF; if (tapwaterActive_ != val || force) { tapwaterActive_ = val;