I am experiencing small but significantly important issues with an project using an ESP32 and need some advice from the guys who some real understanding of the ESP32’s.
I have read through most of the ESP32 related post on the forum and cant see that someone has done what I am thinking of doing.
Just some background, I have many years of extensive experience in plant automation in the E&I field in a few industries. Worked with multiple PLC brands and spend years on the Honeywell DCS systems. Everything from ladder and function blocks to CL (Control Language) based on Fortran in application modules. In short, all kinds of machine coding.
I find it very difficult to use C, C+ and python. I have this way of thinking, many times in ladder format when i approach home automation and hobby projects. I struggle to find a way to put my thoughts into a program that works. I know exactly what I need and what I want, but cant express it in the languages above. I even struggle to ask the questions on the net, because I dont even know the correct terms used in these languages. Although there is some similarities, the differences are huge. So i am going to ask my questions in simple English so that less experienced hobbyist could also follow us.
In this project I am using an ESP32 Devkit 1 and use ESPhome from within Home Assistant to set it up.
Two issues in the last few days.
1: Lost wifi connection with ESP once and had to reboot ESP.
Question: How do I ensure that the esp reboots once it loses connection to the network. From what I read it does monitor it and will reboot after 15 min or so. What is the best way to ensure that it is set up correctly.
2: On one occasion the Automation in HA called for a Output pin on the Esp to switch on. HA showed that the “Relay” is on but outside in the fishroom the relay was not on. Had to toggle the switch on the dashboard twice to get the relay on. Hasn’t happened again but now I know its possible and want to foolproof this.
Question: How can I receive a “Feedback” from the ESP to see if the output has indeed switched on when requested to, or at least an “State” from the pins used in the program. I can not afford using an input pin for every output pin in the project so it needs to be a message or something from the ESP side that can be monitored on in HA.
3: For critical applications, I feel that it might be better to run the automations on the ESP itself to ensure that it can continue doing what it should even if the WiFi drops out. Running the Automations within HA means nothing if the messages can not reach the ESP. In a critical application the ESp will keep its output on and create a possible dangerous or unwanted situation in the device it is controlling if it solely relies on the HA.
Question: Critical applications in HA or on ESP? IF yes for ESP, who among you are willing to help me set up one sensor so that I can try and understand te flow and then apply that to all my other sensors.
Theoretically I should be able to set up the ESP using an IDE and run it as a “Standalone” unit, only monitoring the entities from HA.
From the other posts it seems like a few guys here truly understand the ESP’s
@justinschoeman , @ebendl , @Sc00bs , @wernerhp , @FXSuper, @_a_a_a (Apologies if i missed another expert, but this is the names that I remember from previous ESP32 posts) . Please if any of you can throw your ideas here. I would even come and sit with any of you at your place and learn a few things if you have the time to teach me a bit more about MCU’s and its coding.