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

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
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?


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 ...
Yeah I use a combination of power strips I have one of each (although I am not using robotank I use something similar), the reason is I have some stuff on Kasa like return pump in the insatance that the RPI dies, becomes unresponsive etc. The items on the Kasa will keep trucking, then I have things on the direct control power side like heaters etc that I'd rather not have working if I do not have control of them. Understand about the scripting I am thinking about it and will see if there is an easy path, I do like the ATO reset option/timeout value. Maybe @Ranjib can comment on if that would be something hard to implement, but what I would like it to do is a timer that resets the ATO if it is outside of the parameter. That way we do not have to remember to reset it manually, if the timeout gets triggered wait X time and then enable again. Now maybe you have a number of times that you can do that, say after three times it just defaults to off and has to manually be enabled since maybe there is something more serious but I think that function would go a long way to helping things come up on a power outage.

:)
 
Maxout

Adahm

Community Member
Review score
+0 /0 /-0
View Badges
Joined
Jan 25, 2017
Messages
33
Reaction score
24
Review score
+0 /0 /-0
Yeah I use a combination of power strips I have one of each (although I am not using robotank I use something similar), the reason is I have some stuff on Kasa like return pump in the insatance that the RPI dies, becomes unresponsive etc. The items on the Kasa will keep trucking, then I have things on the direct control power side like heaters etc that I'd rather not have working if I do not have control of them.

Great point, I assumed fail mode would be “as is” for the Pi driven power bar, not sure if the signal to energize the power bar relays is persistent.
 

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
Great point, I assumed fail mode would be “as is” for the Pi driven power bar, not sure if the signal to energize the power bar relays is persistent.
Depends on the relays being used if they are normally open or normally closed, not sure what they are using in the robotank power module, the ones I use are normally open so if reefpi dies etc they will fail open and that is ok for what I have on them, it's not fool proof, with automation comes risk just try to minimize it as much as you can but it's always there.
 
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
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?
equipment state change based triggers are not there. Let me think about it.

Kasa integration do not require cloud. They are local network calls, and should work as long as local wifi is working.
 
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
Yeah I use a combination of power strips I have one of each (although I am not using robotank I use something similar), the reason is I have some stuff on Kasa like return pump in the insatance that the RPI dies, becomes unresponsive etc. The items on the Kasa will keep trucking, then I have things on the direct control power side like heaters etc that I'd rather not have working if I do not have control of them. Understand about the scripting I am thinking about it and will see if there is an easy path, I do like the ATO reset option/timeout value. Maybe @Ranjib can comment on if that would be something hard to implement, but what I would like it to do is a timer that resets the ATO if it is outside of the parameter. That way we do not have to remember to reset it manually, if the timeout gets triggered wait X time and then enable again. Now maybe you have a number of times that you can do that, say after three times it just defaults to off and has to manually be enabled since maybe there is something more serious but I think that function would go a long way to helping things come up on a power outage.

:)
We can do a “reset after “ like feature that will re-enable the ato after the specified amount of time .
 
Orphek OR3 reef aquarium LED lighting

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
We can do a “reset after “ like feature that will re-enable the ato after the specified amount of time .
I think that would be a nice feature to have and allow provide some additional protection on power outages when things come back online, pad the time to give things time to settle down. At least on my nano's I think it would work very well vs just turning the ATO off.

:)
 

Adahm

Community Member
Review score
+0 /0 /-0
View Badges
Joined
Jan 25, 2017
Messages
33
Reaction score
24
Review score
+0 /0 /-0
Came across a Home Assistant integration for Reef-Pi made by RedViper.

Since I am already using HA for home automation this was very cool.

It took but a few minutes to get reef-pi integrated. I am able to control reef-pi entities via home assistant. Yay! This mean I can run logic based automations for my use case.

It doesn’t have the ATO sensor pulled in yet though …
 

Attachments

  • 773CB3FA-42FF-4C3C-9474-87452A033254.png
    773CB3FA-42FF-4C3C-9474-87452A033254.png
    193 KB · Views: 16
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
Came across a Home Assistant integration for Reef-Pi made by RedViper.

Since I am already using HA for home automation this was very cool.

It took but a few minutes to get reef-pi integrated. I am able to control reef-pi entities via home assistant. Yay! This mean I can run logic based automations for my use case.

It doesn’t have the ATO sensor pulled in yet though …
Super 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
I noticed this on pcbway yesterday,
Looks super cool. All through hole components. PCA9685, Ezo, etc are i2c additional, that we have to plug in. I like it a lot :),
 

dadarara

Community Member
Review score
+0 /0 /-0
View Badges
Joined
Nov 16, 2020
Messages
74
Reaction score
31
Review score
+0 /0 /-0
Location
Israel
guys,
basic question :how to run a macro based on a temperature sensor ?

its not a simple issue. I want to switch the chiller if it below 15 degrees , not to freeze.
but switch it on to normal operation again if its simply 0.
I have a temp sensors that disconnect once in a while. so its kind of get a 0 reading.
the temp sensor is actually switches off the chiller case its below 15 celsius , but thats the problem, I want to reverse this action in case its simply disconnect (and thus 0 reading).

I was thinking to create a macro that checks if the temp is 0 and switches on/off the equipment
in the macro setup I see temperature step and can switch it on/off. not exactly sure I understand what that means for temp sensor ???

hope its clear.

P.S the disconnecting sensors is another issue that I need to solve. but I wish to have the above as a safe measure
 
AquaCave Logo Banner

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 noticed this on pcbway yesterday,
Looks super cool. All through hole components. PCA9685, Ezo, etc are i2c additional, that we have to plug in. I like it a lot :)Funn,
Funny I also saw that last night, I am about to pull the trigger on an order for some viparspectra boards and noticed it. I am also thinking of having some of his goby hat boards made but cannot find the latest gerber files. :(

If anyone can point me to where they may be would be appreciated, looking on githiub there are three versions but none of them match the latest version that I have from him.
 

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
@robsworld78 was looking through your automated script and the question I have is when using the script do you still need to go into raspi-config to complete the setup for 1-wire etc? If not using a robotank setup I assume the answer is yes but if you were using a robotank are those settings done for you also?
 

Adahm

Community Member
Review score
+0 /0 /-0
View Badges
Joined
Jan 25, 2017
Messages
33
Reaction score
24
Review score
+0 /0 /-0
Came across a Home Assistant integration for Reef-Pi made by RedViper.

Since I am already using HA for home automation this was very cool.

It took but a few minutes to get reef-pi integrated. I am able to control reef-pi entities via home assistant. Yay! This mean I can run logic based automations for my use case.

It doesn’t have the ATO sensor pulled in yet though …


Thanks to RedViper twho added ATO sensors upon request. Please do remember to recognize if you use the integration. The on/off controls are almost instant through Home Assistant.

2B17E44C-D564-4673-A139-56B9D4088975.png
 
Last edited:

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
@robsworld78 was looking through your automated script and the question I have is when using the script do you still need to go into raspi-config to complete the setup for 1-wire etc? If not using a robotank setup I assume the answer is yes but if you were using a robotank are those settings done for you also?
That script does eliminate the need to make any config changes to the Pi, it can be used on any install not just my controller. During the install it'll ask if you have controller, that's just to copy over a database setup for it.

This is what it does.
  1. Asks for time zone (it provides a clickable link to find)
  2. Updates the Pi operating system
  3. Installs I2C tools (this adds i2cdetect feature)
  4. Asks what Raspberry Pi your are using so it can install the correct reef-pi (currently installing 4.3)
  5. Asks if Robo-Tank is being used (if so it copies over a database with drivers / connectors etc added)
  6. Overwrites /boot/config.txt file on Pi (this setups 1-wire, I2C, etc)
  7. Deletes the download and install script
  8. Confirms install complete and provides link with your local IP to access reef-pi webpage
  9. After user presses Enter key when install is finished it will expand the file system on Pi and reboot
These are the 3 commands to run the script, first downloads, 2nd unzips and 3rd runs the script.
 

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
That script does eliminate the need to make any config changes to the Pi, it can be used on any install not just my controller. During the install it'll ask if you have controller, that's just to copy over a database setup for it.

This is what it does.
  1. Asks for time zone (it provides a clickable link to find)
  2. Updates the Pi operating system
  3. Installs I2C tools (this adds i2cdetect feature)
  4. Asks what Raspberry Pi your are using so it can install the correct reef-pi (currently installing 4.3)
  5. Asks if Robo-Tank is being used (if so it copies over a database with drivers / connectors etc added)
  6. Overwrites /boot/config.txt file on Pi (this setups 1-wire, I2C, etc)
  7. Deletes the download and install script
  8. Confirms install complete and provides link with your local IP to access reef-pi webpage
  9. After user presses Enter key when install is finished it will expand the file system on Pi and reboot
These are the 3 commands to run the script, first downloads, 2nd unzips and 3rd runs the script.
Yup I'm a linux guy, I just didn't make it back here to update my original posting. Looks like it covers everything that needs to be covered, I would probably add in an option to update the password or even maybe add an additional user or I could go on, but its a really good start and makes for an easy setup. I would also prefer to see the output of some of the commands as to see it updating etc, but understand not everyone cares about that. I may kick it around and see if I can add anything to it like maybe the timezone lookup etc.

I was looking at a slightly different tack in that you have an image already prepared, all the end user has to do is update the wpa_supplicant file with the wireless info for the wireless units and reboot and then be able to access the webpage. Lots of ways of doing things, one of the things I am working on in another forum is to have a sample reef-pi kit that I can loan out that has a small setup with a temp probe, kasa outlet, ato float etc. The the user can configure and play around with it and see if its something they want to pursue, if they do I have been steering them to your product or leviathon etc. Once the user is done playing they ship it back to me and I send it on it's way to someone else, still working out the kinks but I thought the loaner setup may get users more comfortable with how it works and thereby bring more users into using reef-pi.

Thanks for all the work you have put into it, really shows. :)
 
Click to watch best scape method in 5 easy steps!
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
Funny I also saw that last night, I am about to pull the trigger on an order for some viparspectra boards and noticed it. I am also thinking of having some of his goby hat boards made but cannot find the latest gerber files. :(

If anyone can point me to where they may be would be appreciated, looking on githiub there are three versions but none of them match the latest version that I have from him.
here is @Michael Lane 's goby hat repo: https://github.com/Ranthalion/reef-piHat
 

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
Yup I'm a linux guy, I just didn't make it back here to update my original posting. Looks like it covers everything that needs to be covered, I would probably add in an option to update the password or even maybe add an additional user or I could go on, but its a really good start and makes for an easy setup. I would also prefer to see the output of some of the commands as to see it updating etc, but understand not everyone cares about that. I may kick it around and see if I can add anything to it like maybe the timezone lookup etc.

I was looking at a slightly different tack in that you have an image already prepared, all the end user has to do is update the wpa_supplicant file with the wireless info for the wireless units and reboot and then be able to access the webpage. Lots of ways of doing things, one of the things I am working on in another forum is to have a sample reef-pi kit that I can loan out that has a small setup with a temp probe, kasa outlet, ato float etc. The the user can configure and play around with it and see if its something they want to pursue, if they do I have been steering them to your product or leviathon etc. Once the user is done playing they ship it back to me and I send it on it's way to someone else, still working out the kinks but I thought the loaner setup may get users more comfortable with how it works and thereby bring more users into using reef-pi.

Thanks for all the work you have put into it, really shows. :)
Well then you can see how poorly written it is. :) I've never used linux until reef-pi, it can get overwhelming quick with the commands but slowly getting better. Having an auto timezone lookup would be cool, if a wrong country code is entered in script it won't work so not error proof. I choose to hide the output (my latest discovery) and use custom text so it's not rolling out of control and nobody misses any questions/instructions, it also looks much cleaner. As reef-pi doesn't use any missing packages nothing can really go wrong but I hear you it would be nice to have confirmation.

I tried making an SD image but that didn't go so well as I couldn't keep the file small. Now that I've been using this for some time I do like it, people seem to have little trouble and it allows me to configure things for different versions of controller easier.

That's a cool loaner system you have going and thanks for telling people about me. Once and a while I have someone asking if they can try and return if they don't like, you're system sounds like a good work around that. A lot of the interest I see are from people who never heard of reef-pi so I've always thought it would be nice to setup a Pi, somehow assigning my domain or subdomain to a page where people can log into a live controller and explore reef-pi but that's a little over my head still as it would require resetting reef-pi database etc and worried about the security as it'll be on my local network, I guess I could setup a 2nd router/network for it though.
 
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
Well then you can see how poorly written it is. :) I've never used linux until reef-pi, it can get overwhelming quick with the commands but slowly getting better. Having an auto timezone lookup would be cool, if a wrong country code is entered in script it won't work so not error proof. I choose to hide the output (my latest discovery) and use custom text so it's not rolling out of control and nobody misses any questions/instructions, it also looks much cleaner. As reef-pi doesn't use any missing packages nothing can really go wrong but I hear you it would be nice to have confirmation.

I tried making an SD image but that didn't go so well as I couldn't keep the file small. Now that I've been using this for some time I do like it, people seem to have little trouble and it allows me to configure things for different versions of controller easier.

That's a cool loaner system you have going and thanks for telling people about me. Once and a while I have someone asking if they can try and return if they don't like, you're system sounds like a good work around that. A lot of the interest I see are from people who never heard of reef-pi so I've always thought it would be nice to setup a Pi, somehow assigning my domain or subdomain to a page where people can log into a live controller and explore reef-pi but that's a little over my head still as it would require resetting reef-pi database etc and worried about the security as it'll be on my local network, I guess I could setup a 2nd router/network for it though.
i like that idea. I'll see if i can do something about it.
 

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
Well then you can see how poorly written it is. :) I've never used linux until reef-pi, it can get overwhelming quick with the commands but slowly getting better. Having an auto timezone lookup would be cool, if a wrong country code is entered in script it won't work so not error proof. I choose to hide the output (my latest discovery) and use custom text so it's not rolling out of control and nobody misses any questions/instructions, it also looks much cleaner. As reef-pi doesn't use any missing packages nothing can really go wrong but I hear you it would be nice to have confirmation.

I tried making an SD image but that didn't go so well as I couldn't keep the file small. Now that I've been using this for some time I do like it, people seem to have little trouble and it allows me to configure things for different versions of controller easier.

That's a cool loaner system you have going and thanks for telling people about me. Once and a while I have someone asking if they can try and return if they don't like, you're system sounds like a good work around that. A lot of the interest I see are from people who never heard of reef-pi so I've always thought it would be nice to setup a Pi, somehow assigning my domain or subdomain to a page where people can log into a live controller and explore reef-pi but that's a little over my head still as it would require resetting reef-pi database etc and worried about the security as it'll be on my local network, I guess I could setup a 2nd router/network for it though.
I have an 8G image up now, they are easy to make but I did not have a 4g sd card to make a smaller image, hard to make one after the fact but will see what I can come up with today. The only thing that would need to be adjusted once they install it would be the timezone and expanding the filesystem both of them could be accomplished via raspi-config but thats what I am trying to avoid, so something to think about. I live in the cli world but it makes it more complicated for the average user, I can make images but need to figure out the flow for the last few bits.

In regards to the loaner system, I've kept it simple, one of @Michael Lane hat in a sandwich tupperware container with a pi 0 and temp, ato float and a kasa outlet. Pretty low overhead and low cost, gives them a chance to configure a few things and see how things work, I think its a good enough to see if it's something they like or not and if they do I just send them to the more polished versions.
 
REEFTIDE

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: 176 24.2%
  • No. Thankfully, I haven't.

    Votes: 376 51.7%
  • 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%
Aquariums Wholesale Live coral auctions every week
Top