I’m having an issue with an ESP32 running ESP home dropping wifi connection after several hours and not recconecting. The only way to get it to recconect is to power off and power on the ESP32.
I’ve tried a lot to prevent disconeect but nothing working so far. My next idea (even though it’s fighting the symptoms) is to have the ESP check and if it has no wifi connection reboot itself.
I’m having some issues to figure out how to get it to work. This is what i have now for code
#This part is working. It creates a restart switch in home assistant
switch:
- platform: restart
name: "Restart Switch"
#This part is invalid
on_wifi_disconnected:
then:
- logger.log: "Wi-Fi Disconnected"
#here i need to add an additonal action to restart the ESP. I've been using the logger for testing purposes to see if i can get the code to trigger.
It does not work. I have 2 problems here i think
I can’t figure out how to use the conditions to start an automation on the ESP.
I don’t know how to turn on the switch i already created using the automation.
Ok, i’m trying this.
Got the wifi signal sensor to work but having some trouble to get the automation.
Mostly I don’t understand the documentation. It always stars them off with on_…: I’m pretty sure i’m suppsed to replace the … with something but I can’t seem to figure out what.
I ended up with this so far. But it seems like my automation might not be in the right place.
Would appreciate any more help.
Yes, i found this in the documentation too. I think i forgot about it when i found that it defaults to 15minutes when it is not set. If my wifi goes off it stays off untill i power cycle the ESP. I can wait hours and it does not come back online.
Maybe i should give it another try and play with it. It’s difficult to test if it works though. I’ll have to wait several hours before i can see if the problem occurs again after making a change.