ESPHome problems updating over the air

Hi,

I have few Sonoff Slampher devices that are running using the common code:

#The substitution block has all the configurable details
substitutions:
  name_of_board: bulbholder01
  ota_password: !secret bulbholder01_ota
  api_password: !secret bulbholder01_api_password
  api_encryption_key: !secret bulbholder01_api_encryption
  ip_address: !secret ip_address_bulbholder01

############################################
#YOU SHOULD NOT NEED TO EDIT BELOW THIS LINE
############################################
packages:
  wifi_settings: !include common/basic_components.yaml
  basics: !include common/basic_sensors.yaml
  device_settings: !include common/slampher.yaml

So the only part I need to change for each device are the values in secrets file and all the devices (except one) are working fine. The one that has problem is showing weird symptoms:

  1. It works in HA i.e. I can toggle the light on/off and automations are working
  2. If I delete this device from ESPHome integration and it is detected right back in, the API password and key are working as it gets integrated back in like a charm
  3. But when I try to update the device using ESPHome web UI, I get following error:
========================= [SUCCESS] Took 3.38 seconds =========================
INFO Successfully compiled program.
INFO Connecting to 192.168.2.32
ERROR Connecting to 192.168.2.32:8266 failed: [Errno 113] No route to host

And in the HA system logs, I see few more details such as:

2022-08-16 23:55:42,941 INFO Running command 'esphome --dashboard run /config/esphome/bulbholder01.yaml --device OTA'
2022-08-16 23:55:46,504 INFO 304 GET /devices (0.0.0.0) 7.45ms
2022-08-16 23:55:50,712 INFO Process exited with return code 1

I am unable to understand why this one device is behaving so odd than the rest that are using the same code base.

Any pointers to resolve OTA are welcome!

Might recommend having it plugged into either HA or a PC where you can monitor the USB Serial output.

The times where I have had problems updating, the device was resetting unbeknownst to me.