-
Notifications
You must be signed in to change notification settings - Fork 6
Custom Home Assistant Config with Reef Pi
I control my 2 small aquariums (one 40 gal fresh, one 15 gal nano reef) with a combination of Home Assistant (which also takes care of my apartment) and Reef-pi.
I wanted the tanks to mirror specific locations as much as possible. For example, I’m querying various sites to get daily water temp, tide, and weather data.
Through automations on the reef tank:
- Water temperature changes daily accordingly, dropping to lower averages at night, and higher at midday depending on the data coming from a reef in Bali.
- Lights fade up and down according to sunrise / sunset times, and offset by two hours so the late-waking humans can enjoy the tank.
- High and low tides control the wavemaker on/off according to a script that increases intensity at mid-tide change for that specific location.
The freshwater tank is setup in a similar way, but targeted to a spot in the Amazon River instead. Amazon water temp data is hard to find so I had to go with monthly averages in a text file, but the rest is the same.
You can read about the hardware details of the Reef-pi controller on Thingiverse, with the enclosure files
Improvement has become a never-ending project but I think it’s pretty cool so I wanted to share. Will update this repository as I can.
Some other resources for aquarium control:
- My build thread on reef2reef
- Home Assistant Community Thread on Aquarium Control
- Reef-pi on Github
- Reef-pi tutorials on Adafruit
- Reef2Reef: Reef-pi Build Thread
- Thingiverse Reef-pi Group for some 3D printed components
- MotionEye for external video feeds of the tanks
- Twitter @Octo_Cam_Bot
- I've switched the feeder to a continuous rotation auger type on Thingiverse here. The barrel type was pulling in too much moisture and getting gunked up. The python script for running it off of a pi is "fishfeeder360.py" in my scripts repository
- There is an auto top off timer that switches one of the reef-pi pumps to a 10 minute "diurnal light" cycle, this is a bit of a hack until reef-pi has a more integrated approach to scheduling short time periods on a PWM circuit (currently, minimum is 2 hours). With ramp up time it amounts to about 8 minutes of top off every night. Home Assistant sends this schedule nightly via an API call in automations.yaml
- There is a pump that cycles water from a small sump, Home Assistant runs this every three minutes until Reef-pi sees the float switch go Low (usually about a minute), then it has time to fill again.
- The Amazon Tank is now combined with a aquaponic system as seen here on Thingiverse. The lightswitch and plant_waterer scripts in my scripts repository are triggered by a Home assistant automation. This also allows for gradual water changes.
The reef-pi build has been chugging along pretty effortlessly since the last posts, and I've added an orchid dottyback, some inverts and frags. Here's some pics of the full setup.
I also added a pan-tilt camera with a raspberry pi running motioneyeos, that's the black box hanging off the top right corner in the pics. You can find more about motioneyesos here, and find my action button scripts here. I'm not super thrilled with the lag on the image refresh, but not sure if there are a lot of better options.
One glitch I did find about running reef-pi (or any pi) in this environment, is that the magnets that so often are securing pumps, etc. in the right place through the glass are wreaking havoc on the wifi connection. I installed a shelf on the back so I could hide the reef-pi box out of the way but whenever I put it there I couldn't connect to it (it was still running as a standalone controller, but the broadcast to web UI was very weak). I'm working on getting a wired cat6 connection to that corner so I can tuck it all out of sight and still have a solid connection.