Device shows Online but can't connect

I have a Wemos D1 Mini with ESPhome on it. The D1 is powered up and connected to my WiFi network (confirmed in my router logs), it also shows as “online” on the ESPhome page in HA. But, the sensor shows as unavailable and the logs in ESPhome show that it can’t connect. I’ve tried rebooting the D1 and HA but that didn’t fix it. Any idea what is wrong?



3

Here is my code

esphome:
  name: kass_noise_sensor
  platform: ESP8266
  board: d1_mini

wifi:
  ssid: "Too Fly For My WiFi"
  password: "xxxxxxxxxx"
  #Static IP
  manual_ip:
    static_ip: 192.168.1.32
    gateway: 192.168.1.1
    subnet: 255.255.255.0
  #Turn Off Power Save Mode
  power_save_mode: none

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Kass Noise Sensor"
    password: "u6S1JwcgHaYd"

captive_portal:

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:

# DEBOUNCED FOR 1S BECAUSE THE TRIGGER PERIOD IS VERY SHORT
binary_sensor:
  - platform: gpio
    pin: D2
    name: "Kass Noise Sensor"
    filters:
      - delayed_off: 20s
      - delayed_on: 2s

I’ve got the exact same issue a few days ago… and after a couple of reboots everything got back to normal…
Not sure what was the error nor the “solution”…
Wish you the same luck reboot I got!

Thanks for the reply, I’ve now done 4 reboots without it correcting itself.

You should have a dns server set up in your wifi settings.

But nevertheless it is no connecting to your wifi anyway. Too far away? Fixed IP address already taken? Password wrong?

If you connect it by usb you’ll get a log which should help.

Its connected to wifi. I can ping it and I see it in my router device list. I’ve also reserved the IP.

I have the same problem.

My devices were working fine, then I gave them a DHCP reservation, so the IP address changed.
In ESPHome it shows as online and successfully connects, here you can see that it has the new IP.
But in HomeAssistant, it now shows ass Unavailable.

I’ve rebooted the ESPHome and HomeAssistant containers, but still no luck.

Then I rebooted the actual host (RaspberryPi 4 with Hass.io), and after it booted everything was working.

I guess somewhere it was caching the old IP or something.

I have this issue. I noticed it happens some times when the wifi goes out. The ESP Home nodes reconnect to the wifi, but remain unavailable in Home Assistant. Rebooting the ESP or HA don’t help. Removing the integration from HA and adding it right back in fixes the issue.

This resolved itself. I’m not sure what the issue was.

i didnt have this issue until i made an os update sveral versions ago, it is very clear to me that this happens in my case when i load hd videos on any other pc in the network, it would also happen when i use motioneye on high def camera streams, unfortunately the only way arround is to downscale video dimensions, i would very much like to stream higher definition videos but my esp devices disconect and even setting back a lower deffinition would maintain devices off even when they are clearly available through each esp web server. i was lately having an issue with my esp devices disconecting the hass api an hour after rebooting the ras and also the system started to crash leaving me no option but flashing a fresh os this time into a ssd drive through usb3.0, the system works very snappy now, but when i tested the high resolution videos from motioneye, several devices disappear from the lovelace panel and not turning back even when the video resolution was brought back down only getting fixed after a ras reboot. it usually happens to the farther devices connected to a wifi connection. is there a way maybe to elevate wifi power on esps? or would we have to go and get more repeaters for specificly low db signal devices? it may be a simple thing given that devices remain available through their web server, and rebooting esps just wont do the trick but rather rebooting the hass frequently thus making it unstable for many users that only use micro sds and also maybe to the ones using ssds as rebooting is just giving the system an excuse for failure

sometimes rebooting the fiber modem helps, i also had to remove offline devices from the modems list and that helped getting more consistent connections even for phones or pcs, something important to note is that the modem and my repeaters are not the expensive types, but work somewhat okay, is it maybe related to this? i wouldnt mind buying some more expensive wifi hotspots if it worked. my modem is a HG8145V5 huawei and the repeater is a Xiaomi Mi Wi-Fi Range Extender Pro and usually work great with pc’s and phones. i also bought an unbranded repeater that is utter garbage and goes offline 10 minutes after setting it up needless to say i retired those repeaters long ago