Now my problem is the high power consumption, the battery lasts only a few hours.
I found Deep Sleep Component — ESPHome but for me is not clear how I can wake up the ESP8266 from deep sleep on the moment when an event is detected using the motion detector.
I did some research… although esphome help page says that it’s impossible i wonder if it’s really so… since ESP8266 DOES have GPIO16 as wake-up defined… i’ll have to do some testing about this. But i’d appreciate any additional info, if anyone have some experience about this.
Sure, they are cheap, but 8266 are even cheaper, smaller… esp32 is kinda overkill just for, say, one button for doorbell…
I did some reading and testing. It works quite well - low state on rst pin wakes up device and sends state to HA.
BUT… of course there are “but’s”:
it’s a good idea to define one pin as high output and connect it to rst in order to prevent multiple resets. Say, if you press “wakeup” button three times in a row esp will reset 3 times and thus maybe not be able connect to HA (if you have, say, PIR connected to rst and it sends multiple signals out). There are samples on internet how to do it, there are diodes and resistors involved, in some cases even transistor.
you don’t have to connect gpio16 to rst if you don’t use timer wakeup. Gpio16 is nothing else but output from RTC timer and it resets esp if it’s connected. If not, then only wakeup option is button. But, i guess that occasional connection to HA is a good idea, just to know that sensor is ok, available and to send battery state.
delay is in the range of 3 to 5 seconds when using fast connect, which is logical since esp must connect to wifi. I guess that delay somewhat depends on router also.