102 lines
2.5 KiB
Plaintext
102 lines
2.5 KiB
Plaintext
on checkLowDemand then
|
|
if (@Main_Outlet_Temp - @Main_Target_Temp) >= 2 && @ThreeWay_Valve_State == 0 && @Defrosting_State == 0 && @Heat_Power_Production > 0 && @Compressor_Freq >= 19 then
|
|
#lowDemand = (coalesce(#lowDemand, 0) + 1);
|
|
else
|
|
#lowDemand = 0;
|
|
end
|
|
end
|
|
on maybeStartLowDemandTimer then
|
|
if coalesce(#lowDemand, 0) == 0 then
|
|
checkLowDemand();
|
|
if #lowDemand == 1 then
|
|
setTimer(2, 10);
|
|
end
|
|
end
|
|
end
|
|
on @Main_Outlet_Temp then
|
|
maybeStartLowDemandTimer();
|
|
end
|
|
on @Main_Target_Temp then
|
|
maybeStartLowDemandTimer();
|
|
end
|
|
on timer=2 then
|
|
checkLowDemand();
|
|
if #lowDemand > 0 then
|
|
if #lowDemand > 11 then
|
|
@SetZ1HeatRequestTemperature = @Z1_Heat_Request_Temp + 1;
|
|
#lowDemand = 0;
|
|
else
|
|
setTimer(2, 10);
|
|
end
|
|
end
|
|
end
|
|
on timer=6 then
|
|
maybeStartLowDemandTimer();
|
|
setTimer(6, 60);
|
|
end
|
|
|
|
on @ThreeWay_Valve_State then
|
|
if @ThreeWay_Valve_State == 1 then
|
|
setTimer(4, 30);
|
|
end
|
|
end
|
|
on timer=4 then
|
|
if @Force_DHW_State == 1 && @Operating_Mode_State == 4 then
|
|
@SetDemandControl = 254;
|
|
end
|
|
if @ThreeWay_Valve_State == 1 && @Operating_Mode_State == 4 && @DHW_Temp < (@DHW_Target_Temp - 2) then
|
|
@SetForceDHW = 1;
|
|
@SetDemandControl = 254;
|
|
end
|
|
end
|
|
|
|
on System#Boot then
|
|
setTimer(5, 60);
|
|
setTimer(6, 60);
|
|
#previousTarget = @Main_Target_Temp;
|
|
end
|
|
|
|
on timer=5 then
|
|
if @ThreeWay_Valve_State == 1 && @Compressor_Freq > 0 then
|
|
#dhwRunning = 1;
|
|
else
|
|
if coalesce(#dhwRunning, 0) == 1 && #lastOperationMode != NULL then
|
|
@SetOperationMode = #lastOperationMode;
|
|
#dhwRunning = 0;
|
|
else
|
|
#lastOperationMode = @Operating_Mode_State;
|
|
end
|
|
end
|
|
|
|
setTimer(5, 60);
|
|
end
|
|
|
|
on @Pump_Duty then
|
|
if @Pump_Duty < 10 && @Defrosting_State == 1 then
|
|
@SetDemandControl = 254;
|
|
end
|
|
end
|
|
|
|
|
|
on @Main_Target_Temp then
|
|
if coalesce(#rampDown, 0) == 0 && @Main_Target_Temp == floor(@Main_Outlet_Temp) - 2 && #previousTarget > @Main_Target_Temp then
|
|
#rampDown = 1;
|
|
end
|
|
if coalesce(#rampDown, 0) == 1 && #previousTarget < @Main_Target_Temp then
|
|
#rampDown = 0;
|
|
end
|
|
#previousTarget = @Main_Target_Temp;
|
|
end
|
|
|
|
on @Main_Outlet_Temp then
|
|
if coalesce(#rampDown, 0) == 1 && floor(@Main_Outlet_Temp) <= @Main_Target_Temp then
|
|
if @Compressor_Freq >= 19 && @Compressor_Freq < 21 && floor(@Main_Outlet_Temp) == @Main_Target_Temp then
|
|
$wait = 42;
|
|
else
|
|
if @Z1_Heat_Request_Temp <= -4 then
|
|
#rampDown = 0;
|
|
end
|
|
@SetZ1HeatRequestTemperature = @Z1_Heat_Request_Temp - 1;
|
|
end
|
|
end
|
|
end |