diff --git a/heat_control.py b/heat_control.py index f4453a1..0d32274 100644 --- a/heat_control.py +++ b/heat_control.py @@ -161,15 +161,17 @@ def check_temperatures(): mqtt_client.publish(c.out_topic, "1", retain=True) if any_opened: + any_opened = False for c in contours: - if not c.state: - any_opened = False + if c.state: + any_opened = True else: for c in contours: if c.state: any_opened = True any_opened_start = time.time() + logger.debug("Any opened: " + str(any_opened) + " aos " + str(any_opened_start) + " time " + str(time.time())) if any_opened and time.time() - any_opened_start > BOILER_TURN_ON_AFTER: mqtt_client.publish(boiler_control, "1", retain=True) mqtt_client.publish(pump_control, "1", retain=True)