Esphome 1 sensor (d1 Mini) becomes unavailable every few days, while 11 (nodemcu) others work flawlessly

I’ve been loving esphome and have 11 sensors that have worked flawlessly. I wanted to add a simple PIR sensor in my bathroom to trigger a LED candlelight to turn on.

Here’s the symptoms:

  1. 11 Sensors worked flawlessly (NodeMCU but not D1Mini)
  2. 1 Sensor, D1 Mini goes “became unavailable” every 1-2 days
  3. I can reboot the problem sensor, no change
  4. If I restart esphome service on homeassitant the sensor comes back immediately, and works for 1-2 days
  5. I’m able to connect to problem sensor with “esphome logs mbr-bath-pir.yaml” with no problem (even when homeassistant shows it “unavailable”
  6. Per one thread I set " power_save_mode: none" but this made no difference
  7. I replaced USB power supply, no difference, I’m only running a single PIR sensor, so power draw is very small

For me, since restarting the device make no difference, but restarting esphome service fixes it everytime, I’m not convinced it’s a WIFI problem. (And I’m always able to reach the device via WIFI)

Perhaps it’s related to this is my only D1 Mini with esphome, other devices are nodemcu’s.
I can replace it with a nodemcu, but thought it might worthwhile to troubleshoot this further to help others. I’m open to changing log values or other parameters.

I’ve include screenshots of my logs, and configuration.

Thank you for any help with this great product!


Capture2
Capture3

looks like wifi problem, -70db is in no reception range
my wemos d1 minis esphome online for year without issues

What does this mean? The esphome binary has nothing to do with the connection between your esp device and home assistant. esphome programs the esp device.

Home assistant creates the connection between the esp device and home assistant. Remove esphome and it will not make a scrap of difference to whether your esp device can connect to home assistant. You could program your esp device 1,000 miles away, and connect it to your home assistant when you got home.

Yep. That’s the problem. It’s certainly marginal. And keep in mind that this is the signal level received by the ESP device. The level received at the wifi AP (Access Point) may be lower due to the ESP device’s small PCB antenna not radiating as efficiently as the AP.

-30 dBm: This is the maximum signal strength. If you have this measurement, you are likely standing right next to the access point.

-50 dBm: This is considered an excellent signal strength.

-60 dBm: This is a good signal strength.

-67 dBm: This is a reliable signal strength. This is the minimum for any online services that require a reliable connection and Wi-Fi signal strength.

-70 dBm: This is not a strong signal strength. You may be able to check your email.

-80 dBm: This is an unreliable signal strength. You may be able to connect to your network, but you will not support most online activity.

-90 dBm: This is a bad signal strength. You are not likely to connect to internet at this level.

Ideally, you are looking to fall in the -60 dBm to -50 dBm range (since -30 dBm is unlikely). A signal strength at -67 dBm will work for a while, but this is the minimum strength you will want before your connection starts to suffer.

https://www.screenbeam.com/wifihelp/wifibooster/wi-fi-signal-strength-what-is-a-good-signal/

-67dBm and better should be fine for IoT devices. -67dBm is twice as powerful as -70dBm (double power for every 3dB).