Apologies for asking what might be a simple question, but I’m new to coding and to Home Assistant. I have spent several days trying to sort this out, but without success.
Aim:
I am trying to set up a couple of esp32 modules to read multiple DHT11 temperature/humidity and access the readings via Home Assistant.
I have followed the Home Assistant and Youtube videos to prepare the esp32 for first use. I initiated the chips using Arduino IDE software. I was unable to do this via the ESPHome add-on in Home Assistant due to errors - (sorry, can’t remember exactly what - Ive spent 5days looking at various error messages!), but I managed to install the flash ‘for first use’ using web.esphome.io website. This worked perfectly, and the esp32 ‘nodes’ (think that’s the right term) appeared on the espHome page of Home Assistant and I was able to adopt them. However, if I edited any code and re-flashed through Home Assistant espHome, I kept getting library file errors (corrupt JSON file). I even tried flashing the original code without any modification via espHome in Home assistant and that failed too. Every time leading to the the nodes being permanmently offline in Home Assistant (even though I could access them via their IP number or via the web.esphome.io webpage. I tried uninstalling and reinstalling the the esp32 add-on to Home Assistant. I have tried saving the code (even the original unaltered code from the first-time-flash) and flashing it with web.esphome.io - which uploaded without any errors at all, but then the nodes would stubbornly stay off-line in Home Assistant ESPhome page, even though they were clearly connected and registered with Home Assistant. I’ve found various threads on the Home Assistant Community where people have experienced similar error messages, and tried to follow their solutions, but without success. I upgraded my Home Assistant add-on from ESPHome to ESPHome (beta) and that now allows me to flash the esp32 directly from ESPHome on Home Assistant - which I couldn’t do before…but frustratingly, once I’ve done so, the esp32 goes offline and is not discovered by Home Assistant (even where I am re-flashing the original code without any alterations).
Solution?
I think I must have had some kind of corruption in the original EspHome add-on, but even now it is still not working - maybe I should not have initiated the chips with the ESPHome(beta) instead of using web.esphome.io? Maybe I shouldn’t have initially tried with Arduino IDE? Maybe I need to erase the esp32 somehow (I don’t know how) and start from scratch using Home Assistant and the espHome(beta) page?
Any suggestions?