Jump to content

Using Home Assistant (HA) open source to automate my tank


Marcelo
 Share

Recommended Posts

Hi Everyone,

I have being using Home Assistant to manage routines at my house (automations, check if the garage door is closed, warn me when the printer cartridge is low, send me a Text Message if something is wrong with my AC, etc etc) since 3 years.

This year I am going to add my tank to the system.

Phase 1 goal is to automate CO2, Lights, Aerator turn on and off and show some basic information I’m the dashboard. 
 

Home Assistant is this software: https://www.home-assistant.io

 If you are interested on join the project let me know.

Suggestions are always appreciated.

thank you

  • Like 2
Link to comment
Share on other sites

Definitely going to follow along.  This is the type of work I should be doing, but just really haven't gotten my feet wet enough with it to be comfortable with the coding side.

Skeleton for ideas (please feel free to use anything you think is useful!):

1. Feed Mode
-Pumps / filtration / heater off for 15 minutes
2. Night Mode
-Blue lights on at a specified value, everything else normal to previous
3. Maintenance Mode
-Pumps / filtration / heater off
-Airstone stays on or turns on
-Light on, but set to a "good amount of light to work"
4. Normal Mode
-Everything running, light+CO2 runs through their own schedules.
5. Diagnostics
-Pump off / on, flow test (export / chart results)
-Heater off / on, wattage use check (export / chart results)
-CO2 on/off, (binary check on solenoid)
-Water level sensor check (is it above specified level)
-export / record anything useful via probes to a chart
6. Sensors and Warnings
-water level sensor
-electronic sensor (making sure the water isn't charged with some sort of a stray voltage)
-equipment failure warnings
-heater on for too long
-air pump warning
-co2 on for too long warning
-testing probes for what makes sense (PH is very useful as well as other things)

  • Thanks 1
Link to comment
Share on other sites

Hi,

I started to build the main screen. For now it only shows Turn On and Off buttons, if it is on (blue) or off (black) and the last 2 days ONs and OFFs as way for me to see if co2, lights and O2 are kind of “balanced”. 
 

Today I should:

- work on the automation to turn on and off them at specific times

- setup Phone Text Message alerts if some smart switch goes offline.

 

 

2A248EFD-CA49-4808-87D5-579B1C58904B.jpeg

  • Like 1
Link to comment
Share on other sites

  • 2 months later...

This would be awesome for my mudskipper tank! I currently use 2 pumps on timers to operate the tidal flow and have the filter/heater in the reserve tank on a timer to only run during low tide and the heater in the main tank on a 4th timer to run during high tide. There is also a reptile tank control box with a temperature and humidity sensor to run a heat lamp and mister and a led 24/7 programmable light. Sounds like you could automate all of that through the app if you were savvy enough (I am pretty sure I am not though lol)

Edited by Phoenixfishroom
  • Like 1
  • Haha 1
Link to comment
Share on other sites

I stumbled upon this post and thought I’d share a couple screenshots and how I’m also using Home Assistant for my fish tank.

I’ve had a few fish cooked by malfunctioning heaters in the past so I enlisted Home Assistant to help me catch this from occurring again.  I know they make alarms for this purpose, but I’m cheap and always enjoy a good project.  I was already using Home Assistant for various automations in my home so this was a logical choice. 

I purchased a cheap temperature probe and used a spare ESP32 board I had laying around to create a sensor.  Total cost was under $10 for the temperature sensor and board if I recall correctly.  All I had to do was hook up a few wires to the pins on the ESP32, flash ESPHome on the ESP32 and make a few updates in YAML.  If you have moderate technical skills, I’d say this is very achievable.

The real advantage here is the automation I setup in Home Assistant to alert me via text message if the temperature is out of range.

I’ve used a smart power strip for years to control my lights.  By plugging my heater into the power strip I’m able to turn off the heater remotely if I receive an alert from the automation.  The power strip also measures voltage and current so it’s also fun to display the power consumption on the dashboard.

You may also notice the led backlight in the pictures.  I figured if everyone is putting them on the back of TV’s it might also look good on a fish tank.  This is also controlled through Home Assistant using WLED installed on a D1 Mini ModeMCU.

For my next project I’d like to put a similar sensor together for the above ground pond I keep during the summer.  I’m planning to put two temperature sensors on the ESP32 board to monitor air temp and water temp.  I’m really just curious to see how the temperatures differ over the course of the summer.

Below are a few screenshots of my tank, the sensor, and basic Home Assistant dashboard. 

IMG_2871.jpg.0939266205dd8716f2d1e78a48a81317.jpg

image.jpeg.0b55a5ffa853399bc8024eadf0d402f5.jpeg

Silver thing is the temperature probe in my tankIMG_2874.jpg.029ae960b0b575ab3f09f2111748c416.jpg

This is the ESP32 board with the sensor attached.  I should probably make a case for it.  Someday I'll splurge on a 3D printer.

Screenshot2.png.cd7e93148559b683519fa03f374ac516.png

This is my very basic "fish" tab in my Home Assistant dashboard.  I just did a water change so you can see the temperature climbing, and the heater consuming a good amount of power.  

Edited by Chak
  • Like 2
  • Love 1
Link to comment
Share on other sites

I thought of another thing that would be a huge money saver. 
I have started using full spectrum dimmable LED light strips for my tanks instead of tank lights, I glue them to a piece of metal and coat it in epoxy resin.  They come 4 or 8 strips to a controller which works well because I have my tanks on racks. If it were automated though you could come close to the 24/7 lights with it by getting maybe 4 strips with 8 bars each and 4 smart power strips. One is set to max brightness, two are set to maybe 60% and 30% yellow/orange and the last one is not full spectrum just blue LEDs for nighttime. You could program the power strips in sequence and have 8 tanks running for like 160$

edit: 160 plus the cost of the metal strips and epoxy which is negligible. You could use things other than epoxy as well, I just happen to already do epoxy resin casting and have gallons of it around all the time. But clear glue would work too or even plastic wrap, anything to keep the water off of the LEDs. But the strips are like $20 each and I saw a power strips for like $20 each also.
now I am thinking I may have to get one of these smart home yellow boxes, I am definitely still not about to have Alexa or google home listening to me all the time (don’t care if that sounds kind of tinfoil hat lol)

Edited by Phoenixfishroom
Link to comment
Share on other sites

  • 2 months later...
On 1/2/2023 at 7:30 AM, Marcelo said:

Hi Everyone,

I have being using Home Assistant to manage routines at my house (automations, check if the garage door is closed, warn me when the printer cartridge is low, send me a Text Message if something is wrong with my AC, etc etc) since 3 years.

This year I am going to add my tank to the system.

Phase 1 goal is to automate CO2, Lights, Aerator turn on and off and show some basic information I’m the dashboard. 
 

Home Assistant is this software: https://www.home-assistant.io

 If you are interested on join the project let me know.

Suggestions are always appreciated.

thank you

Are you pretty good with programming? I have been using full spectrum LED strip lights for some of  my tanks and I am really happy with it for a bunch of reasons. Since my build style is “lets see how much I can over-engineer this”  I want to take it several levels up and get addressable LED strips in full spectrum and color change and use a combination of both strips set into fixtures that I am currently prototyping all wired to a single ardueno or raspberry pi and code them to run a 24 hour cycle with sunrise and sunset, full spectrum daytime, and red/blue night light (I use red for my woodcats at night because they can’t see that wavelength). The thing is I build, I tinker, I do NOT code. I need to bring someone with that skill set into this project and it sounded like it would fit in with your interests 

  • Like 2
Link to comment
Share on other sites

On 5/27/2023 at 7:56 AM, Phoenixfishroom said:

Are you pretty good with programming? I have been using full spectrum LED strip lights for some of  my tanks and I am really happy with it for a bunch of reasons. Since my build style is “lets see how much I can over-engineer this”  I want to take it several levels up and get addressable LED strips in full spectrum and color change and use a combination of both strips set into fixtures that I am currently prototyping all wired to a single ardueno or raspberry pi and code them to run a 24 hour cycle with sunrise and sunset, full spectrum daytime, and red/blue night light (I use red for my woodcats at night because they can’t see that wavelength). The thing is I build, I tinker, I do NOT code. I need to bring someone with that skill set into this project and it sounded like it would fit in with your interests 

Hi Phoenixfishroom, I am not good  with programming 😞 too but the thing is I have a high-tech planted tank and I am afraid of mess around with light. When you say programming what do you mean ? What you could do inside Home assistant is to setup the light with the configuration you want, save it as “Sunrise 1”, change the light setup to, let’s say, late morning with less Red or less blue, for example, save again with “Late morning”, change the setup again and save with “noon” and etc. After, that you can activate each one of this setups with automation on specific times. Is this what you are looking to do ?

Link to comment
Share on other sites

On 5/27/2023 at 4:56 AM, Phoenixfishroom said:

The thing is I build, I tinker, I do NOT code. I need to bring someone with that skill set into this project and it sounded like it would fit in with your interests 

If you need help making a skeleton code I can sort of help in DM or something.

I went to school for it, but using microcontrollers was the highlight and the main method of enjoyment. Assembly and those types of languages.

Every new product is a new language and it's all exhausting to learn the fine details. I can help with the "how to" if you need that and feel inclined to code it yourself.

If it was a lab in class we'd start it with a 555 timer and go from there. The timer is your clock and you can use that as a means to generate the 24 hour cycle.

That might be all you need to find the code online. LED control is really easy to code.

  • Thanks 2
Link to comment
Share on other sites

On 5/27/2023 at 2:50 PM, nabokovfan87 said:

If you need help making a skeleton code I can sort of help in DM or something.

I went to school for it, but using microcontrollers was the highlight and the main method of enjoyment. Assembly and those types of languages.

Every new product is a new language and it's all exhausting to learn the fine details. I can help with the "how to" if you need that and feel inclined to code it yourself.

If it was a lab in class we'd start it with a 555 timer and go from there. The timer is your clock and you can use that as a means to generate the 24 hour cycle.

That might be all you need to find the code online. LED control is really easy to code.

I figure this is a good entry point. I would like to actually have the lights on a year long loop if that is possible, so my daytime lengths can be correct for each tank. Each strip can be programmed individually so I can have the Congo and the Rio negro in one room. 
once I have the lights down I would want to automate some pumps for tidal flow and rain, sending my phone info about conductivity, salinity, ts from smart meters, and eventually have it controlling water level, temp, conductivity, etc by telling it what to do on a year loop and giving it ways to respond to the meter values. Gonna message you 

But basically I want to have a bunch of biotope tanks that simulate the seasonal changes to water parameters and daylight hours of the region they represent…. And I want it to happen without me doing tons of extra stuff all the time lol

Link to comment
Share on other sites

Home Assistant has a Sensor called “Sunrise” that shows the time the Sun will rise “today” in your area. It changes (obviously) according to the month and etc (summer, winter, etc). 

What about if you say that your light should turn on 3 hours after the Sunrise and turn off 12 hours after the Sunrise? 
 

This is what I do here with my Tank but also some of my external home lights. 
 

 

Link to comment
Share on other sites

  • 1 month later...

Very interested in this thread. We are using Hubitat, instead of Home Assistant.

Our setup is basic, uses wireless (zwave):

1. water leak sensors - reports wet/dry status

2. single and dual power outlets - for automated or on-demand control of lights, filters, air pumps

3. 4-in-1 sensors: motion, light, humidity, temperature, for automation of lights based on a person standing in front of tank, and room stats which are displayed through a Grafana dashboard

Our main goal with the automation was leak detection and mitigation (we have automation for water main shutoff, and filters are turned off). There is also automation to switch off my HOB, when power is restored after a power outage, because it is not self-priming.

This thread has many ideas we want to incorporate...

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

Hi Everyone, Hi @nabokovfan87 

I thought about automated water changes but my RO filter is far from the tank so it won’t help me. 
 

This article you shared is really cool. If one wants to use Home Assistant only, this valve is compatible with Google, Alexa, Home Assistant and etc etc. there is an article in a home Assistant forum where people mention about it ….

I feel it is ok to share this link as I am not selling it and AquaCoop too so I guess it is ok 

https://www.amazon.com/gp/product/B07F36MVVT

  • Thanks 1
Link to comment
Share on other sites

Hi Everyone, 

Home Assistant can now “Hear” and Execute Commands like an Alexa or Google.

Next weekend project is: If I say: “Assistant, fish food time”,  Home Assistant will turn off my Skimmer, wait 5 minutes and turn on it again. “ 


💪🤞

Marcelo


 

  • Like 1
Link to comment
Share on other sites

  • 3 months later...

I've been running home assistant on my outdoor 330 gallon tank of koi as part of my aquaponic system. It manages the temps in the winter because I wanted to keep it around 50 instead of 74 like the rest of the year and the heater wouldn't allow me to go lower than 70. It manages the pump to move water to the sand bed every few hours. Monitors energy usage. Alerts me if the pump runs too long or water level gets too high in the sand. Turns the air pump back on if I forget and leave it off after feeding.

I just set up my first indoor tank and so far am just using it to manage the light, but wanted to add another temp sensor on an ESP for alerts if the heater runs away or fails. I also plan to set up an alert if the air pump stops using electricity, so I know if it's broken or cut out.

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...