Hello, thank you in advance for guidance.
I have 2 hybrid electric water heaters (heat pump/electric). These water heaters use RJ-11 jacks to communicate detailed data to ESP32 via the RS-485 input pins. I have an extremely unorthodox HVAC system that I designed with efficiency in mind that has been developed over the course of 5 or 6 years. I am building a new house and want to fully implement this system and make it automated. In order to do so I purchased 2 RS-485 ESP32 controllers with M5 AtomS3 modules, one for each water heater. I installed Econet Ecohome ESP32 program onto these controllers and integrated into home assistant successfully. In order for me to automate this system, I need 16 relays (potentially more) to power to various valves and circulators based on input.
I purchased an Arduino Mega 2650 and attempted to develop some language skills to interface with a 16 channel relay board and now have the sketch needed using basic truth logic to turn relays on or off depending on the scenarios needed. I also have input buck converters that sense when hvac controllers attempt to open or close dampers and zone valves. These converters drop 24v to 5v or 120v to 5v depending on the device I need to monitor. I am currently using 46 pins on the Mega and likely will need to use a few more as I tweak response.
Back to the ESP32, since this is wifi connected and can be independently monitored via home assistant all I need is to figure out how to pull the temperature data from each ESP32 to the Mega via USB (using a USB hub) so that if the temperature inside the actual water tank (I need it to be the actual thermometer that is determining when the heater needs to turn on) is below 104F that my protocol in the Mega adjust relays accordingly. I could use a temp probe inline on the supply line but by the time the temperature has dropped at the supply line the system would not be as sensitive to change and it would be considerably less efficient.
Ideally I would like to be able to utilize the ESP32 wifi module to build things in the arduino cloud to be able to also control relays through the Mega manually. I don't know if that is possible.
Typically I would not use a forum to waste anyone's time and search but over the last few years search engines just constantly produce the same exact irrelevant results regardless of which search method I use to find what I am looking for. Any guidance of where to search first and specific verbiage that would help me find what I am looking for would be greatly appreciated.
Thanks again.