I can’t seem to understand why the ESPHome device I is listed in my routers wifi connections but ESPHome sees it as offline. The only way to fix it is to reboot the router but this happens everytime the ESP device loses power.
Is there a way to fix this?
In the EspHome addon log it shows: edit?configuration=sprinkler_system.yaml (0.0.0.0) seems as if the IP is messed…
Device code:
esphome:
name: sprinkler_system
platform: ESP8266
board: nodemcuv2
includes:
- shift_register_switch.h
libraries:
- [email protected]
wifi:
ssid: "wifi_spot"
password: "password"
switch:
- platform: custom
lambda: |-
std::vector<switch_::Switch *> switches;
for(int i = 0; i < 8; i++) {
auto zone_switch = new ShiftRegisterSwitch(i);
App.register_component(zone_switch);
switches.push_back(zone_switch);
}
return switches;
switches:
- name: "Sprinkler Zone 1"
inverted: yes
- name: "Sprinkler Zone 2"
inverted: yes
- name: "Sprinkler Zone 3"
inverted: yes
- name: "Sprinkler Zone 4"
inverted: yes
- name: "Sprinkler Zone 5"
inverted: yes
- name: "Sprinkler Zone 6"
inverted: yes
- name: "Sprinkler Zone 7"
inverted: yes
- name: "Sprinkler Zone 8"
inverted: yes
status_led:
pin: 16
# Enable logging
logger:
# Enable Home Assistant API
api:
ota:
text_sensor:
- platform: version
name: esphome_sprinkler_system_esphome_version
Try using a static IP in your configuration. You could also try pinging “sprinkler_system.local” to see if mDNS is working properly. mDNS is how esphome determines if devices are on/offline, be default.
And if the suggestion from iridris isn’t working, you can set the option status_use_ping in the settings of your ESPHome installation (howeve you installed it). This changes the way ESPHome is looking for your device (with IP and not mDNS).
I know this thread is old, but if someone encounters this problem do the following:
-assign a static IP address to the ESP Device then define its address in the config
-remove the line „name_add_mac_suffix” from the config
Since you sound really confident about the valid solutions, can you tell me why my online device is still showing offline?
I have status_use_ping: true, and the status detection in esphome dashboard worked fine until I added a second device. Connection to device works fine, including viewing the logs wirelessly (from the esphome dashboard, ironically). I have since removed one of the devices, but nothing changed.
Both devices were unique in every aspect, IP, hostname, api key and ota password, so I’m just clueless.
There is also another issue, where it shows the update button (and HA notification) when the device has an esp firmware update available, but it doesn’t go away after pushing the update to the device. So, I’m wondering if there are some general issues in the whole device status thing in esphome.
I am neither confident nor knowledgeable but I have had everything go wrong at one time or another… so far I have found a fix for everything … however I usually sleep on the problem… do some more reading and find a solution on here somewhere!! For the nodes which showed as offline… I think I didn’t pursue it but eventually a new flash, firmware update and reboot sorted it… and worse case was a complete nuke of the dashboard and folders. A post of your yaml might be a good place to start.
Clearly there is, because ESPHome devices do not work like any other device. They’re not cable of stable MDNS and according to forum, require static IPs, which is a silly to suggest.
I forgot to get back to this, because I eventually switched from home assistant OS to core + esphome and the issues just went away. Same configs and all, so my guess now is that it had something to do with containers. And yes, they had (and have) static IPs
I am seeing this more often lately. I haven’t tried this, but here is something I found:
By default, ESPHome utilizes mDNS to display the online/offline status of devices in the dashboard view. This method relies on the network’s ability to handle mDNS traffic effectively.
ESPHome can be configured to use pings to check the status of the device. This is done by setting status_use_ping: true in the device configuration.
This solved an issue I’ve been having for years! I always thought it was something specific on the ESP32 regarding MDNS - turns out it was the wifi power settings.
For the record, ESPHome documentation lists the power save mode default as NONE for ESP8266 and LIGHT for ESP32. Since my issue was always with the ESP32, flipping the mode to NONE on those fixed the issue.
This helped with showing online in esphome, but HA still sees it unavailable because it constantly flips between online and offline…
The device itself worked until the latest update and is still pingable on both mDNS and IP and I do use static IP on all my nodes
I can also still update it in esphome, but it refuses to get logs. Sometimes with just time out and other times socket errors.
Is there a way to downgrade esphome so I can revert back to a working version for this particular node? Because this is pretty frustrating and it is only this one that fails now after the update.
nevermind about the downgrade of ESPHome, I just restored the old version from the backup.
But it seems to have something to do with this latest particular version (2024.5.0) because after the rollback and flashing the device again, it straigh on came back online again.