BillieBricks: Thx for the input! Yet I think the problem I have is slightly different then your situation. You are using time to prevent the relays from burning out and I'm using temperature and humidity. For example: Let's only use the temperature for this one... I set the set point for the temperature at 25°C. So when the temperature reaches 26°C the fans will turn on. Resulting in the machine registering the temperature drop to 25°C, but actually it is 25,9°C. The fan's stop working and almost immediately the temperature registers 26°C and everything starts over again. Now with a hysteria you have a set point (25°C) and a deviation or hysteria (value the setpoint can deviate). So this would result in (assuming the set point is 25°C and the hysteria being 2°C) that the fan's turn on at 26°C and turn of at 24°C (actually 24.9°C), giving the machine a whole 1,1°C to climb before the fan's are turned on again...
I didn't think about analyzing the standard deviation and then setting that for my trigger value. I like that idea maybe that would be a better option for the point of processing and consistency. You can still apply the no delay blinking type program to your it would be slightly different you might want to apply the concept in both direction for turning on the fans and turning them off.
My question for you is How long do your fans usually run? or how long on average does it take you to low your temperature 1 degree?
Why does your program register a temperature of 24.9 as 24? Why not keep that decimal? or if you are going to round round 24.0-24.4 to 24 and 24.5-24.9 to 25?
BillieBricks: I have a question for you...How many float switches do you use in your setup? I've got two...one on the bottom and one on top. When the top one is 'LOW' the machine registers this, but doesn't do anything, other then displaying 'Tank Half Full' (we're optimistic like that ;) ) Only when the bottom one is 'LOW' the solenoid valve is turned open. This remains open until both float switches are 'HIGH' again. Meaning the nutrient tank is full...
My setup it slightly different because I have live fish in my main tank. I have 3 tanks a 20 gallon which houses my fish (2 float switches a high and a low), a 10 gallon filter tank that filters large debris and converts the nitrites to nitrates through biological filtration (2 float switched high and low), and a 10 gallon refill tank that just holds water (2 float switches a high and a low).
Every 15 minutes during the daytime i run a cycle the water from main tank is pumped to the filter tank and then pump into my grow tubes, and drains to my refill tank that is pumped to the main tank.
That is the simple version of how my system works.
something you might be interested in would be https://www.sparkfun.com/products/10221
Advice is develop some kind of fail safe