- Joined
- Apr 16, 2009
- Messages
- 50
- Reaction score
- 47
I DIY'ed a could cooling fans out of a 3d printed hinge and some computer fans. Works fine connected to my red reef pi as DC fans, but is loud.
I'd ideally like to run them at variable speed, ramping up at a baseline pressure and increasing power as temp increases. The current reef pi system doesn't seem to have any way to do that. Equipment is on/off, but I can set it up as a pwm light.
However, there's no way to do this with temperatures. Not only is there no way to adjust the temp, but there's no way to control anything besides equipment. You can try and use a macro, but macros don't seem to do anything when you tell it to turn a light on it off. Nothing changes AFAICT.
My plan is to instead just build this myself by creating a cronjob to do it outside the UI using the API. I'd like to see info in the UI about it, but I'll punt on that for V1.
First question: is anyone doing variable speed fans with reef pi?
My default guess is no, so I'd just build it.
To build it, my plan would be to create a script that just (I'm making assumptions on what APIs exist):
1. Create a secondary temperature, setup to run a macro called "VariableFanScript1", with that macro having a step to change a light. Right now that does nothing. I'll use those to effectively pass config info to my script
The script will:
1. Hit the temperature API and get all temperatures. For any temperature configured to run a macro named VariableFanScript*, I'll grab the macro and pull all lights it's configured to touch. That will give me the set of temperatures to use, their configs, and their corresponding lights
2. pull the current temperature for those, if I didn't already get it
3. Read the temperature's cooler setting as a fan min temp, and the min + hysterisis as max
4. Compare the current temp to the min/max temp and if greater than min, scale a speed setting linearly. Max 100%
5. Based on that, switch the manual setting on a "light" between 0 and 100% accordingly
Assuming those APIs are hittable, it should be straightforward. I then could reconfigure the settings in the UI, easily disable it if needed, and even see the cooler settings in the temp graphs.
Assuming this works, I'd far prefer it to trying to write all this out through clicking around in a UI.
Second question: what gotchas am I liable to hit here?
I'd ideally like to run them at variable speed, ramping up at a baseline pressure and increasing power as temp increases. The current reef pi system doesn't seem to have any way to do that. Equipment is on/off, but I can set it up as a pwm light.
However, there's no way to do this with temperatures. Not only is there no way to adjust the temp, but there's no way to control anything besides equipment. You can try and use a macro, but macros don't seem to do anything when you tell it to turn a light on it off. Nothing changes AFAICT.
My plan is to instead just build this myself by creating a cronjob to do it outside the UI using the API. I'd like to see info in the UI about it, but I'll punt on that for V1.
First question: is anyone doing variable speed fans with reef pi?
My default guess is no, so I'd just build it.
To build it, my plan would be to create a script that just (I'm making assumptions on what APIs exist):
1. Create a secondary temperature, setup to run a macro called "VariableFanScript1", with that macro having a step to change a light. Right now that does nothing. I'll use those to effectively pass config info to my script
The script will:
1. Hit the temperature API and get all temperatures. For any temperature configured to run a macro named VariableFanScript*, I'll grab the macro and pull all lights it's configured to touch. That will give me the set of temperatures to use, their configs, and their corresponding lights
2. pull the current temperature for those, if I didn't already get it
3. Read the temperature's cooler setting as a fan min temp, and the min + hysterisis as max
4. Compare the current temp to the min/max temp and if greater than min, scale a speed setting linearly. Max 100%
5. Based on that, switch the manual setting on a "light" between 0 and 100% accordingly
Assuming those APIs are hittable, it should be straightforward. I then could reconfigure the settings in the UI, easily disable it if needed, and even see the cooler settings in the temp graphs.
Assuming this works, I'd far prefer it to trying to write all this out through clicking around in a UI.
Second question: what gotchas am I liable to hit here?