This inquiry related to a device showing offline in ESPHome Device Builder but is online in HA.
Background:
Configured ESP32 with vibration sensor on my default 192.168.x.x network and everything operated as expected.
Changed the .yaml file to reflect the remote location SSID & Password and defined static address. In this case a 10.0.x.x address.
At the remote location the router will forward ports 6053, 3232, 8266 and 6080 to 80 to the device on the 10.0.x.x network.
Installed the new image to the ESP32 w/o any issues.
Reconfigured the device HA to reflect the 10.0.x.x network router external address.
Everything is working as expected on the HA side however ESPHome Device Builder shows the device as offline. I am assuming somewhere in the ESPHome Device Builder it is holding onto the that particular device’s original IP address or is using the 10.0.x.x address contained un the yaml file which cant be directly reached from the ESPHome device building but must go through the remote router ip address.
As far as I understand it esphome will use the static ip you set in the yaml to locate the device in its ui. Which would explain the issue.
There may be some code you could add, to let esphome use MDNS, or set the fixed IP in whatever dhcp server is running in the remote location, and remove the fixed IP from the code.
I had the same thought that the UI used the IP address I set in the yaml file. I tested that theory by changing the IP address in the yaml to reflect the router external IP address and saved the changes. Rebooted HA server just to make sure everything was fresh however I have the same results. It would be nice and maybe it is somewhere to see the IP addresses & ports used behind the scenes. would make these types of testing much easier. Guess I’ll just ignore it and add it to the investigation list. I have successfully updated the unit OTA using the devices web page. The only reason I am doing a vibration sensor at a remote location is that our camp took a 8" diameter Oak tree branch through the roof and we didn’t know it for some time. Thought I would attach the sensor to the roof rafter for hopefully a more timely notification.
Update: the “visit” definitely used the yaml defined IP address as well as the web_server port and I can successfully visit the remote site through ESPHome device builder devices card. However the device still shows off line. Just need to determine what the software references for the online/offline status. possibly as simple a ping or utilizes a port I am not forwarding. Maybe time to start sniffing some traffic.