Thank you very much Suncrestreef! Much appreciates. Yes, my outlet already has a bunch of programming. In fact, I will post it below and if you spot some errors please shout.
One question: why can’t I simply right the temp lines into the UV outlet? And also, what will the Apex assume when the temp is hogher than 25,5 but lower than 26? (I fuess those were two questions after all ).
Many thanks
It's a bit difficult to explain. The Apex evaluates the code from top to bottom, and the last line that's True will set the output on or off. When you have multiple conditions that are True, the last one in the list that's True will win. In your current code, the Set ON statement at the top is always True (it's not a decision to evaluate, it's a statement), so unless something below that line is True, the UV will always be on.
But let's walk through the scenario from your original question: You want it to turn off when the temperature is over 26C, and remain off until it drops below 25.5. The Set ON command turns on the UV, and when your temperature exceeds 26.0 it turns off. But the moment the temperature drops to 26.0 the Set ON command will turn it back on because that condition is no longer True, so the Set ON wins.
By moving the temperature evaluation to a separate output, you can maintain a range from 26.0 down to 25.5. In this scenario, the Set ON turns on the UV. When the temperature exceeds 26.0, the virtual output turn on, and then the "If Output High_Temp = ON" is True, so that turns off the UV. The virtual output will remain on until the temperature drops below 25.5, then the virtual output turns off. So now the UV's Set ON command will turn the UV back on, but not until the temperature drops to 25.5.
Another side effect from this logic is that your Feed modes, Maintenance output, and return pump output that turn off the UV will not be able to override the High_Temp output to inadvertently turn the UV back on when any of them have turned off the UV. If the temperature still hasn't dropped below 25.5, the UV will remain off even after the Feed mode is complete.
To answer your second question about what happens when the temperature is higher than 25.5 but lower than 26.0. This will depend on the current state of the High_Temp output. Once the temperature exceeds 26.0 and turns on the High_Temp output, the UV will remain off as the temperature cools down to 25.5. But once the High_Temp output turns off because of that temperature reduction, it will remain off as the temperature build back up towards 26.0 so the UV will be on. I hope that makes sense.
Here's what I recommend you change in your coding:
[UV]
Fallback OFF
Set ON
If Time 11:00 to 12:00 Then OFF
If FeedA 000 Then OFF
If FeedB 000 Then OFF
If Output Maintenance = ON Then OFF
If Output ReturnPu_2_3 = OFF Then OFF
If Output High_Temp = ON Then OFF
[High_Temp]
If Tmp > 26.0 Then ON
If Tmp < 25.5 Then OFF
I'm not sure why you had the Min Time 010:00 Then OFF and don't really see a reason for it, so I removed that line.