Background:
My ESPHome setup has been stable for over a year, but recently (probably after an update), the Home Assistant ESPHome Integration has started intermittently changing the IP address when trying to connect to an ESPHome device. This causes the following error:
WARNING (MainThread) [aioesphomeapi.reconnect_logic] Can't connect to ESPHome API for pana-hz25tke @ 192.168.9.119: Error connecting to [AddrInfo(family=<AddressFamily.AF_INET: 2>, type=<SocketKind.SOCK_STREAM: 1>, proto=6, sockaddr=IPv4Sockaddr(address='192.168.9.119', port=6053))]: [Errno 113] Connect call failed ('192.168.9.119', 6053) (SocketAPIError)
The actual IP address for the ESPHome device is 192.168.9.106
, but for some reason, Home Assistant changes it and tries to call the device using the erroneous ip address 192.168.9.119
.
If I remove and then re-add the device in HA Integrations ESPHome using its correct IP address (not host name), it works but after some time, Home Assistant reverts to the incorrect address 192.168.9.119
. The same behavior if recompiling the device with a clean build.
The only workaround I’ve found so far is to use the ESPHome WiFi Component configuration variable use_address, see “ESPHome Device Config Snippet” below. As soon as I remove use_address
from the device config, the problem reoccurs.
Just to clarify:
- My home network is 192.168.100.xx, where I have the HA server, but the ESPHome device is on another location with a different subnet (192.168.9.xx) without IP multicast propagation, ie there’s no mDNS discovery relay between them.
- The IP address
192.168.9.119
has never been used before, neither by ESPHome nor by any other device on the network. - Since the device is on a different subnet, the ESPHome add-on is configured with the option
’status_use_ping: true’
which uses ICMP ping instead of mDNS to check if nodes are online.
Questions:
- Is there a way to troubleshoot why Home Assistant intermittently changes the IP address for the ESPHome device?
- Should I file a bug report for this issue, and if so, where?
Version Info:
- ESPHome: 2024.10.3
- Core: 2024.11.0
- Supervisor: 2024.11.2
- HA OS: 13.2
- Frontend: 20241106.0
ESPHome Device Config Snippet:
substitutions:
devicename: "pana-hz25tke"
long_devicename: "Panasonic HZ25TKE"
pcb_version: "LHA01-231102"
esphome:
name: "${devicename}"
# name_add_mac_suffix: false ## if 'false' use different names/hostnames for each device!
comment: "${long_devicename} ${pcb_version}"
project:
name: "esphome.pana-climate"
version: "${pcb_version}"
esp32:
board: wemos_d1_mini32
wifi:
manual_ip:
static_ip: 192.168.9.106
gateway: 192.168.9.254
subnet: 255.255.255.0
dns1: 192.168.9.254
use_address: 192.168.9.106