Connection loss on some devices after power cut

Hello,

I have a strange one here. I have 7 shutter switches running ESPHome (beken chips). All the devices have the same configuration.

Several times now, after a power outage, most devices come back fine in HA except a couple of them, where I have to connect to the fallback network and reconnect the WiFi by entering the ssid/password (which it knows).

One is upstairs and the other one is downstairs, not above each other. I have a unifi ap upstairs and another one downstairs that is meshed. The failing device appears connected in the unifi controller and replies to ping.

The device is unreachable in ESPHome Dashboard. It seems to be a mDNS resolution issue as the IP is reachable but I can’t ping the name. Also the below fails:

dig -p 5353 .0.0.251 voletsalonfenetre.local

It tried to edit the local device config to access the log by forcing the IP without mDNS resolution but it is not working. I can’t (don’t want to) read the logs with serial because the switches are in the wall.

wifi:
  use_address: 192.168.1.128
  ...
mdns:
  disabled: true

WARNING Can't connect to ESPHome API for voletsalonfenetre @ 192.168.1.128: Error connecting to [AddrInfo(family=<AddressFamily.AF_INET: 2>, type=<SocketKind.SOCK_STREAM: 1>, proto=6, sockaddr=IPv4Sockaddr(address='192.168.1.128', port=6053))]: [Errno 111] Connect call failed ('192.168.1.128', 6053) (SocketAPIError)

Looking up this error message didn’t yield any results. The device is listening on port 80 but not on port 6053.

$ nc -zv 192.168.1.128 80
Connection to 192.168.1.128 port 80 [tcp/http] succeeded!

$ nc -zv 192.168.1.128 6053
nc: connectx to 192.168.1.128 port 6053 (tcp) failed: Connection refused

I suspect that setting a static IP to the devices and adding them via IP to HA might resolve the issue but I would like to find a resolution to this problem. Although not even sure as it’s not listening on 6053 so I don’t know which is the cause and the symptom.

I have kept one device in a broken state as I don’t want to “spoil the crime scene”.