ESPhome, is there a way to reboot the nodemcu/wemo with a switch?

Hi, I have a problem with a nodemcu which works fine usually, but sometimes (not sure what happens) my configured switch is not working. After I reboot (unplug and plug again the nodemcu) all is fine.

Since I am not able to figure out which is the problem, I wish to have the ability to restart/reboot the nodemcu from HASS.

Any clue?

You could set up deep sleep.

Set the wake time for as long as you want between resets. Set the sleep time to a second. The CPU is turned off in deep sleep so it resets on wake up.

The advantage of doing it this way is you don’t need a timer or automation for your regular resets.

Would be better to get to the bottom of the problem though.

1 Like

Just add:

switch:
  - platform: restart
    name: "XXXXX Restart"

to your esphome .yaml file.

2 Likes

Thanks I just saw that, and included in the configuration. This is a restart of the (software) node, and/or a reboot of the nodemcu (or is it the same thing)?

Anyway I will see if the platform: restart will solve my current problem.

it might be the power supply (not sure what else can be). I have it plugged to a 2,1A power supply, I do not have other to try. Just ordered a 3A type will try those when they arrive (1 month …)

Since I added the restart switch, I haven’t needed it, but I did try it on one of my nodemcu’s and according to the Uptime sensor it restarted the device.

Depending on what you have hooked up to it that should be heaps, Determining the ESP8266 power consumption

Also I was assuming that you would be unable to issue commands if your switch stops responding. The sleep regular reset method should work in this case (like a watchdog timer).

Sorry I do not understand “heaps”, means enough?

EDIT, I changed the Wemo d1 mini to a nodemcu, it could be that for my application (although simple) that was the problem (testing now)

No ‘heaps’ does not mean ‘enough’, ‘heaps’ informally means a lot more than enough. Look at the link I posted. Peak currents of less than 0.5A are required. You have 4 times that available.

For my application, a GPIO connected to a button through a 10K resistance a 1A power supply was not enough (tried and tested with a original Samsung 1A power supply).
Problem is many chinese power adapter are rated 2A and probably are 1A in reality, Now I bought a “rated” 3A, hoping is at least 2A

Ah. As well as not being rated for the specified current many of the cheaper ones dont have very good filtering either. You get a lot of high frequency switching noise that can cause havoc.

Ahh good to know thanks. You know any good supplier of 2-3A power supply for nodemcu?

Could you please update this thread if it works when you eventually need it. I’m worried that the ESP hanged and won’t respond to the switch change. Thanks.