Hi everyone, these days I have been working on automating cooling fans based on the CPU temperature of the RPI4.
I created this automation which based on a certain temperature that I set with input_text as the minimum and maximum value increases or decreases the fan speed.
This is one of the automations:
It all works only that by doing tests I realized that many times the CPU temperature exceeds the set parameters for a few seconds and the speed changes very often.
My goal is that if the minimum and maximum CPU temperature
From what you’ve said you’d like to control the speed but the code you’ve shown doesn’t seem to do that.
You need to clarify in your own head what you see happening and what you think the response should be.
I’d go with a set temperature and bands.
I’d test every 2mins (set for 1min during setup)
If at set temp and within band 1, leave speed alone
If outside band 1 inc/dec speed by 3/255 (tweak this as you experiment)
That ‘should’ be sufficient as the thermal lag and inertia are things you need to relax into. But you ‘could’ introduce another band with inc/dec of (say) 6/255
to control the fans that cool the RPI I used a Shelly RGBW2 based on the dimmer value the 12v fans run faster or slower and this is the code that start them:
if the CPU of the RPI marks 50 degrees and the temperature range is set between a minimum value of 40 degrees and a maximum of 60 degrees then the fans start in slow mode
if the CPU of the RPI marks 70 degrees and the temperature range is set between the minimum value 61 degrees and the maximum 80 degrees then the fans start in fast mode
Okay but you just want the result of this to be true or false (representing fast or slow) ?
So which way round is it ? And write the logic with just the one limit