shoog
(shoog)
April 14, 2025, 3:46pm
1
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
[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
nickrout
(Nick Rout)
April 14, 2025, 8:15pm
2
I am not sure what you are doing. There doesn’t seem to be a 25.4.3 or even a 2025.4.3.
neel-m
(Neel Malik)
April 14, 2025, 8:25pm
4
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.
nickrout
(Nick Rout)
April 14, 2025, 8:42pm
5
Updating the esphome builder does not update the esp device.
shoog
(shoog)
April 14, 2025, 8:55pm
6
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.
nickrout
(Nick Rout)
April 14, 2025, 9:02pm
7
You can’t even tell us what core version you are using.
shoog
(shoog)
April 14, 2025, 9:15pm
8
As i said originally I flashed Core 2025.4.2
I mistakenly said Core 2025.4.3
nickrout
(Nick Rout)
April 14, 2025, 9:16pm
9
You could revert to what worked.
shoog
(shoog)
April 14, 2025, 9:22pm
10
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.
nickrout
(Nick Rout)
April 14, 2025, 9:52pm
11
I didn’t mention backups.
Also I thought you had updated core, now you’re talking about a failed ota update.
neel-m
(Neel Malik)
April 14, 2025, 11:55pm
12
opened 06:47AM - 18 Feb 22 UTC
### The problem
Device is schown online in esphome, but I cannot connect wirl… ess for logging.
It has been working fine until I updated it today with esphome 2022.2.2 and 2022.2.3
### Which version of ESPHome has the issue?
2022.2.3
### What type of installation are you using?
Home Assistant Add-on
### Which version of Home Assistant has the issue?
2022.2.3
### What platform are you using?
ESP8266
### Board
wemos d1 mini
### Component causing the issue
bme680??
### Example YAML snippet
```yaml
esphome:
name: dachschlazitemp2
platform: ESP8266
board: d1_mini
substitutions:
friendly_name: "Dach SchlaZi2"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_pswd
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "DachschlazitempFbH"
password: !secret esp_ap_fb
captive_portal:
# Enable logging
logger:
# level: DEBUG
# level: VERBOSE
# Enble Home Assistant API
api:
password: !secret esp_api_pswd
encryption:
key: !secret esp_api_encrypt_key
ota:
password: !secret esp_ota_pswd
#web_server:
# port: 80
# auth:
# username: !secret esp_wsrv_usr
# password: !secret esp_wsrv_pswd
#deep_sleep:
# run_duration: 30s
# sleep_duration: 5min
i2c:
- id: bus_a
sda: 04 #D2
scl: 05 #D1
scan: True
# Library bsec bme680 python in den config/esphome/custom_components ordner kopieren
# https://github.com/trvrnrth/esphome-bsec-bme680
# neu external component am 08.11.2021 hinzugefügt
#external_components:
# - source: github://trvrnrth/esphome-bsec-bme680
bme680_bsec:
# i2c address override (default is 0x76)
address: 0x77
# Temperature offset if device is in enclosure and reads too high (default is 0)
temperature_offset: 0.0
# Mode for IAQ sensors if device is mobile (default is static)
iaq_mode: static
# Interval at which to save BSEC state (default is 6 hours)
state_save_interval: 6h
# Sample rate
# -----------
# Available options:
# - lp (low power - samples every 3 seconds)
# - ulp (ultra low power - samples every 5 minutes)
# Default: lp
sample_rate: ulp
time:
- platform: homeassistant
id: homeassistant_time
sensor:
- platform: uptime
name: ${friendly_name} Uptime sec
id: uptime_sec
update_interval: 60s
- platform: wifi_signal
name: "${friendly_name} Wifi"
update_interval: 60s
## bme680_bsec
- platform: bme680_bsec
temperature:
name: "${friendly_name} Temp"
id: temp
sample_rate: lp
filters:
- median
pressure:
name: "${friendly_name} Luftdruck"
id: druck
sample_rate: lp
unit_of_measurement: "hPa"
filters:
- lambda: >-
return x / powf(1.0 - (415 / 44330.0), 5.255);
humidity:
name: "${friendly_name} Luftfeuchtigkeit"
id: feuchte
sample_rate: lp
filters:
- median
gas_resistance:
name: "${friendly_name} CO2 Widerstand"
id: gas
filters:
- median
iaq:
name: "${friendly_name} BME680 IAQ"
id: iaq_range
filters:
- median
co2_equivalent:
name: "${friendly_name} BME680 CO2 Equivalent"
filters:
- median
breath_voc_equivalent:
name: "${friendly_name} Breath VOC Equivalent"
filters:
- median
iaq_accuracy:
# IAQ accuracy as a numeric value of 0, 1, 2, 3
name: "${friendly_name} BME680 Numeric IAQ Accuracy"
## Berechnungen
- platform: template
name: "${friendly_name} Absolute Feuchtigkeit"
lambda: |-
const float mw = 18.01534; // molar mass of water g/mol
const float r = 8.31447215; // Universal gas constant J/mol/K
return (6.112 * powf(2.718281828, (17.67 * id(temp).state) /
(id(temp).state + 243.5)) * id(feuchte).state * mw) /
((273.15 + id(temp).state) * r); // in grams/m^3
accuracy_decimals: 2
update_interval: 60s
icon: 'mdi:water'
unit_of_measurement: 'g/m³'
- platform: template
name: "${friendly_name} Luftdruck auf Meereshöhe"
lambda: |-
const float STANDARD_ALTITUDE = 415; // in meters, see note
return id(druck).state / powf(1 - ((0.0065 * STANDARD_ALTITUDE) /
(id(temp).state + (0.0065 * STANDARD_ALTITUDE) + 273.15)), 5.257); // in hPa
update_interval: 60s
unit_of_measurement: 'hPa'
- platform: template
name: "${friendly_name} Taupunkt"
lambda: return (243.5*(log(id(feuchte).state/100)+((17.67*id(temp).state)/
(243.5+id(temp).state)))/(17.67-log(id(feuchte).state/100)-
((17.67*id(temp).state)/(243.5+id(temp).state))));
update_interval: 60s
unit_of_measurement: '°C'
binary_sensor:
- platform: status
name: "${friendly_name} Temp Status"
text_sensor:
# - platform: wifi_info
# ip_address:
# name: ESP IP Address
# ssid:
# name: ESP Connected SSID
# bssid:
# name: ESP Connected BSSID
# mac_address:
# name: ESP Mac Wifi Address
# bme680_sec
- platform: bme680_bsec
iaq_accuracy:
name: "${friendly_name} BME680 IAQ Accuracy"
- platform: template
name: ${friendly_name} Uptime
lambda: |-
int seconds = (id(uptime_sec).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 { (String(days) +"d " + String(hours) +"h " + String(minutes) +"m "+ String(seconds) +"s").c_str() };
icon: mdi:clock-start
update_interval: 65s
- platform: template
name: "${friendly_name} Luftqualität"
icon: "mdi:air-filter"
lambda: |-
ESP_LOGD("main", "Aktueller Wert %d", id(iaq_range));
if ((id(iaq_range).state <= 50.0 )) {
return {"sehr gut"};
}
else if ((id(iaq_range).state > 50.00) && (id(iaq_range).state <= 100.0)) {
return {"gut"};
}
else if ((id(iaq_range).state > 100.0) && (id(iaq_range).state <= 150.0)) {
return {"Leicht verschmutz"};
}
else if ((id(iaq_range).state > 150.0) && (id(iaq_range).state <= 200.0)) {
return {"mäßig verschmutz"};
}
else if ((id(iaq_range).state > 200.0) && (id(iaq_range).state <= 250.0)) {
return {"stark verschmutzt"};
}
else if ((id(iaq_range).state > 250.0) && (id(iaq_range).state <= 350.0)) {
return {"extrem verschmutz"};
}
else if ((id(iaq_range).state > 350.00)) {
return {"gefährlich verschmutzt"};
}
return {};
update_interval: 60s
```
### Anything in the logs that might be useful for us?
INFO Reading configuration /config/esphome/dachschlazitemp2.yaml...
INFO Detected timezone 'Europe/Berlin'
INFO Starting log output from dachschlazitemp2.local using esphome API
WARNING Can't connect to ESPHome API for dachschlazitemp2.local: Error connecting to ('192.168.88.90', 6053): [Errno 111] Connect call failed ('192.168.88.90', 6053)
INFO Trying to reconnect to dachschlazitemp2.local in the background
### Additional information
_No response_
I’ve been doing a bit more experimenting - it seems if I provision a device with the bare minimum, eg OTA, WiFi, Serial port , it’ll talk to the API without issue. I’m trying to get an LD2420 presence sensor working. What flavour of device are you having issues with?
opened 06:45PM - 02 Mar 22 UTC
closed 12:09AM - 26 Aug 22 UTC
### The problem
The Home Assistant API keeps closing the connection, see the … log output. Also, the integration is not detected in Home Assistant. When manually adding the integration, all entities are unavailable.
What I tried so far:
- Setting WiFi channel width to auto, 20MHz or 40MHz (based on another issue I found)> no effect
- Specifying an API password (or not) > no effect
- Making a very, very barebone new device (see YAML snippet) > no effect
- Defining the eps32 component like below > no effect
- Adding `version` to the frame variable definition (e.g. recommended, latest) > no effect
```yaml
esphome:
name: anothertest
esp32:
board: esp32dev
framework:
type: arduino
```
### Which version of ESPHome has the issue?
2022.2.6
### What type of installation are you using?
Home Assistant Add-on
### Which version of Home Assistant has the issue?
2022.2.9
### What platform are you using?
ESP32
### Board
DEVKIT V1
### Component causing the issue
N/A
### Example YAML snippet
```yaml
esphome:
name: esp32-test3
platform: ESP32
board: esp32dev
# Enable logging
logger:
# Enable Home Assistant API
api:
ota:
password: !secret ota_pass
wifi:
ssid: !secret wifi_ssid1
password: !secret wifi_pass1
power_save_mode: none
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Esp32-Test3 Fallback Hotspot"
password: !secret fallback_wifi_pass
captive_portal:
sensor:
- platform: uptime
name: "ESP32-Test Uptime Sensor"
update_interval: 20s
- platform: wifi_signal
name: "ESP32-Test WiFi Signal Sensor"
update_interval: 20s
```
### Anything in the logs that might be useful for us?
```txt
[19:28:06][I][app:102]: ESPHome version 2022.2.6 compiled on Mar 2 2022, 16:13:46
[19:28:06][C][wifi:491]: WiFi:
[19:28:06][C][wifi:353]: Local MAC: 24:0A:C4:31:C2:9C
[19:28:06][C][wifi:354]: SSID: [redacted]
[19:28:06][C][wifi:355]: IP Address: 192.168.178.23
[19:28:06][C][wifi:357]: BSSID: [redacted]
[19:28:06][C][wifi:358]: Hostname: 'esp32-test3'
[19:28:06][C][wifi:360]: Signal strength: -46 dB ▂▄▆█
[19:28:06][C][wifi:364]: Channel: 7
[19:28:06][C][wifi:365]: Subnet: 255.255.255.0
[19:28:06][C][wifi:366]: Gateway: 192.168.178.1
[19:28:06][C][wifi:367]: DNS1: 192.168.178.1
[19:28:06][C][wifi:368]: DNS2: 0.0.0.0
[19:28:07][C][logger:233]: Logger:
[19:28:07][C][logger:234]: Level: DEBUG
[19:28:07][C][logger:235]: Log Baud Rate: 115200
[19:28:07][C][logger:236]: Hardware UART: UART0
[19:28:07][C][uptime.sensor:031]: Uptime Sensor 'ESP32-Test Uptime Sensor'
[19:28:07][C][uptime.sensor:031]: State Class: 'total_increasing'
[19:28:07][C][uptime.sensor:031]: Unit of Measurement: 's'
[19:28:07][C][uptime.sensor:031]: Accuracy Decimals: 0
[19:28:07][C][uptime.sensor:031]: Icon: 'mdi:timer-outline'
[19:28:07][C][captive_portal:144]: Captive Portal:
[19:28:07][C][mdns:084]: mDNS:
[19:28:07][C][mdns:085]: Hostname: esp32-test3
[19:28:07][C][ota:085]: Over-The-Air Updates:
[19:28:07][C][ota:086]: Address: esp32-test3.local:3232
[19:28:07][C][ota:089]: Using Password.
[19:28:07][C][api:138]: API Server:
[19:28:07][C][api:139]: Address: esp32-test3.local:6053
[19:28:07][C][api:143]: Using noise encryption: NO
[19:28:07][C][wifi_signal.sensor:009]: WiFi Signal 'ESP32-Test WiFi Signal Sensor'
[19:28:07][C][wifi_signal.sensor:009]: Device Class: 'signal_strength'
[19:28:07][C][wifi_signal.sensor:009]: State Class: 'measurement'
[19:28:07][C][wifi_signal.sensor:009]: Unit of Measurement: 'dBm'
[19:28:07][C][wifi_signal.sensor:009]: Accuracy Decimals: 0
[19:28:10][D][sensor:125]: 'ESP32-Test Uptime Sensor': Sending state 12.65100 s with 0 decimals of accuracy
[19:28:21][D][sensor:125]: 'ESP32-Test WiFi Signal Sensor': Sending state -48.00000 dBm with 0 decimals of accuracy
[19:28:30][D][sensor:125]: 'ESP32-Test Uptime Sensor': Sending state 32.64700 s with 0 decimals of accuracy
[19:28:36][D][api:102]: Accepted ::FFFF:C0A8:B2A0
[19:28:36][W][api.connection:083]: Home Assistant 2022.2.9 (::FFFF:C0A8:B2A0): Connection closed
[19:28:41][D][sensor:125]: 'ESP32-Test WiFi Signal Sensor': Sending state -49.00000 dBm with 0 decimals of accuracy
[19:28:50][D][sensor:125]: 'ESP32-Test Uptime Sensor': Sending state 52.64700 s with 0 decimals of accuracy
[19:29:01][D][sensor:125]: 'ESP32-Test WiFi Signal Sensor': Sending state -47.00000 dBm with 0 decimals of accuracy
[19:29:10][D][sensor:125]: 'ESP32-Test Uptime Sensor': Sending state 72.64700 s with 0 decimals of accuracy
[19:29:21][D][sensor:125]: 'ESP32-Test WiFi Signal Sensor': Sending state -47.00000 dBm with 0 decimals of accuracy
[19:29:30][D][sensor:125]: 'ESP32-Test Uptime Sensor': Sending state 92.64800 s with 0 decimals of accuracy
[19:29:36][D][api:102]: Accepted ::FFFF:C0A8:B2A0
[19:29:36][W][api.connection:083]: Home Assistant 2022.2.9 (::FFFF:C0A8:B2A0): Connection closed
[19:29:41][D][sensor:125]: 'ESP32-Test WiFi Signal Sensor': Sending state -47.00000 dBm with 0 decimals of accuracy
[19:29:50][D][sensor:125]: 'ESP32-Test Uptime Sensor': Sending state 112.64700 s with 0 decimals of accuracy
[19:30:01][D][sensor:125]: 'ESP32-Test WiFi Signal Sensor': Sending state -47.00000 dBm with 0 decimals of accuracy
[19:30:10][D][sensor:125]: 'ESP32-Test Uptime Sensor': Sending state 132.64700 s with 0 decimals of accuracy
[19:30:21][D][sensor:125]: 'ESP32-Test WiFi Signal Sensor': Sending state -47.00000 dBm with 0 decimals of accuracy
[19:30:30][D][sensor:125]: 'ESP32-Test Uptime Sensor': Sending state 152.64999 s with 0 decimals of accuracy
[19:30:36][D][api:102]: Accepted ::FFFF:C0A8:B2A0
[19:30:36][W][api.connection:083]: Home Assistant 2022.2.9 (::FFFF:C0A8:B2A0): Connection closed
[19:30:41][D][sensor:125]: 'ESP32-Test WiFi Signal Sensor': Sending state -47.00000 dBm with 0 decimals of accuracy
[19:30:50][D][sensor:125]: 'ESP32-Test Uptime Sensor': Sending state 172.64700 s with 0 decimals of accuracy
[19:31:01][D][sensor:125]: 'ESP32-Test WiFi Signal Sensor': Sending state -47.00000 dBm with 0 decimals of accuracy
[19:31:10][D][sensor:125]: 'ESP32-Test Uptime Sensor': Sending state 192.64700 s with 0 decimals of accuracy
[19:31:21][D][sensor:125]: 'ESP32-Test WiFi Signal Sensor': Sending state -46.00000 dBm with 0 decimals of accuracy
[19:31:30][D][sensor:125]: 'ESP32-Test Uptime Sensor': Sending state 212.64999 s with 0 decimals of accuracy
[19:31:36][D][api:102]: Accepted ::FFFF:C0A8:B2A0
[19:31:36][W][api.connection:083]: Home Assistant 2022.2.9 (::FFFF:C0A8:B2A0): Connection closed
```
### Additional information
Several of the things I tried where based on issue #3075, as the behavior of the problem was very similar, but all options listed there did not solve the issue so far.
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
shoog
(shoog)
April 15, 2025, 10:22am
13
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.