Design Concept and Feasibility with HA, ESP32, ADS1115 and DS18B20

Hi Guys,

Just starting to research Home Assistant and it is looking at being a good pick for a project I’m going to shift from Arduino IDE and Blynk. Before I embark on the journy it would be great if someone to confirm what I need it to do will work or if its outside of what Home Assistant is designed to do.

Currently I have an ESP32 dev kit wroom espressif board on a PCB that does the following;

  1. Monitor battery voltages through 2x ADS1115 ADCs that run of I2C.
    This is done through a voltage divider circuit to work out each battery pack (7 in series) voltage in series. Reading the ADS1115 units is done every 10 seconds. I then use some code to work out the highest and lowest battery pack in series and the difference between.

  2. Have several DS18B20 units that running of digital pins for temperature monitor and logic control of other systems on ESP32 is managing.
    For example, if temperature = more than 40c, then shutdown resistor 1 on GPIO PIN X and turn on FAN on GPIO Y.

  3. I have several SSR (solid state resistors) each on there own GPIO pin. These are design to engage/disenage based on a defined high level voltage readings for the battery packs that are in series which then disipates voltage as heat through resistors so the battery packs are top balanced.
    This also ties into temperature readings of the heat sinks, so if heat of X is reach, turn on FAN1 or FAN2 and if heat XX is reached turn of the SSRs to protect the system from over heating.

With the above, is this possible throug using the ESP8266 plugin/Home addon in Home Assistance?

The other part to this is that if the Home Assistant Broker (server?) is offline or wifi/internet is down the system must still run, monitoring temps, fans and SSRs to protect its self. Is this possible with HA or does it always need a connection to the Broker?

The system will be programmed with a default safe set of values, for example if temp is 30c, turn fan on. But I would like the ability to change the 30c fan start option through slide bars, which looks possible in my research. Just important that this runs if HA is offline/wifi and/or internet also.

Last question is, can the HA broker be at another site, seperate wifi/internet connections? DNS/routing/port forwarding would all need to be sorted which isnt a big deal. But wondering if it is supported easily enough?

Thanks heaps in advance!

Cheers,

Uf this sounds like quite some work.

Should be possible. If you use ESPHome, then your limit is whatever the API can do. So check out there if you see everything you need. I don’t know to what extend MQTT is already involved here, but MQTT is for sure a protocol you can use for basically everything.

If HA runs local, it doesn’t need Internet for what you want. However, you will need wifi to communicate with your ESPs and if that is down, HA can’t send commands and thus automatons wont work. You can work around this by implementing some automatons within the firmware of the ESPs though, but that is none of HomeAssistants business.

In principle yes, but as you seem to be concerned of failure, this adds complexity and thus more possible points of failure. Also, if HA runs at another Site, that you connect to via Internet, you suddenly need internet for your automations to work, keep that in mind.

In general HA is not magical. If it cant communicate with a device, the device is on its own. HA wont kill the device or anything, but its up to the device then to do what ever it does, and as you are programming the ESP yourself, its ultimately your job to make it as fail save as you need it. This has nothing to do with HA or any other Smart Home Hub out there.

awesome, thanks for the info, ESPHome is where I have been digging around and will keep going. Looks like all the code I’ve written will be scrapped and redone :frowning:

So there is no method to deliver a payload that runs automatically like a LED blinking at 5 seconds interval even if HA broker is offline?

Looks pretty straight forward to have this running on a Raspberry, so happy to have one on site. This coupled with a reliable Wifi that does DHCP should always allow the ESP32 → ESPHome → HA connecticity to be present.

Thanks heaps for the detail reply, appreciate it!

well if your firmware is doing just that, then yes, if not, no.

See HA can send commands to your ESP and lets say HA sends the command “blink”. Then depending on the firmware, the ESP will blink once, twice or infinite amount of times.

So do you mean that you can run an ESP32 with Arduino code on it as well as run it connecting to HA?

To me, it sounds like if something with this system were to go wrong, the result would be a battery failure possibly leading to fire. Sounds like the type of system which should absolutely not rely on a high level general purpose control system like Home Assistant, but instead should be implemented completely in code on a microcontroller directly. With the appropriate hardware watchdog. The microcontroller should send monitoring data in a non-blocking fashion (ie. serial) to another device (ie. ESP8266, or even HA directly) for monitoring purposes and configuration changes only.

ESPHome is definitely not the right system for this.

Maybe an inexpensive PLC is the best choice, communicating to HA.

There definitely is risk, heatsink design and positioning allows for fan failure and ensure systems dont go over temperature maxiumums…

This would be my preference, have the ESP32 (which includes an onboard ESP for wifi connectivity) to control the solution without any external internet/wifi requirements. Then I would love for simple variables information (temp, fan off/on status, voltage of system) produced by the ESP32 information to be passed into HA (which then gives me historical info ec ec), do you know if this is possible? The interface of HA, graphical display is really nice, just dont know how to get it into it.

Cheers,

Nic

It is definitely possible.
If all you want to do is pass data, then ESPHome or Tasmota may do the job. You can then pass the data via MQTT to HA.