Latest Core Update to 25.4.2 has broken my Sonoff POW R3

Hi all,
Just rolled in the latest Core update. Everything appeared to go well but when I went to switch on my immersion heater to take advantage of the solar - found it was not available. Its controlled by a Sonoff POW S3. The exact report in the log that preceded the failure was the update.
I am now getting the dreaded :slight_smile:
[Errno 111] Connect call failed (‘192.168.1.xxx’, 6053) (SocketAPIError)

The POW R3 is still on the network and I can ping it successfully.
There was no indication of breaking changes in the changelog so I am a bit stumped as to what happened.

Here is my Yaml

substitutions:
  device_name: sonoff-pow-r3
  device_description: Sonoff Pow R3
  friendly_name: Sonoff Pow R3

esphome:
  name: ${device_name}
  comment: ${device_description}

esp8266:
  board: esp01_1m
  restore_from_flash: true

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  power_save_mode: light

  ap:

captive_portal:

api:
  encryption:
    key: "Y/uzwX2gJQgJ/5ATkwrz8TZIyg1Bdtobq3jAJmHmRUk="


ota:
  platform: esphome
  password: !secret wifi_password

logger:
  baud_rate: 0

uart:
  tx_pin: GPIO1
  rx_pin: GPIO3
  baud_rate: 4800
  parity: EVEN

switch:
  - platform: restart
    name: ${friendly_name} restart
    on_turn_on:
      - switch.turn_off : relay
    restore_mode: ALWAYS_OFF

  - platform: gpio
    name: "${friendly_name} power status"
    pin: GPIO12
    inverted: true
    id: relay    

status_led:
  pin:
    number: GPIO13
    inverted: yes

text_sensor:
  - platform: version
    name: ${friendly_name} ESPHome Version
    hide_timestamp: true

  - platform: template
    name: ${friendly_name} Uptime
    id: uptime_human
    icon: mdi:clock-start

sensor:
  - platform: wifi_signal
    id: wifi_sig
    name: ${friendly_name} signal

  - platform: uptime
    name: ${friendly_name} Uptime Sensor
    id: uptime_sensor
    on_raw_value:
      then:
        - text_sensor.template.publish:
            id: uptime_human
            state: !lambda |-
              int seconds = round(id(uptime_sensor).raw_state);
              int days = seconds / (24 * 3600);
              seconds = seconds % (24 * 3600);
              int hours = seconds / 3600;
              seconds = seconds % 3600;
              int minutes = seconds /  60;
              seconds = seconds % 60;
              return (
                (days ? to_string(days) + "d " : "") +
                (hours ? to_string(hours) + "h " : "") +
                (minutes ? to_string(minutes) + "m " : "") +
                (to_string(seconds) + "s")
              ).c_str();

  - platform: cse7766
    #update_interval: 5s
    voltage:
      name: "${friendly_name} Voltage"
    current:
      name: "${friendly_name} Current"
    power:
      name: "${friendly_name} Power"
    energy:
      name: "${friendly_name} Energy"

binary_sensor:
  - platform: status
    name: ${friendly_name} HA connection status

  - platform: gpio
    pin:
      number: GPIO0
      mode: INPUT_PULLUP
      inverted: True
    id: button
    internal: True
    on_press:
      - switch.toggle: relay

I know from experience that getting this back online is not going to be fun and will probably mean dismantling the enclosure and performing a serial reflash.

Anyone got any pointers or advice.

Stephen

I am not sure what you are doing. There doesn’t seem to be a 25.4.3 or even a 2025.4.3.

probably this one

nope, misread the number

it’s still a mystery.

Every time you update there is a non zero chance the update will fail (even if there are no changes, let alone non-breaking ones).

This is one of the reasons I add a web server to all my devices (which is not without its own issues). I like to see what the device thinks is happening.

Updating the esphome builder does not update the esp device.

It was an update to HomeAssistant core, and this is not an infrequent consequence of updating core that some ESP Home device stops responding after the Core update.
I am sort of resigned to the idea that I am going to have to reflash this device at this stage (not fun as I am going to have to strip the whole box out of the airing cupboard), but its not a given that I will get HA to recognise it with a flash. In the past I have always had to use the cmd line version of ESPHome to flash the software once the firmware heads south in this way.

You can’t even tell us what core version you are using.

As i said originally I flashed Core 2025.4.2
I mistakenly said Core 2025.4.3

You could revert to what worked.

I tried restoring a backup but its still broken (and that itself caused a few other issues with an NSPanel).
I am assuming that what has somehow happened is that HA has an incorrect API encryption key or has issues with the key that is on the Sonoff.
I have had this happen before where a OTA flash fails and the only way to get the device back is to do a serial flash, I was just hoping to avoid that given the physical location of the device. I have seen other reports of similar things happening after a HA Core update and people never seem to get to the bottom of what actually happened.

I am starting to think that I am going to stop accepting any upgrades and freeze my install.

I didn’t mention backups.

Also I thought you had updated core, now you’re talking about a failed ota update.

other related issues, looks like there could be a few reasons.

This just reinforces my decision to stick with MQTT and a web server on each device. The API connection is likely great when it works, just not so much when it doesn’t and impossible to debug why.

1 Like

Exactly what I am finding.
This happens quite a bit and its fairly random what triggers it with no way back other than serial flashing when it happens. An OTA flash doesn’t rewrite the API encryption key on the device and HA tends to keep firmly onto the first code that was flashed on to the ESP device so if you change the code in any fundamental way (like changing the encryption key) it doesn’t update it on the device and it stops responding. However other things upset it as well.
This is about the third time this has happened to me with different ESP devices and its always a pain to recover from. I have done everything through ESPHome apart from a few Bluetooth temp sensors, and its always the flakeyist part of HA.