reef-pi :: An opensource reef tank controller based on Raspberry Pi.

OP
Ranjib

Ranjib

7500 Club Member
Review score
+0 /0 /-0
View Badges
Joined
Apr 16, 2016
Messages
9,191
Reaction score
15,875
Review score
+0 /0 /-0
Location
Pleasant Hill, Concord
Hey buddy, pal,

Due to some negligent actions on my part I can't access the gui. I need to reset reef-pi to factory settings without access to it. Is there a file location for the settings I can delete/edit? Or a command line way to reset it? Specifically I changed the adress on the configuration page, after that I can no longer access the gui.
answered on the other thread https://www.reef2reef.com/threads/reef-pi-5-0-release-announcement.874824/page-3#post-9764461
 
REEFTIDE
OP
Ranjib

Ranjib

7500 Club Member
Review score
+0 /0 /-0
View Badges
Joined
Apr 16, 2016
Messages
9,191
Reaction score
15,875
Review score
+0 /0 /-0
Location
Pleasant Hill, Concord
I've posted my flow in another post above. Basically I use the reef-pi as datasource through MQTT. Once MQTT topic is published (in Ree-Pi's case everything is one big clump of data and its not segregated under a specific topic say reef-pi-01 then I can pick this data up from MQTT and do anything I want. no dependency on internals of reef-pi. This method allows data collection from any device that published MQTT and then I can use most optimal platform to do post processing.

Here is an example of how MQTT reef-pi data looks in comparison to other MQTT providers

mqtt JPG.JPG
this has been fixed in main branch, will be out in next release. thank you for the detailed report, it helps a lot.
 
OP
Ranjib

Ranjib

7500 Club Member
Review score
+0 /0 /-0
View Badges
Joined
Apr 16, 2016
Messages
9,191
Reaction score
15,875
Review score
+0 /0 /-0
Location
Pleasant Hill, Concord
i was thinking about attending aquashella, but now with omicron rise, I don't know how I feel about it. There will be a lot of folks :-/ . Any of you are attending the event? orlando covid cases are on the rise.
Screen Shot 2022-01-08 at 10.47.00 AM.png


but I so want to be there :-( . may be I'll wait out another two weeks before making a call.
 

theatrus

Valuable Member
Review score
+0 /0 /-0
View Badges
Joined
Mar 26, 2016
Messages
1,467
Reaction score
2,762
Review score
+0 /0 /-0
Location
Sacramento, CA area
i was thinking about attending aquashella, but now with omicron rise, I don't know how I feel about it. There will be a lot of folks :-/ . Any of you are attending the event? orlando covid cases are on the rise.
Screen Shot 2022-01-08 at 10.47.00 AM.png


but I so want to be there :-( . may be I'll wait out another two weeks before making a call.

Personally, not for any of January, and indoors only with (KF95|KN95|N95). Will see if the current spike is so fast moving it burns its self out by Feb.
 

GaryE

Well-Known Member
Review score
+0 /0 /-0
View Badges
Joined
Mar 12, 2020
Messages
888
Reaction score
1,225
Review score
+0 /0 /-0
Location
Coatesville, Indiana
a quick update. I was trying to do this all in the arduino, but it seems it's really not up to the task of slurping in all of the metrics, parsing for the right data and then spitting out the right bit.. So... I decided to write a python script to do that part and output to a file, then will have the arduino connect and FTP the files to get the data and then display it. Should be way easier on the ardiuno side that way. Then it's a matter of finding a case and figuring out how I want to power it long term.. Fun stuff!!

On the positive side, this will make the gadget portable. Will not be tied to the tank. Just will need to plug it in somewhere and instant stats!

so far, this is the python code.


import requests

URL = "http://10.167.15.10/x/metrics"
tankTemp = "tank_temp_reading"
sumpTemp = "sump_temp_reading"
boxTemp = "box_temp_reading"

..... yadda yadda...
so, since this post I have mostly finished.. There are a few small changes I want to make, but until I find a good way to do them, this will do... (keep in mind, I'm neither a python, nor a C++ programmer, try not to point and laugh too much)

I was planning to use FTP to connect and get the file data, but HTTP was way easier. I was able to setup nginx in with autoindex on and set to JSON format, so it was a simple matter of using ArduionJSON to get the file names from the webserver and then use that list to pull the data from them. I'm sure if you know a little C/C++ you'll see what I'm doing there in the code and shake your head in amazement that it even does anything but cause a buffer over run and crash the Arduino.. It doesn't.. It happily churns out digits to me like I intended..


Python code:

Code:
# add metrics from the reefpi/x/metrics end point
# here that you'd like to display on your
# Arduino or whatever else may be reading these files


metrics = {
    "tankTemp": "tank_temp_reading",
    "sumpTemp": "sump_temp_reading",
    "boxTemp": "internal_box_temp_reading",
    "boxFan": "equipment_fan_state",
    "heater1state": "equipment_tank_1_heater_1_state",
    "heater2state": "equipment_tank_1_heater_2_state"
}

# retrieve the metrics from the server and save them to a variable.

from urllib.request import urlopen

response = urlopen('http://10.167.15.10/x/metrics')
html = response.read()
html = html.decode()
serverMetrics = html.split('\n')  # split everything into lines.


# function to remove the metric
# name from the line found in getTemp()


def listToString(s):
    # initialize an empty string
    string = " "
    # return string
    return string.join(s)


# while looping through the metrics dictionary,
# get the metric value from


def getMetric(t, m):
    for line in m:
        if not line.startswith(t):
            # remove commented lines from metrics to reduce size in memory
            pass
        else:
            text = line.split(' ')  # split everything into lines.
            text.pop(0)
            tempMetric = (listToString(text))  # strip the metric name
            return tempMetric


# loop the dictionary to get the values of the temp readings
for key, value in metrics.items():
    met = (getMetric(value, serverMetrics))  # get the values
    if met is None:
        metric = str("0")  # display error if a sensor fails
    else:  # all data should be good, so let's write some files...
        f = open("html/" + value + ".txt", "w")
        f.write(met)
        f.close()

Arduino code:

Code:
/**
 * BasicHTTPClient.ino
 *
 *  Created on: 24.05.2015
 *
 */

#include <Arduino.h>
#include <ArduinoJson.h>
#include <StreamUtils.h>
#include <WiFi.h>
#include <WiFiMulti.h>

#include <HTTPClient.h>

#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>

WiFiMulti wifiMulti;
HTTPClient http;

#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 64 // OLED display height, in pixels
#define OLED_RESET     -1
#define SCREEN_ADDRESS 0x3C ///< See datasheet for Address; 0x3D for 128x64, 0x3C for 128x32

Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
String url = "http://IPADDRESS:81/";

float getMetric (String name) {
  float met;
  String website = url + name;
  http.begin(website); //HTTP
  http.GET();
  String metric = http.getString();
  met = metric.toFloat();
  return met;
}

void setup() {
//    Serial.begin(9600);

  // SSD1306_SWITCHCAPVCC = generate display voltage from 3.3V internally
 display.begin(SSD1306_SWITCHCAPVCC, SCREEN_ADDRESS);
 display.clearDisplay();
 display.setTextSize(1);
 display.setTextColor(WHITE);
 delay(2000);
 display.clearDisplay();
 display.setCursor(0,0);
 display.println("Metrics Display \nSystem starting...");
 display.display();

 /*
    for(uint8_t t = 4; t > 0; t--) {
        Serial.printf("[SETUP] WAIT %d...\n", t);
        Serial.flush();
        delay(500);
    }
*/
    wifiMulti.addAP("SSID", "PASS");
}

void loop() {
    display.clearDisplay();
    display.setTextColor(WHITE);
    // wait for WiFi connection
    if((wifiMulti.run() == WL_CONNECTED)) {

//        Serial.print("[HTTP] begin...\n");
        http.useHTTP10(true);
        http.begin(url); //HTTP

//        Serial.print("[HTTP] GET...\n");
        // start connection and send HTTP header
        int httpCode = http.GET();

        // httpCode will be negative on error
        if(httpCode > 0) {
            // HTTP header has been send and Server response header has been handled
//            Serial.printf("[HTTP] GET... code: %d\n", httpCode);

            // file found at server
            if(httpCode == HTTP_CODE_OK) {
              
                DynamicJsonDocument doc(4096);
                deserializeJson(doc, http.getString());
                display.clearDisplay();
                display.setCursor(0, 0);
                for (JsonObject item : doc.as<JsonArray>()) {

                    String name = item["name"];
//                    Serial.println(getMetric(name));
       
                      if (name == "tank_temp_reading.txt"){
                       display.print("Tank Temp: ");
                      }
                      else if (name == "sump_temp_reading.txt") {
                       display.print("Sump Temp: ");                  
                      }
                      else if (name == "internal_box_temp_reading.txt") {
                       display.print("Box Temp: ");                  
                      }
                      else if (name == "equipment_tank_1_heater_1_state.txt") {
                       display.print("Tank Heater: ");                 
                      }
                      else if (name == "equipment_tank_1_heater_2_state.txt") {
                       display.print("Sump Heater: ");                 
                      }
                      else if (name == "equipment_fan_state.txt") {
                       display.print("Fan : ");                 
                      }

                    display.println(getMetric(name));
                    display.display();
                  
                }     

            }
        } else {
//            Serial.printf("[HTTP] GET... failed, error: %s\n", http.errorToString(httpCode).c_str());
            display.clearDisplay();
            display.setCursor(0, 0);
            display.printf("[HTTP] GET... failed, error: %s\n", http.errorToString(httpCode).c_str());
            display.display();
        }

        http.end();
    }

    delay(10000);
}
 
Last edited:
Fritz

Tom Bishop

Well-Known Member
Review score
+0 /0 /-0
View Badges
Joined
Jan 1, 2019
Messages
688
Reaction score
1,142
Review score
+0 /0 /-0
Location
Missouri
Hey buddy, pal,

Due to some negligent actions on my part I can't access the gui. I need to reset reef-pi to factory settings without access to it. Is there a file location for the settings I can delete/edit? Or a command line way to reset it? Specifically I changed the adress on the configuration page, after that I can no longer access the gui.
Remove the database file should get you sorted, this is a good page that has troubleshooting tips - https://reef-pi.github.io/guides/troubleshooting/

Eh I see @Ranjib gave you a much better answer ignore my answer, although that troubleshooting page is a good resource. :)
 
Last edited:

Tom Bishop

Well-Known Member
Review score
+0 /0 /-0
View Badges
Joined
Jan 1, 2019
Messages
688
Reaction score
1,142
Review score
+0 /0 /-0
Location
Missouri
i was thinking about attending aquashella, but now with omicron rise, I don't know how I feel about it. There will be a lot of folks :-/ . Any of you are attending the event? orlando covid cases are on the rise.
Screen Shot 2022-01-08 at 10.47.00 AM.png


but I so want to be there :-( . may be I'll wait out another two weeks before making a call.
They say they think Florida will peak next couple of weeks but how fast it comes back down is anyones guess. They think it will be a quick decline but they also said a lot of things that proved to be inaccurate. My gut feel is that by the end of Feb things may indeed be pretty decent in Florida since it's so bad now but what will it be like in the rest of the country is anyone's guess. Hopefully soon we can get to some state of normalcy, starting to wonder when that will be...
 
OP
Ranjib

Ranjib

7500 Club Member
Review score
+0 /0 /-0
View Badges
Joined
Apr 16, 2016
Messages
9,191
Reaction score
15,875
Review score
+0 /0 /-0
Location
Pleasant Hill, Concord
Alrighty, aquashella vendor booth reserved. In the application form I had to choose the type of vendor we are. I was torn between "charity", "club" and "brand", as type of business. I went with "brand", hopefully its not too controversial.

We've got a 10'x10' booth. The hotel is really nice, wify and son will have a blast. Disney world and sea world is right in there too. So they should be engaged....

@theatrus @robsworld78 @Schreiber I'll be carrying the older boards I have with me from each of you, that will be on display. If you want to showcase anything else, do send them in my way. I'll DM my address.

Im thinking of not setting up any wet tank, and instead just showcase all the integration (powerbars, ATO, temperature, light, doser, ph , orp, ec probes etc). There will be several interactive reef-pi UI setup for folks to try it out. We'll have some flyers and visiting cards for contacts and reference documentation. And may be a few hand built controllers (3d printed housing) for give away. There will be many luminaries of the community, from whom I learned a lot, it will be super cool to say thanks by actually gifting a reef-pi unit . Ideas?
 

Tom Bishop

Well-Known Member
Review score
+0 /0 /-0
View Badges
Joined
Jan 1, 2019
Messages
688
Reaction score
1,142
Review score
+0 /0 /-0
Location
Missouri
Alrighty, aquashella vendor booth reserved. In the application form I had to choose the type of vendor we are. I was torn between "charity", "club" and "brand", as type of business. I went with "brand", hopefully its not too controversial.

We've got a 10'x10' booth. The hotel is really nice, wify and son will have a blast. Disney world and sea world is right in there too. So they should be engaged....

@theatrus @robsworld78 @Schreiber I'll be carrying the older boards I have with me from each of you, that will be on display. If you want to showcase anything else, do send them in my way. I'll DM my address.

Im thinking of not setting up any wet tank, and instead just showcase all the integration (powerbars, ATO, temperature, light, doser, ph , orp, ec probes etc). There will be several interactive reef-pi UI setup for folks to try it out. We'll have some flyers and visiting cards for contacts and reference documentation. And may be a few hand built controllers (3d printed housing) for give away. There will be many luminaries of the community, from whom I learned a lot, it will be super cool to say thanks by actually gifting a reef-pi unit . Ideas?
You want or need something 3d printed let me know, I can do pla, petg or abs be glad to print something to give away at the show etc, just let me know. :)
 

theatrus

Valuable Member
Review score
+0 /0 /-0
View Badges
Joined
Mar 26, 2016
Messages
1,467
Reaction score
2,762
Review score
+0 /0 /-0
Location
Sacramento, CA area
Alrighty, aquashella vendor booth reserved. In the application form I had to choose the type of vendor we are. I was torn between "charity", "club" and "brand", as type of business. I went with "brand", hopefully its not too controversial.

We've got a 10'x10' booth. The hotel is really nice, wify and son will have a blast. Disney world and sea world is right in there too. So they should be engaged....

@theatrus @robsworld78 @Schreiber I'll be carrying the older boards I have with me from each of you, that will be on display. If you want to showcase anything else, do send them in my way. I'll DM my address.

Im thinking of not setting up any wet tank, and instead just showcase all the integration (powerbars, ATO, temperature, light, doser, ph , orp, ec probes etc). There will be several interactive reef-pi UI setup for folks to try it out. We'll have some flyers and visiting cards for contacts and reference documentation. And may be a few hand built controllers (3d printed housing) for give away. There will be many luminaries of the community, from whom I learned a lot, it will be super cool to say thanks by actually gifting a reef-pi unit . Ideas?

Not going wet sounds like a major hassle win.

I'll reach out and get some prototypes and such to you, and a few gift cards/etc for raffling off :)
 
REEFTIDE
OP
Ranjib

Ranjib

7500 Club Member
Review score
+0 /0 /-0
View Badges
Joined
Apr 16, 2016
Messages
9,191
Reaction score
15,875
Review score
+0 /0 /-0
Location
Pleasant Hill, Concord
You want or need something 3d printed let me know, I can do pla, petg or abs be glad to print something to give away at the show etc, just let me know. :)
i just setup my ender 3 v2. after 4 years of rigorous service, it was time for some upgrades. I don't do PETG though, only PLA.

Anything you have spare , you think can be useful for the community , feel free to send my way. It will be awesome to show and share things made by the community members. Im planning to print a bunch of housing, hs300 brackets, float switch holders etc.
 

Tom Bishop

Well-Known Member
Review score
+0 /0 /-0
View Badges
Joined
Jan 1, 2019
Messages
688
Reaction score
1,142
Review score
+0 /0 /-0
Location
Missouri
i just setup my ender 3 v2. after 4 years of rigorous service, it was time for some upgrades. I don't do PETG though, only PLA.

Anything you have spare , you think can be useful for the community , feel free to send my way. It will be awesome to show and share things made by the community members. Im planning to print a bunch of housing, hs300 brackets, float switch holders etc.
PLA hold up in saltwater decent? Most folks I read do petg for in tank stuff, I have a heavily modified ender v2 clone, all metal hotend blah blah, but it's pretty dialed in and I can print pretty much whatever I need. Just offering to help if it will help the cause. :)
 
OP
Ranjib

Ranjib

7500 Club Member
Review score
+0 /0 /-0
View Badges
Joined
Apr 16, 2016
Messages
9,191
Reaction score
15,875
Review score
+0 /0 /-0
Location
Pleasant Hill, Concord
PLA hold up in saltwater decent? Most folks I read do petg for in tank stuff, I have a heavily modified ender v2 clone, all metal hotend blah blah, but it's pretty dialed in and I can print pretty much whatever I need. Just offering to help if it will help the cause. :)
they dont, they warp. But the components I use, like hs300 power strip bracket, controller housing, float switch holder etc, do not touch saltwater. And I have been using them for years now without issue. For filter etc, that goes inside the water I have started using plexiglass/acrylic. They are relatively easy to fabricate
 

Adahm

Community Member
Review score
+0 /0 /-0
View Badges
Joined
Jan 25, 2017
Messages
33
Reaction score
24
Review score
+0 /0 /-0
Hi all, I recently set up reef-pi using Robo-Tank. I am still learning to set up automation using macros and timers. I have set up some macros to run when I want to turn off and on my return pump and for feed mode.

Macro 1 - Return pump OFF, turns off ATO sensor (timer and sensor), then turn off skimmer (timer & equipment), and then the return pump (timer & equipment) - this is to prevent skimmer overflow as the water level in sump rises when return is off.

Macro 2 - Return pump ON, turn on return pump (timer), wait 300 seconds and turn on Skimmer (timer), wait 900 seconds for return chamber water level to stabilize, turn on ATO sensor timer.

Macro 3 - Feed Mode is a combination of the two above with a 15 minute wait period

Basically, my need is driven by the time it takes my full siphon to develop (almost 3 minutes). During this time the return pump chamber level drops to the point that the return pump is sucking air I prevent this by using a float switch cutoff (using feature on Robo-Tank board). After the full siphon starts, it takes about 10 minutes for the water level to stabilize. I don't want to increase the water level in the return chamber to prevent the main tank from overflowing.

All of the above is fine and good so long as the tank was running steady state. Now I am wondering how to **edited** **make** the ATO and skimmer have a delayed start in the event of a power outage and reboot.

I have left the skimmer in the equipment module to stay off on boot however, the timer will turn it on as it is set to turn on and stay on. I can remove the timer but that doesn't help. The same goes for the ATO sensor.

I thought about adding a timer to run a macro 2 however I can't get my head around how to implement this.

Is there a way to add delay for the above (equipment & ATO sensor) on boot or trigger a macro based on equipment state change?
 
Last edited:
REEFTIDE

robsworld78

Well-Known Member
Review score
+0 /0 /-0
View Badges
Joined
Feb 14, 2020
Messages
627
Reaction score
843
Review score
+0 /0 /-0
Location
Edmonton, Canada
Alrighty, aquashella vendor booth reserved. In the application form I had to choose the type of vendor we are. I was torn between "charity", "club" and "brand", as type of business. I went with "brand", hopefully its not too controversial.

We've got a 10'x10' booth. The hotel is really nice, wify and son will have a blast. Disney world and sea world is right in there too. So they should be engaged....

@theatrus @robsworld78 @Schreiber I'll be carrying the older boards I have with me from each of you, that will be on display. If you want to showcase anything else, do send them in my way. I'll DM my address.

Im thinking of not setting up any wet tank, and instead just showcase all the integration (powerbars, ATO, temperature, light, doser, ph , orp, ec probes etc). There will be several interactive reef-pi UI setup for folks to try it out. We'll have some flyers and visiting cards for contacts and reference documentation. And may be a few hand built controllers (3d printed housing) for give away. There will be many luminaries of the community, from whom I learned a lot, it will be super cool to say thanks by actually gifting a reef-pi unit . Ideas?
Sounds like a good plan, I'm sure you and your family will have a blast. :)

I can send a fully assembled package with everything needed to get running minus the Raspberry Pi for a giveaway, value around $240. I also have a variety of basic extensions that can be used with or without the controller by connecting directly to Pi GPIOs maybe good for people getting their feet wet.
 
OP
Ranjib

Ranjib

7500 Club Member
Review score
+0 /0 /-0
View Badges
Joined
Apr 16, 2016
Messages
9,191
Reaction score
15,875
Review score
+0 /0 /-0
Location
Pleasant Hill, Concord
Sounds like a good plan, I'm sure you and your family will have a blast. :)

I can send a fully assembled package with everything needed to get running minus the Raspberry Pi for a giveaway, value around $240. I also have a variety of basic extensions that can be used with or without the controller by connecting directly to Pi GPIOs maybe good for people getting their feet wet.
awesome :cool:
 
OP
Ranjib

Ranjib

7500 Club Member
Review score
+0 /0 /-0
View Badges
Joined
Apr 16, 2016
Messages
9,191
Reaction score
15,875
Review score
+0 /0 /-0
Location
Pleasant Hill, Concord
Sounds like a good plan, I'm sure you and your family will have a blast. :)

I can send a fully assembled package with everything needed to get running minus the Raspberry Pi for a giveaway, value around $240. I also have a variety of basic extensions that can be used with or without the controller by connecting directly to Pi GPIOs maybe good for people getting their feet wet.
awesome :cool:
Hi all, I recently set up reef-pi using Robo-Tank. I am still learning to set up automation using macros and timers. I have set up some macros to run when I want to turn off and on my return pump and for feed mode.

Macro 1 - Return pump OFF, turns off ATO sensor (timer and sensor), then turn off skimmer (timer & equipment), and then the return pump (timer & equipment) - this is to prevent skimmer overflow as the water level in sump rises when return is off.

Macro 2 - Return pump ON, turn on return pump (timer), wait 300 seconds and turn on Skimmer (timer), wait 900 seconds for return chamber water level to stabilize, turn on ATO sensor timer.

Macro 3 - Feed Mode is a combination of the two above with a 15 minute wait period

Basically, my need is driven by the time it takes my full siphon to develop (almost 3 minutes). During this time the return pump chamber level drops to the point that the return pump is sucking air I prevent this by using a float switch cutoff (using feature on Robo-Tank board). After the full siphon starts, it takes about 10 minutes for the water level to stabilize. I don't want to increase the water level in the return chamber to prevent the main tank from overflowing.

All of the above is fine and good so long as the tank was running steady state. Now I am wondering how to prevent the ATO and skimmer to have a delayed start in the event of a power outage and reboot.

I have left the skimmer in the equipment module to stay off on boot however, the timer will turn it on as it is set to turn on and stay on. I can remove the timer but that doesn't help. The same goes for the ATO sensor.

I thought about adding a timer to run a macro 2 however I can't get my head around how to implement this.

Is there a way to add delay for the above (equipment & ATO sensor) on boot or trigger a macro based on equipment state change?
I have something very similar,
Screen Shot 2022-01-09 at 11.54.29 PM.png

but i have not been reliably automate this due to number of physical uncertainties I encountered. Its almost always starts with tripping emergency overflow resulting in high usage of ATO before that and often time skimmer overdrive at the same time (i think due to water level). While this has prevented me from fully automated water chores as of now. I did find the macros useful during manual water changes or anything that requires the return pump to be off. ATO and skimmer have to be synchronized in certain ways.
Looking forward I think its safer to automate these things based on some check/trigger than wait times.
I still don't have a good answer for reliability during the failure scenarios, like power outages during macro execution etc. And will not recommend anything unless user has tested it out end to end during the build.
 

Tom Bishop

Well-Known Member
Review score
+0 /0 /-0
View Badges
Joined
Jan 1, 2019
Messages
688
Reaction score
1,142
Review score
+0 /0 /-0
Location
Missouri
awesome :cool:

I have something very similar,
Screen Shot 2022-01-09 at 11.54.29 PM.png

but i have not been reliably automate this due to number of physical uncertainties I encountered. Its almost always starts with tripping emergency overflow resulting in high usage of ATO before that and often time skimmer overdrive at the same time (i think due to water level). While this has prevented me from fully automated water chores as of now. I did find the macros useful during manual water changes or anything that requires the return pump to be off. ATO and skimmer have to be synchronized in certain ways.
Looking forward I think its safer to automate these things based on some check/trigger than wait times.
I still don't have a good answer for reliability during the failure scenarios, like power outages during macro execution etc. And will not recommend anything unless user has tested it out end to end during the build.
@Adahm

I have the same type of macros that I use when cleaning the tank and they work well with wait times before having certain equipment kick on. I have thought about this for sometime in regards to timers and power outages, for the timers I have additional timers that just keep turning things off when outside of the range I want it on, that way dosers don't come back on dosing etc. But for ATO and skimmer there are not many options. On option that you can do right now is to dial in your ATO and if it pumps outside of the expected range it gets turned off. So in the case of a power outage it comes back on starts pumping but hits 30s and then gets shut off. The one problem with that configuration at least in 4.x (I have not kicked the tires with 5.x to know if they have additional options) is you will have to manually enable it, the other issue is you could have nuisances turn offs if you tune it to low. I like that option if I had a way to automatically set a timer for it to re-enable, say try again in 5min or some configurable option. The flow would be ATO kicks off over a high value gets shut off, timer hold starts to run for set time, once timer expires it re-enables the ATO and it runs, if under run time value it continues to operate etc.

The other option that is not available through the gui but may be available via API ( I have not looked) would be some kind of a cron job that continually runs and looks at the uptime of the system, or if the rpi is on UPS looks for the uptime of some reliable network device to signify power outage. Based on that event you could disable the equipment that you want and re-enable after a period of time. Not sure if you have control via API for individual equipment via API and would require scripting outside of reefpi.

Something else that I just thought of and may be possible today would be to monitor the energy usage of the retyurn pump if it is on a Kasa strip. If the device is on a kasa strip you could use power monitoring to trigger a macro etc that would put those devices in timeout. I am just thinking of this so would need testing etc, but if you have the RPI on an UPS it will see the drop in energy for the return pump and you could trigger something based on the lower and upper values. I will think about that one some more since it may be the most viable option right now if you are running Kasa strips and your return pump is on one. You use the PH function for the energy monitoring portion.

Here is the screen shot of my return pump usage, each dip shows when power was lost doing a water change.

return-pump.png


Some things to think about, I agree though would be nice to have something for when your not around for power outages.
 
Last edited:

Adahm

Community Member
Review score
+0 /0 /-0
View Badges
Joined
Jan 25, 2017
Messages
33
Reaction score
24
Review score
+0 /0 /-0
awesome :cool:

I have something very similar,
Screen Shot 2022-01-09 at 11.54.29 PM.png

but i have not been reliably automate this due to number of physical uncertainties I encountered. Its almost always starts with tripping emergency overflow resulting in high usage of ATO before that and often time skimmer overdrive at the same time (i think due to water level). While this has prevented me from fully automated water chores as of now. I did find the macros useful during manual water changes or anything that requires the return pump to be off. ATO and skimmer have to be synchronized in certain ways.
Looking forward I think its safer to automate these things based on some check/trigger than wait times.
I still don't have a good answer for reliability during the failure scenarios, like power outages during macro execution etc. And will not recommend anything unless user has tested it out end to end during the build.
Thanks @Ranjib , Something I tried and surprisingly was able to add my return pump outlet as an inlet, then I was able to add it to the ATO sensor module as a sensor to try and trigger a macro. This was really late at night, but I recall I did not get the desired result. I will explore this further.

As a suggestion, for the Dashboard within the equipment panel, it would be awesome to have the timer associated with the equipment as a drop-down below the equipment or make on/off button into OFF/TIMER/ON three-way button, where the equipment could be left on the timer and the associated timers automatically turned off when the switch is in the OFF or ON position.

Also would be nice to have a macro panel on the dashboard?

@Adahm

I have the same type of macros that I use when cleaning the tank and they work well with wait times before having certain equipment kick on. I have thought about this for sometime in regards to timers and power outages, for the timers I have additional timers that just keep turning things off when outside of the range I want it on, that way dosers don't come back on dosing etc. But for ATO and skimmer there are not many options. On option that you can do right now is to dial in your ATO and if it pumps outside of the expected range it gets turned off. So in the case of a power outage it comes back on starts pumping but hits 30s and then gets shut off. The one problem with that configuration at least in 4.x (I have not kicked the tires with 5.x to know if they have additional options) is you will have to manually enable it, the other issue is you could have nuisances turn offs if you tune it to low. I like that option if I had a way to automatically set a timer for it to re-enable, say try again in 5min or some configurable option. The flow would be ATO kicks off over a high value gets shut off, timer hold starts to run for set time, once timer expires it re-enables the ATO and it runs, if under run time value it continues to operate etc.

The other option that is not available through the gui but may be available via API ( I have not looked) would be some kind of a cron job that continually runs and looks at the uptime of the system, or if the rpi is on UPS looks for the uptime of some reliable network device to signify power outage. Based on that event you could disable the equipment that you want and re-enable after a period of time. Not sure if you have control via API for individual equipment via API and would require scripting outside of reefpi.

Something else that I just thought of and may be possible today would be to monitor the energy usage of the retyurn pump if it is on a Kasa strip. If the device is on a kasa strip you could use power monitoring to trigger a macro etc that would put those devices in timeout. I am just thinking of this so would need testing etc, but if you have the RPI on an UPS it will see the drop in energy for the return pump and you could trigger something based on the lower and upper values. I will think about that one some more since it may be the most viable option right now if you are running Kasa strips and your return pump is on one. You use the PH function for the energy monitoring portion.

Here is the screen shot of my return pump usage, each dip shows when power was lost doing a water change.

return-pump.png


Some things to think about, I agree though would be nice to have something for when your not around for power outages.
Thanks @Tom Bishop I am on 4.1 and also using the ATO sensor time limit and set it up to send me an alert. I have had instances of forgetting to turn it on though.

The rest API is well over my head, I am not as intimate with coding/scripting.

I didn't the Kasa strips/outlets route, I ended up getting the Robo-Tank power bar as I wanted local control and not rely on the cloud. I only have zigbee outlets lying around none are wifi ...
 
Tidal Gardens January 29th YouTube Live Show

Have you ever torn down a tank over an issue you couldn't seem to beat?

  • Yes! I have. (Tell us about what issue you faced in the thread.)

    Votes: 175 24.2%
  • No. Thankfully, I haven't.

    Votes: 373 51.6%
  • Nope, but it almost happened. (Share your experience in the thread.)

    Votes: 53 7.3%
  • Not yet, but I'm almost there. (Tell us what you're dealing with.)

    Votes: 61 8.4%
  • If you reef long enough, this will eventually happen to you.

    Votes: 47 6.5%
  • Other

    Votes: 14 1.9%
SA
Top