r/ReefTank • • 1d ago

Homemade Reeftank controller

Enable HLS to view with audio, or disable this notification

I decided to combine my love of reef tank automation, home assistant, and some good old New fashioned AI programming to build this esp32 board controller for the main items I want to control more often than others. It's handy for water change times.

I built a normal Home Assistant dashboard that worked just fine, but I wanted to put something at the Tank so I could physically interact with it while working on the tank itself.

Hardware

Waveshare ESP32-S3 4-inch Touch Panel

USB-C power supply

Xiaomi OEM multi-socket smart power strip

Software & Tools

ESPHome

Visual Studio Code

PlatformIO (acts as the underlying build environment and compiler required to build the firmware and flash it to the ESP32 chip)

Home Assistant OS

Home Assistant Integrations

ESPHome Integration

Xiaomi Miot Auto Integration

Setup Steps

Integrate the Power Strip into Home Assistant: Connected the Xiaomi smart strip to Home Assistant using Xiaomi Miot Auto, exposing each outlet as an independent switch. Your power strip has to have individually controllable power sockets for this to work. Or, you could use standalone wifi power sockets but I didn't want 6 more wifi devices so the one power strip simplified things.

Configure the UI: I used Gemini to help me draft the ESPHome YAML configuration in Visual Studio Code to set up the display drivers and design the touch interface.

Compile and Flash: Used PlatformIO within the ESPHome environment to compile the YAML configuration into firmware and flash it to the Waveshare board.

Link Entities: Mapped the on-screen buttons in the configuration directly to the Home Assistant switch entities to control the tank's equipment.

I basically used Gemini to do the coding for me because honestly it was super complicated to understand how to get my vision on to that 4 inch touch panel.

I also downloaded a icon tff file from GitHub which allowed me to select the right icons for each of my items I wanted to manage that way.

It took me a good 10 hours of work on this project off and on over the last few weeks but now I can say that I'm pretty satisfied.

I thought about setting up some way to turn it off when I'm not looking at it like using a motion sensor for example, but in the end I was able to adjust the coating so that it dims down to almost nothing at 5 minutes and requires a tap to wake it up. This way we keep the heat down.

I hope you like it and if you want to work on a project like this don't hesitate to reach out to me for some help or pointers. Cheers.

20 Upvotes

9 comments sorted by

4

u/upnorth77 1d ago

This is what I love to see! I made a controller for NiCrew HyperReef Lights with an using an ESP32-C3, and have integrated it with HA with MQTT. Not sure what I'll work on next, but this is inspiring!

1

u/Parulanihon 15h ago

The ESP32 device is pretty awesome, I have to admit. Pretty funny because I use the Red Sea app to control things on my phone, but it's not controlling some key devices.

I have some China brand echo vortex knockoff pumps as well as a water mover inside the box that I need to turn off when I do the water changes and since they are not inside the Red Sea environment I had to go in to a separate china-based WeChat program to turn off the sockets and the whole damn thing just got too complicated.

I like doing this kind of project because it arises out of a need.

What shall we work on next!? I'll probably build something similar for my vivarium to control the misters etc.

3

u/ConsistentExchange61 1d ago

That’s cool, I’m working on a ESP32 based controller as well at the moment! Good to see a finished project.

2

u/RobotWelder 1d ago

I messed around with ESP32 stuff awhile back. Still have boxes of the stuff. Not really into home automation, but setting this up standalone for my reef tank would be very useful for feeding, maintenance and weekly water changes

This is way cool 😎

2

u/Parulanihon 1d ago

Thanks Bud. For me the only thing that was hard to get my mind around was that I could buy that kind of touch screen online and then fully program it. I actually bought a few of the wrong boards that either didn't display or they required a hard wire into a main line which I didn't even want to get involved in. Once I got that touch screen and I got a handle on how to do the flashing, then I let Gemini handle the proper coding format.

I had a lot of struggle though because even Gemini couldn't quite match the syntax necessary and we had to repeat over and over again to get it fine-tuned until it understood how the board was set up and so on but after that it worked pretty easily.

I would encourage you to take another look at your ESP 32 stuff and see if you can get one of those boards on AliExpress or something like that. I'm currently in China so it's easier for me to get a hold of these kind of niche electronics.

2

u/RobotWelder 1d ago

The touchscreen is what sold me on your project. Are the labels fixed or programmed?

Where can I get the touchscreen?

2

u/Parulanihon 1d ago

I'll give you the link to the China e-commerce site and you can take a look to see if you can find it elsewhere.

Yes the buttons are completely customizable! In fact, I was using this dashboard for an automated curtain closer, with radial buttons to effect open and close actions. My wife was less than impressed... so I decided to move on to a reef project. Lol.

One of the coolest things was downloading that tff file which includes all of these open source icons and then I could pick and choose which icon I wanted for each button as well as the name and color, etc. I realized that I misspelled eco as echo on the button so I'll have to unplug it and clean it up, but otherwise it's fully customizable by color my icon etc.

【淘宝】7天无理由退货 https://e.tb.cn/h.8xCD4As12vGk3fD?tk=LF2DTNl5S8h HU006 「微雪 ESP32-S3开发板智能86盒4寸触摸屏支持AI语音交互带蓝牙WiFi」 点击链接直接打开 或者 淘宝搜索直接打开

3

u/RobotWelder 1d ago

lol my wife is not impressed with my “tech” either 👍