Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ESPHome 2024.5.0 + D1 Mini + LD2410 = The connection dropped immediately after encrypted hello #5790

Closed
stickpin opened this issue May 15, 2024 · 102 comments

Comments

@stickpin
Copy link

stickpin commented May 15, 2024

The problem

The issue starts to happen after upgrading to ESPHome 2024.5.0.
My LD2410 presence sensors are working fine with version 2024.4.2.

The firmware compilation log is attached: logs_bedroom-presence-sensor_run.txt

I will try to rollback now and see if i will be able to recover the sensors.

Which version of ESPHome has the issue?

2024.5.0

What type of installation are you using?

Home Assistant Add-on

Which version of Home Assistant has the issue?

2024.5.3

What platform are you using?

ESP8266

Board

D1 Mini (https://www.amazon.de/-/en/gp/product/B0754W6Z2F/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1)

Component causing the issue

No response

Example YAML snippet

esphome:
  name: kitchen-presence-sensor
  friendly_name: Kitchen Presence Sensor

esp8266:
  board: esp01_1m

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "key"

ota:
  password: "password"

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

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Kitchen-Presence-Sensor"
    password: "password"

captive_portal:

uart:
  id: uart_bus
  tx_pin: GPIO01
  rx_pin: GPIO03
  baud_rate: 256000
  parity: NONE
  stop_bits: 1

ld2410:

binary_sensor:
  - platform: ld2410
    has_target:
      name: Presence
    has_moving_target:
      name: Moving Target
    has_still_target:
      name: Still Target

sensor:
  - platform: wifi_signal
    name: "WiFi Signal"
    id: wifi_signal_sensor
    update_interval: 60s
  - platform: ld2410
    moving_distance:
      name : Moving Distance
    still_distance:
      name: Still Distance
    moving_energy:
      name: Move Energy
    still_energy:
      name: Still Energy
    detection_distance:
      name: Detection Distance
    g0:
      move_energy:
        name: g0 move energy
      still_energy:
        name: g0 still energy
    g1:
      move_energy:
        name: g1 move energy
      still_energy:
        name: g1 still energy
    g2:
      move_energy:
        name: g2 move energy
      still_energy:
        name: g2 still energy
    g3:
      move_energy:
        name: g3 move energy
      still_energy:
        name: g3 still energy
    g4:
      move_energy:
        name: g4 move energy
      still_energy:
        name: g4 still energy
    g5:
      move_energy:
        name: g5 move energy
      still_energy:
        name: g5 still energy
    g6:
      move_energy:
        name: g6 move energy
      still_energy:
        name: g6 still energy
    g7:
      move_energy:
        name: g7 move energy
      still_energy:
        name: g7 still energy
    g8:
      move_energy:
        name: g8 move energy
      still_energy:
        name: g8 still energy

switch:
  - platform: ld2410
    engineering_mode:
      name: "engineering mode"

number:
  - platform: ld2410
    timeout:
      name: timeout
    max_move_distance_gate:
      name: max move distance gate
    max_still_distance_gate:
      name: max still distance gate
    g0:
      move_threshold:
        name: g0 move threshold
      still_threshold:
        name: g0 still threshold
    g1:
      move_threshold:
        name: g1 move threshold
      still_threshold:
        name: g1 still threshold
    g2:
      move_threshold:
        name: g2 move threshold
      still_threshold:
        name: g2 still threshold
    g3:
      move_threshold:
        name: g3 move threshold
      still_threshold:
        name: g3 still threshold
    g4:
      move_threshold:
        name: g4 move threshold
      still_threshold:
        name: g4 still threshold
    g5:
      move_threshold:
        name: g5 move threshold
      still_threshold:
        name: g5 still threshold
    g6:
      move_threshold:
        name: g6 move threshold
      still_threshold:
        name: g6 still threshold
    g7:
      move_threshold:
        name: g7 move threshold
      still_threshold:
        name: g7 still threshold
    g8:
      move_threshold:
        name: g8 move threshold
      still_threshold:
        name: g8 still threshold

button:
  - platform: ld2410
    factory_reset:
      name: "factory reset"
    restart:
      name: "restart"
    query_params:
      name: query params
  - platform: restart
    name: "Restart"

text_sensor:
  - platform: ld2410
    version:
      name: "firmware version"

select:
  - platform: ld2410
    distance_resolution:
      name: "distance resolution"
    baud_rate:
      name: "baud rate"

Anything in the logs that might be useful for us?

INFO ESPHome 2024.5.0
INFO Reading configuration /config/esphome/kitchen-presence-sensor.yaml...
INFO Starting log output from 10.10.10.154 using esphome API
INFO Successfully connected to kitchen-presence-sensor @ 10.10.10.154 in 0.003s
WARNING kitchen-presence-sensor @ 10.10.10.154: Connection error occurred: kitchen-presence-sensor @ 10.10.10.154: The connection dropped immediately after encrypted hello; Try enabling encryption on the device or turning off encryption on the client (ESPHome Logs 2024.5.0).
WARNING Can't connect to ESPHome API for kitchen-presence-sensor @ 10.10.10.154: kitchen-presence-sensor @ 10.10.10.154: The connection dropped immediately after encrypted hello; Try enabling encryption on the device or turning off encryption on the client (ESPHome Logs 2024.5.0). (HandshakeAPIError)
INFO Trying to connect to kitchen-presence-sensor @ 10.10.10.154 in the background
INFO Successfully connected to kitchen-presence-sensor @ 10.10.10.154 in 0.003s
WARNING kitchen-presence-sensor @ 10.10.10.154: Connection error occurred: kitchen-presence-sensor @ 10.10.10.154: The connection dropped immediately after encrypted hello; Try enabling encryption on the device or turning off encryption on the client (ESPHome Logs 2024.5.0).
INFO Successfully connected to kitchen-presence-sensor @ 10.10.10.154 in 0.005s
WARNING kitchen-presence-sensor @ 10.10.10.154: Connection error occurred: kitchen-presence-sensor @ 10.10.10.154: The connection dropped immediately after encrypted hello; Try enabling encryption on the device or turning off encryption on the client (ESPHome Logs 2024.5.0).
INFO Successfully connected to kitchen-presence-sensor @ 10.10.10.154 in 0.004s
WARNING kitchen-presence-sensor @ 10.10.10.154: Connection error occurred: kitchen-presence-sensor @ 10.10.10.154: The connection dropped immediately after encrypted hello; Try enabling encryption on the device or turning off encryption on the client (ESPHome Logs 2024.5.0).
INFO Successfully connected to kitchen-presence-sensor @ 10.10.10.154 in 0.004s
WARNING kitchen-presence-sensor @ 10.10.10.154: Connection error occurred: kitchen-presence-sensor @ 10.10.10.154: The connection dropped immediately after encrypted hello; Try enabling encryption on the device or turning off encryption on the client (ESPHome Logs 2024.5.0).
INFO Successfully connected to kitchen-presence-sensor @ 10.10.10.154 in 0.007s
WARNING kitchen-presence-sensor @ 10.10.10.154: Connection error occurred: kitchen-presence-sensor @ 10.10.10.154: The connection dropped immediately after encrypted hello; Try enabling encryption on the device or turning off encryption on the client (ESPHome Logs 2024.5.0).
INFO Successfully connected to kitchen-presence-sensor @ 10.10.10.154 in 0.005s
WARNING kitchen-presence-sensor @ 10.10.10.154: Connection error occurred: kitchen-presence-sensor @ 10.10.10.154: The connection dropped immediately after encrypted hello; Try enabling encryption on the device or turning off encryption on the client (ESPHome Logs 2024.5.0).
INFO Successfully connected to kitchen-presence-sensor @ 10.10.10.154 in 0.004s
WARNING kitchen-presence-sensor @ 10.10.10.154: Connection error occurred: kitchen-presence-sensor @ 10.10.10.154: The connection dropped immediately after encrypted hello; Try enabling encryption on the device or turning off encryption on the client (ESPHome Logs 2024.5.0).
INFO Successfully connected to kitchen-presence-sensor @ 10.10.10.154 in 0.003s
WARNING kitchen-presence-sensor @ 10.10.10.154: Connection error occurred: kitchen-presence-sensor @ 10.10.10.154: The connection dropped immediately after encrypted hello; Try enabling encryption on the device or turning off encryption on the client (ESPHome Logs 2024.5.0).
INFO Successfully connected to kitchen-presence-sensor @ 10.10.10.154 in 0.005s
WARNING kitchen-presence-sensor @ 10.10.10.154: Connection error occurred: kitchen-presence-sensor @ 10.10.10.154: The connection dropped immediately after encrypted hello; Try enabling encryption on the device or turning off encryption on the client (ESPHome Logs 2024.5.0).
INFO Successfully connected to kitchen-presence-sensor @ 10.10.10.154 in 0.004s
WARNING kitchen-presence-sensor @ 10.10.10.154: Connection error occurred: kitchen-presence-sensor @ 10.10.10.154: The connection dropped immediately after encrypted hello; Try enabling encryption on the device or turning off encryption on the client (ESPHome Logs 2024.5.0).
INFO Successfully connected to kitchen-presence-sensor @ 10.10.10.154 in 0.004s

Additional information

No response

@vasyna
Copy link

vasyna commented May 15, 2024

disable encryption. This work with esphome 2024.5.0

@stickpin
Copy link
Author

@vasyna I don't see any changes related to encryption in esphome 2024.5.0.
Do you know why it's not working anymore?

@vasyna
Copy link

vasyna commented May 15, 2024

I can’t say, but the problem is only on devices paired with ESP8266 + LD

@stickpin stickpin changed the title ESPHome 2024.5.0 + D1 Mini = The connection dropped immediately after encrypted hello ESPHome 2024.5.0 + D1 Mini + LD2410 = The connection dropped immediately after encrypted hello May 15, 2024
@CEZ15
Copy link

CEZ15 commented May 15, 2024

Exact same fault here. I have multiple PIR sensors still functioning as intended, but every LD2410 on my network is failing with the same error. Also, seem to be unable to re-flash any of them.

@stickpin
Copy link
Author

stickpin commented May 15, 2024

Disabling encryption doesn't help much.

WARNING bedroom-presence-sensor @ 10.10.10.152: Connection error occurred: [Errno 104] Connection reset by peer
INFO Processing unexpected disconnect from ESPHome API for bedroom-presence-sensor @ 10.10.10.152
WARNING Disconnected from API
INFO Successfully connected to bedroom-presence-sensor @ 10.10.10.152 in 0.003s
WARNING bedroom-presence-sensor @ 10.10.10.152: Connection error occurred: bedroom-presence-sensor @ 10.10.10.152: EOF received
WARNING Can't connect to ESPHome API for bedroom-presence-sensor @ 10.10.10.152: bedroom-presence-sensor @ 10.10.10.152: EOF received (SocketClosedAPIError)
INFO Trying to connect to bedroom-presence-sensor @ 10.10.10.152 in the background
INFO Successfully connected to bedroom-presence-sensor @ 10.10.10.152 in 0.003s
WARNING bedroom-presence-sensor @ 10.10.10.152: Connection error occurred: bedroom-presence-sensor @ 10.10.10.152: EOF received
INFO Successfully connected to bedroom-presence-sensor @ 10.10.10.152 in 0.006s
WARNING bedroom-presence-sensor @ 10.10.10.152: Connection error occurred: bedroom-presence-sensor @ 10.10.10.152: EOF received

It seems also that ESP itself crashes every few seconds:

64 bytes from 10.10.10.152: icmp_seq=88 ttl=255 time=1.802 ms
64 bytes from 10.10.10.152: icmp_seq=89 ttl=255 time=1.832 ms
Request timeout for icmp_seq 90
Request timeout for icmp_seq 91
Request timeout for icmp_seq 92
Request timeout for icmp_seq 93
Request timeout for icmp_seq 94
Request timeout for icmp_seq 95
Request timeout for icmp_seq 96
Request timeout for icmp_seq 97
Request timeout for icmp_seq 98
64 bytes from 10.10.10.152: icmp_seq=99 ttl=255 time=7.991 ms
64 bytes from 10.10.10.152: icmp_seq=100 ttl=255 time=4.053 ms
64 bytes from 10.10.10.152: icmp_seq=101 ttl=255 time=2.823 ms
64 bytes from 10.10.10.152: icmp_seq=102 ttl=255 time=2.566 ms
64 bytes from 10.10.10.152: icmp_seq=103 ttl=255 time=1.733 ms
64 bytes from 10.10.10.152: icmp_seq=104 ttl=255 time=3.615 ms
64 bytes from 10.10.10.152: icmp_seq=105 ttl=255 time=1.739 ms
64 bytes from 10.10.10.152: icmp_seq=106 ttl=255 time=7.335 ms
64 bytes from 10.10.10.152: icmp_seq=107 ttl=255 time=3.053 ms
64 bytes from 10.10.10.152: icmp_seq=108 ttl=255 time=1.981 ms
64 bytes from 10.10.10.152: icmp_seq=109 ttl=255 time=1.718 ms
64 bytes from 10.10.10.152: icmp_seq=110 ttl=255 time=2.065 ms
64 bytes from 10.10.10.152: icmp_seq=111 ttl=255 time=7.496 ms
64 bytes from 10.10.10.152: icmp_seq=112 ttl=255 time=1.872 ms
64 bytes from 10.10.10.152: icmp_seq=113 ttl=255 time=2.688 ms
64 bytes from 10.10.10.152: icmp_seq=114 ttl=255 time=17.936 ms
64 bytes from 10.10.10.152: icmp_seq=115 ttl=255 time=2.205 ms
64 bytes from 10.10.10.152: icmp_seq=116 ttl=255 time=7.058 ms
64 bytes from 10.10.10.152: icmp_seq=117 ttl=255 time=3.146 ms
64 bytes from 10.10.10.152: icmp_seq=118 ttl=255 time=3.399 ms
Request timeout for icmp_seq 119
Request timeout for icmp_seq 120
Request timeout for icmp_seq 121
Request timeout for icmp_seq 122
Request timeout for icmp_seq 123
Request timeout for icmp_seq 124
Request timeout for icmp_seq 125
Request timeout for icmp_seq 126
Request timeout for icmp_seq 127
64 bytes from 10.10.10.152: icmp_seq=128 ttl=255 time=22.357 ms
64 bytes from 10.10.10.152: icmp_seq=129 ttl=255 time=4.699 ms
64 bytes from 10.10.10.152: icmp_seq=130 ttl=255 time=7.547 ms
64 bytes from 10.10.10.152: icmp_seq=131 ttl=255 time=3.332 ms
64 bytes from 10.10.10.152: icmp_seq=132 ttl=255 time=9.029 ms
64 bytes from 10.10.10.152: icmp_seq=133 ttl=255 time=1.700 ms
64 bytes from 10.10.10.152: icmp_seq=134 ttl=255 time=28.088 ms
64 bytes from 10.10.10.152: icmp_seq=135 ttl=255 time=9.253 ms
64 bytes from 10.10.10.152: icmp_seq=136 ttl=255 time=9.000 ms
64 bytes from 10.10.10.152: icmp_seq=137 ttl=255 time=3.907 ms
64 bytes from 10.10.10.152: icmp_seq=138 ttl=255 time=13.005 ms
64 bytes from 10.10.10.152: icmp_seq=139 ttl=255 time=2.124 ms
64 bytes from 10.10.10.152: icmp_seq=140 ttl=255 time=5.171 ms
64 bytes from 10.10.10.152: icmp_seq=141 ttl=255 time=1.697 ms
64 bytes from 10.10.10.152: icmp_seq=142 ttl=255 time=2.213 ms
64 bytes from 10.10.10.152: icmp_seq=143 ttl=255 time=1.680 ms
64 bytes from 10.10.10.152: icmp_seq=144 ttl=255 time=48.704 ms
64 bytes from 10.10.10.152: icmp_seq=145 ttl=255 time=2.110 ms
Request timeout for icmp_seq 146
Request timeout for icmp_seq 147
Request timeout for icmp_seq 148
Request timeout for icmp_seq 149
Request timeout for icmp_seq 150
Request timeout for icmp_seq 151
Request timeout for icmp_seq 152
Request timeout for icmp_seq 153
Request timeout for icmp_seq 154
64 bytes from 10.10.10.152: icmp_seq=155 ttl=255 time=8.204 ms
64 bytes from 10.10.10.152: icmp_seq=156 ttl=255 time=3.114 ms
64 bytes from 10.10.10.152: icmp_seq=157 ttl=255 time=3.757 ms
64 bytes from 10.10.10.152: icmp_seq=158 ttl=255 time=6.943 ms
64 bytes from 10.10.10.152: icmp_seq=159 ttl=255 time=2.637 ms
64 bytes from 10.10.10.152: icmp_seq=160 ttl=255 time=20.420 ms
64 bytes from 10.10.10.152: icmp_seq=161 ttl=255 time=3.163 ms
64 bytes from 10.10.10.152: icmp_seq=162 ttl=255 time=1.991 ms
64 bytes from 10.10.10.152: icmp_seq=163 ttl=255 time=1.954 ms
64 bytes from 10.10.10.152: icmp_seq=164 ttl=255 time=1.977 ms
64 bytes from 10.10.10.152: icmp_seq=165 ttl=255 time=2.005 ms

@stickpin
Copy link
Author

stickpin commented May 15, 2024

Exact same fault here. I have multiple PIR sensors still functioning as intended, but every LD2410 on my network is failing with the same error. Also, seem to be unable to re-flash any of them.

yes, I had to go and reflash it one by one with the cable to the previous fw.

@CEZ15
Copy link

CEZ15 commented May 15, 2024

with

Does everything seem to work as intended after the reflash?

Did you have to make any other adjustments?

Sorry for the questions, I'm just getting more and more frustrated with it 😂

@stickpin
Copy link
Author

@CEZ15 I did a rollback to ESPHome 2024.4.2 addon from HA backup and installed the firmware on top of the newer one.
After that, everything is working as before.

@KennoPa
Copy link

KennoPa commented May 15, 2024

ESP8266 + LD2410 : same issue, router shows ip up and running, as I disabled webui for the performance issues, I cannot access via Web server to confirm. I will wait a fix and will not revert esphome version.

@MallocArray
Copy link

I don't think it is specific to the LD2410, as others are seeing it without this, but still D1 Minis

@benalexau
Copy link

I had the same log messages and an unresponsive device after upgrading to 2024.5.0 on an m5Stack Atom Lite ESP32. To troubleshoot I used https://web.esphome.io/ to view the log. This revealed repeated reboots due to esphome assert failed: vQueueDelete queue.c:2140 (pxQueue). Based on this forum post I resolved the issue by disabling the ESP32 Improv service:

#esp32_improv:
#  authorizer: none

@kdelios
Copy link

kdelios commented May 16, 2024

I had similar behavior with LD1125H and ESP32. No encryption used.
I had to revert esphome to 2024.4.2 and re-flash the devices (over the air).
Problems fixed.

@poudenes
Copy link

Same issue with different board:
Revert back and device is working again.

#########################################################
# Below all fixed settings for dressoir PCB
#########################################################
substitutions:
  devicename: meek-dressoir
  friendly: Diningroom
  friendly_switch_1: Dressoir
  friendly_switch_2: Balcony
  ip: 192.168.100.207
  neopixel: GPIO02 # (D4)
  touch_power: GPIO16 # (D0)
  gpio_touch1: GPIO14 # (D5)
  gpio_touch2: GPIO13 # (D7)
  gpio_relay1: GPIO05 # (D1)
  gpio_relay2: GPIO4 # (D2)
  gpio_relay3: GPIO15 # (D8)

#########################################################
# Everything below can be copy/paste without problem
#########################################################
wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  reboot_timeout: 0s
  fast_connect: true
  output_power: 20.0
  manual_ip:
    static_ip: ${ip}
    gateway: 192.168.100.1
    subnet: 255.255.255.0
    dns1: 192.168.100.1
  ap:
    ssid: ${devicename}
    password: !secret password
    channel: 4

  on_disconnect:
    - light.turn_on:
        id: neopixel
        red: 1
        green: 1
        blue: 1

    - light.turn_on:
        id: neopixel
        effect: strobe

esphome:
  name: ${devicename}
  on_boot:
    priority: 600
    then:
      - switch.turn_off: touch_power
      - delay: 2s
      - switch.turn_on: touch_power
      - light.turn_on:
          id: neopixel
          red: 1
          green: 1
          blue: 1

esp8266:
  board: esp01_1m
  restore_from_flash: true

api:
  encryption:
    key: !secret api_key
  reboot_timeout: 15min

  on_client_connected:
    - light.turn_on:
        id: neopixel
        red: 1
        green: 1
        blue: 1

    - light.turn_on:
        id: neopixel
        effect: strobe

    - delay: 5s

    - light.turn_on:
        id: neopixel
        effect: none

    - light.turn_on:
        id: neopixel
        red: 1
        green: 0
        blue: 0
        brightness: 100%

    - delay: 5s

    - homeassistant.service:
        service: persistent_notification.create
        data:
          title: "HA - Notification"
          message: "Meek ${friendly} connected again"
          notification_id: "Meek ${friendly}"

time:
  - platform: homeassistant
    id: homeassistant_time

captive_portal:

web_server:
  port: 80

preferences:
  flash_write_interval: 1min

logger:
  level: INFO

ota:
  safe_mode: true
  password: !secret password
  reboot_timeout: 0s

button:
  - platform: factory_reset
    name: "${friendly} - Reset"

switch:
  - platform: safe_mode
    name: "${friendly} - safe mode"
    id: "${friendly}_safe_mode"

sensor:
  - platform: wifi_signal
    id: "wifi_db_signal"
    name: "${friendly} - Wifi Signal"
    update_interval: 5min

  - platform: uptime
    name: "${friendly} - Uptime"
    update_interval: 5min
    
  - platform: template
    name: "${friendly} WiFi Percentage"
    id: wifi_percentage
    entity_category: diagnostic
    state_class: measurement
    update_interval: 10s
    unit_of_measurement: "%"
    accuracy_decimals: 0
    icon: mdi:wifi
    lambda: >
      auto signal = id(wifi_db_signal).state;
      float perc = 0;
      if (signal < -92.0) 
        perc = 100.0; 
      else if (signal > -21.0) 
        perc = 1.0; 
      else 
        perc = round(( -0.0154 * signal * signal )-( 0.3794 * signal ) + 98.182 );

      if(perc <= 0)
        return 0.0;
      else if(perc >= 100)
        return 100.0;
      else
        return perc;

text_sensor:
  - platform: wifi_info
    ip_address:
      name: "${friendly} - IP"
      icon: mdi:lan
    ssid:
      name: "${friendly} - SSID"
      icon: mdi:lan
    bssid:
      name: "${friendly} - BSSID"
      icon: mdi:lan
    mac_address:
      name: "${friendly} - MAC"
      icon: mdi:lan

  - platform: version
    name: "${friendly} - Version"
    hide_timestamp: true

light:
  - platform: neopixelbus
    default_transition_length: 0s
    type: GRB
    variant: 800KBPS
    pin: ${neopixel}
    num_leds: 2
    name: "${friendly_switch_1} - Neopixel All"
    restore_mode: RESTORE_DEFAULT_OFF
    id: neopixel
    effects:
      - strobe:
      - addressable_rainbow:
      - addressable_color_wipe:
      - addressable_scan:
      - addressable_twinkle:
      - addressable_random_twinkle:
      - addressable_flicker:
      - pulse:
          name: "Slow Pulse"
          update_interval: 1s

#########################################################
# Only needed when you use more then 1 neopixel
#########################################################
  - platform: partition
    name: "${friendly_switch_1} - neopixel"
    restore_mode: RESTORE_DEFAULT_OFF
    default_transition_length: 0s
    id: neopixel1
    segments:
      - id: neopixel
        from: 0
        to: 0
    effects:
      - strobe:
      - flicker:
      - addressable_rainbow:
      - addressable_color_wipe:
      - addressable_scan:
      - addressable_twinkle:
      - addressable_random_twinkle:
      - addressable_flicker:
      - pulse:
          name: "Slow Pulse"
          update_interval: 1s
      - addressable_lambda:
          name: "Green Pink"
          update_interval: 100ms
          lambda:
            static int state = 0;
            if (initial_run){
              state = 0;
              it.all() = ESPColor(0,255,0);
            } else {
              it.all() = ESPColor(255, 0, 127);
              if(state==0){
                int i = rand() % it.size();
                it[i] = ESPColor(0,255,0);
                state += 1;
              } else {
                state += 1;
                state = state % 10;
              }
            }
  
  - platform: partition
    name: "${friendly_switch_2} - neopixel"
    restore_mode: RESTORE_DEFAULT_OFF
    default_transition_length: 0s
    id: neopixel2
    segments:
      - id: neopixel
        from: 1
        to: 1
    effects:
      - strobe:
      - flicker:
      - addressable_rainbow:
      - addressable_color_wipe:
      - addressable_scan:
      - addressable_twinkle:
      - addressable_random_twinkle:
      - addressable_flicker:
      - pulse:
          name: "Slow Pulse"
          update_interval: 1s
      - addressable_lambda:
          name: "Green Pink"
          update_interval: 100ms
          lambda:
            static int state = 0;
            if (initial_run){
              state = 0;
              it.all() = ESPColor(0,255,0);
            } else {
              it.all() = ESPColor(255, 0, 127);
              if(state==0){
                int i = rand() % it.size();
                it[i] = ESPColor(0,255,0);
                state += 1;
              } else {
                state += 1;
                state = state % 10;
              }
            }

switch:
  - platform: gpio
    pin: ${touch_power}
    name: "${friendly} - Touch 1 power"
    icon: mdi:electric-switch
    id: touch_power

  - platform: template
    name: "${friendly_switch_1} - Light Switch"
    icon: mdi:nintendo-switch
    restore_mode: RESTORE_DEFAULT_OFF
    id: switch1
    optimistic: true

  - platform: template
    name: "${friendly_switch_1} - Switch longpress"
    restore_mode: RESTORE_DEFAULT_OFF
    id: switch_longpress1
    optimistic: true
    icon: mdi:nintendo-switch

  - platform: template
    name: "${friendly_switch_2} - Light Switch"
    icon: mdi:nintendo-switch
    restore_mode: RESTORE_DEFAULT_OFF
    id: switch2
    optimistic: true

  - platform: template
    name: "${friendly_switch_2} - Switch longpress"
    restore_mode: RESTORE_DEFAULT_OFF
    id: switch_longpress2
    optimistic: true
    icon: mdi:nintendo-switch

  - platform: gpio
    pin: ${gpio_relay1}
    name: "${friendly_switch_1} - Relay"
    icon: mdi:electric-switch

  - platform: gpio
    pin: ${gpio_relay2}
    name: "${friendly_switch_2} - Relay"
    icon: mdi:electric-switch

binary_sensor:
  - platform: gpio
    pin: ${gpio_touch1}
    name: "${friendly_switch_1} - Touch"
    icon: mdi:gesture-tap-button
    on_click:
      - min_length: 10ms
        max_length: 500ms
        then:
          - switch.toggle: switch1
      - min_length: 1000ms
        max_length: 2000ms
        then:
          - switch.toggle: switch_longpress1

  - platform: gpio
    pin: ${gpio_touch2}
    name: "${friendly_switch_2} - Touch"
    on_click:
      - min_length: 10ms
        max_length: 500ms
        then:
          - switch.toggle: switch2
      - min_length: 1000ms
        max_length: 2000ms
        then:
          - switch.toggle: switch_longpress2

@KennoPa
Copy link

KennoPa commented May 16, 2024

I don't think it is specific to the LD2410, as others are seeing it without this, but still D1 Minis

Maybe but same board with cc1101 works fine and did not brake after update.
Will wait for the fix

@poudenes
Copy link

maybe interesting. This is not the first time that a new update brick the connection/wifi etc. In 2023 I revert 2 or 3 times back to the version I used before the update. (To bad I don't remember the versions anymore)

@GLSSoftware
Copy link

GLSSoftware commented May 16, 2024

Same problem here with Wemos D1 Mini.
Reverted to 2024.4.2

@Wheemer
Copy link

Wheemer commented May 16, 2024

Not sure how to revert the devices since I can't even connect to them. It just keep saying connecting when I try to flash the older version. Grounding d3 doesn't get them into flash mode. Seems I may have to unsolder all connections. What a royal PITA.

@CEZ15
Copy link

CEZ15 commented May 16, 2024

Not sure how to revert the devices since I can't even connect to them. It just keep saying connecting when I try to flash the older version. Grounding d3 doesn't get them into flash mode. Seems I may have to unsolder all connections. What a royal PITA.

I found desoldering the RX / TX pins would then allow them to be flashed. Not sure why these pins being connected to sensors stop the device from allowing flashing, but at least you don't need to desolder the entire board

@j-f-pinto
Copy link

Not sure how to revert the devices since I can't even connect to them. It just keep saying connecting when I try to flash the older version. Grounding d3 doesn't get them into flash mode. Seems I may have to unsolder all connections. What a royal PITA.

I found desoldering the RX / TX pins would then allow them to be flashed. Not sure why these pins being connected to sensors stop the device from allowing flashing, but at least you don't need to desolder the entire board

The ESP8266 only have one UART with TX and RX and it is use for flashing. If you have any device attached on those pins it will prevent the flashing.

It is also good practice to add on the Logger: section the command baud_rate: 0. This command disable the log mensagens on the serial port.

@Wheemer
Copy link

Wheemer commented May 16, 2024

Not sure how to revert the devices since I can't even connect to them. It just keep saying connecting when I try to flash the older version. Grounding d3 doesn't get them into flash mode. Seems I may have to unsolder all connections. What a royal PITA.

I found desoldering the RX / TX pins would then allow them to be flashed. Not sure why these pins being connected to sensors stop the device from allowing flashing, but at least you don't need to desolder the entire board

I just tried that and nothing, then I also unsoldered the 5v, still nothing...

@Wheemer
Copy link

Wheemer commented May 16, 2024

Not sure how to revert the devices since I can't even connect to them. It just keep saying connecting when I try to flash the older version. Grounding d3 doesn't get them into flash mode. Seems I may have to unsolder all connections. What a royal PITA.

I found desoldering the RX / TX pins would then allow them to be flashed. Not sure why these pins being connected to sensors stop the device from allowing flashing, but at least you don't need to desolder the entire board

The ESP8266 only have one UART with TX and RX and it is use for flashing. If you have any device attached on those pins it will prevent the flashing.

It is also good practice to add on the Logger: section the command baud_rate: 0. This command disable the log mensagens on the serial port.

Yes logger was already at 0.

@j-f-pinto
Copy link

j-f-pinto commented May 16, 2024

Not sure how to revert the devices since I can't even connect to them. It just keep saying connecting when I try to flash the older version. Grounding d3 doesn't get them into flash mode. Seems I may have to unsolder all connections. What a royal PITA.

I found desoldering the RX / TX pins would then allow them to be flashed. Not sure why these pins being connected to sensors stop the device from allowing flashing, but at least you don't need to desolder the entire board

I just tried that and nothing, then I also unsoldered the 5v, still nothing...

Do you use GPIO0, GPIO2, GPIO12 and GPIO15 pins? Those pins could have influence on flashing processe.

@tonertiffi
Copy link

disable encryption. This work with esphome 2024.5.0

disable encryption. This work with esphome 2024.5.0

Don't feel alone here i have the same issue on only the LD2410 sensors connected to an esp8266 just about identical to yours, restored to a version before re flashed them and they working again

@tonertiffi
Copy link

will wait for a new version to see if that fixes it

@ondoteam
Copy link

Not only with LD sensors. I seeing same behavior with bme680 and not with the board using the LD

@vazquezjm
Copy link

Just come to say I'm experiencing the exact same issue but with a Wemos D1 mini and LD2410c

The connection dropped immediately after encrypted hello; Try enabling encryption on the device or turning off encryption on the client (ESPHome Logs 2024.5.0).

Logger baud rate set to 0:

# Enable logging
logger:
  level: DEBUG
  baud_rate: 0

@toogooda
Copy link

Yes also broke my D1 Mini presence sensors no idea how to revert back to an older version of esp home :(

@vazquezjm
Copy link

no idea how to revert back to an older version

Neither do I, but at least I was just testing

@stoffies00711
Copy link

@vazquezjm Thanks! But how did you do this? when I used the code tags, this was... ugly...

You have to use code block instead of

Thanks @vazquezjm
I also didn't know about the ```

@111lisu
Copy link

111lisu commented May 23, 2024

I have the same thing with Sonoff 4ch ESPHome 2024.5.2

INFO Starting log output from 192.168.1.141 using esphome API
INFO Successfully connected to bramah136 @ 192.168.1.141 in 0.014s
WARNING bramah136 @ 192.168.1.141: Connection error occurred: bramah136 @ 192.168.1.141: The connection dropped immediately after encrypted hello; Try enabling encryption on the device or turning off encryption on the client (ESPHome Logs 2024.5.2).
WARNING Can't connect to ESPHome API for bramah136 @ 192.168.1.141: bramah136 @ 192.168.1.141: The connection dropped immediately after encrypted hello; Try enabling encryption on the device or turning off encryption on the client (ESPHome Logs 2024.5.2). (HandshakeAPIError)
INFO Trying to connect to bramah136 @ 192.168.1.141 in the background

but sometimes it will connect

@mstuczko
Copy link

mstuczko commented May 23, 2024

Idea ... Something in 2024.5.0 was introduced that corrupted memory maintenance or similar? Or bloated some component? I was able to "capture out of memory" errors, on device with yaml compiled with 2024.5.2.

Example is one at my greenhouse. Device is working ok, with really simple yaml, compiled at 2024.5.0. But I am not able to do OTA via website.
YAML has: wifi, web, ota, api, mqtt, one i2c sensor (SHT31D), one Dallas sensor.

Rebooting is not helping. I will downgrade this to 2024.4.2 just directly.

substitutions:
  device_name: esp-szklarnia-a14
  ip_suffix: "22"
  device_comment: "(${ip_suffix}) Szklarnia na działce"
  device_friendly_name: "Szklarnia A14"
  status_interval: 15min

esphome:
  name: $device_name
  comment: $device_comment
  friendly_name: $device_friendly_name
  platform: esp8266
  board: esp01_1m  # d1_mini, esp01_1m 

# Enable logging
logger:

# Enable Home Assistant API
api:
  # remote location, disable reboot (MQTT will be used)
  reboot_timeout: 0min
  encryption:
    key: !secret api_encryption_key

mqtt:
  broker: !secret mqtt_broker
  port: !secret mqtt_port
  username: !secret mqtt_username
  password: !secret mqtt_password

ota:
  password: !secret ota_password
  on_begin:
    then:
      - logger.log: "OTA start"
  on_progress:
    then:
      - logger.log:
          format: "OTA progress %0.1f%%"
          args: ["x"]
  on_end:
    then:
      - logger.log: "OTA end"
  on_error:
    then:
      - logger.log:
          format: "OTA update error %d"
          args: ["x"]
          
wifi:
  # Specify target address, for OTA or Logger to connect to
  # Needed also when static addresses are present in configuration
  #use_address: esphome-01-test.local
  #use_address: 192.168.2.101
  use_address: 192.168.2.${ip_suffix}
  #use_address: 192.168.1.${ip_suffix}
  fast_connect: false
  #power_save_mode: LIGHT
  on_connect:
    then:
      - logger.log: "Wifi connected."
      - script.execute: send_diagnostics
  networks:
    - ssid: !secret wifi_dzialka_ssid               # dzialka, hidden, needs bssid
      password: !secret wifi_dzialka_password
      hidden: true
      bssid: !secret wifi_dzialka_bssid
      priority: 3
      manual_ip:
        static_ip: 192.168.1.${ip_suffix}
        gateway: 192.168.1.1
        subnet: 255.255.255.0
        dns1: 8.8.8.8
        dns2: 8.8.4.4
    - ssid: !secret wifi_dzialka_ssid               # dzialka, visible
      password: !secret wifi_dzialka_password
      priority: 3
      manual_ip:
        static_ip: 192.168.1.${ip_suffix}
        gateway: 192.168.1.1
        subnet: 255.255.255.0
        dns1: 8.8.8.8
        dns2: 8.8.4.4
    - ssid: !secret wifi_dzialka_guest_ssid          # dzialka guest, hidden, needs bssid
      password: !secret wifi_dzialka_guest_password
      hidden: true
      bssid: !secret wifi_dzialka_guest_bssid
      priority: 2
      manual_ip:
        static_ip: 192.168.2.${ip_suffix}
        gateway: 192.168.2.1
        subnet: 255.255.255.0
        dns1: 8.8.8.8
        dns2: 8.8.4.4
    - ssid: !secret wifi_ssid               # home
      password: !secret wifi_password
      manual_ip:
        static_ip: 192.168.2.${ip_suffix}
        gateway: 192.168.2.1
        subnet: 255.255.255.0
        dns1: 8.8.8.8
        dns2: 8.8.4.4
      priority: 1
    - ssid: !secret fallback_hotspot_ssid    # fallback if exists
      password: !secret fallback_hotspot_password
      priority: 0
      manual_ip:
        static_ip: 192.168.1.${ip_suffix}
        gateway: 192.168.1.1
        subnet: 255.255.255.0

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: !secret fallback_hotspot_ssid
    password: !secret fallback_hotspot_password

captive_portal:
# No configuration variables.
  
web_server:
  port: 80
  auth:
    username: !secret web_server_user
    password: !secret web_server_password

time:
  - platform: sntp
    servers:
      - europe.pool.ntp.org
      - tempus1.gum.gov.pl
      - tempus2.gum.gov.pl
    timezone: "Europe/Warsaw"
    on_time_sync:
      then:
        - logger.log: "Synchronized system clock"

i2c:
  # ESP-01: scl: 0, sda: 2
  # EPS-12: scl: 5, sda: 4
  scl: 0
  sda: 2
  scan: true
  id: bus_a

dallas:
  # ESP01 -> SCL -> GPIO0
  # ESP01 -> TX -> GPIO1
  # ESP12 -> SCL -> GPIO5
  # ESP12 -> TX -> GPIO1
  pin: 1
  update_interval: 1min
  id: dallas_set

script:
  - id: send_diagnostics
    then:
      - logger.log: "Sending diagnostics."
      - component.update: wifi_signal_dbm
      # - component.update: wifi_signal_percent
      - component.update: uptime_sensor  #tak
      # - component.update: uptime_human   #tak
      - component.update: esp_ip_addr
      - component.update: esp_connected_ssid
      - component.update: esp_connected_bssid
      - component.update: esp_latest_wifi_scan_results
      # customizations
      - component.update: dallas_set
      
binary_sensor:
  - platform: status
    name: "ESP - Status"
    entity_category: "diagnostic"     # "", "config" , "diagnostic"
     
text_sensor:
  - platform: version
    name: "ESP - ESPHome Version"
    id: esphome_version
    #update_interval: $status_interval
  - platform: template
    name: "ESP - Uptime"
    id: uptime_human
    entity_category: "diagnostic"     # "", "config" , "diagnostic"
    icon: mdi:clock-start
    update_interval: $status_interval
  - platform: wifi_info
    ip_address:
      name: "ESP - IP Address"
      id: esp_ip_addr
      entity_category: "diagnostic"     # "", "config" , "diagnostic"
      update_interval: $status_interval
    mac_address:
      name: "ESP - Mac Address"
      id: esp_mac_wifi_address
      entity_category: "diagnostic"     # "", "config" , "diagnostic"
      #update_interval: $status_interval
    ssid:
      name: "ESP - Wifi SSID"
      id: esp_connected_ssid
      entity_category: "diagnostic"     # "", "config" , "diagnostic"
      update_interval: $status_interval
    bssid:
      name: "ESP - Wifi BSSID"
      id: esp_connected_bssid
      entity_category: "diagnostic"     # "", "config" , "diagnostic"
      update_interval: $status_interval
    scan_results:
      name: "ESP - Wifi Scan Results"
      id: esp_latest_wifi_scan_results
      entity_category: "diagnostic"     # "", "config" , "diagnostic"
      update_interval: $status_interval
    
sensor:
  - platform: wifi_signal
    name: "ESP - WiFi Signal dBm"
    id: wifi_signal_dbm
    entity_category: "diagnostic"     # "", "config" , "diagnostic"
    update_interval: $status_interval
  - platform: copy
    source_id: wifi_signal_dbm
    name: "ESP - WiFi Signal %"
    id: wifi_signal_percent
    entity_category: "diagnostic"     # "", "config" , "diagnostic"
    #update_interval: $status_interval
    filters:
      - lambda: return min(max(2 * (x + 100.0), 0.0), 100.0);
    unit_of_measurement: "%"
  - platform: uptime
    name: "ESP - Uptime Sensor"
    id: uptime_sensor
    entity_category: "diagnostic"     # "", "config" , "diagnostic"
    update_interval: ${status_interval}
    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();
# customized
  - platform: dallas
    index: 0
    name: "Soil Temperature"
    filters:
      - median:
          window_size: 7
          send_every: 4
          send_first_at: 3    
  - platform: sht3xd
    temperature:
      name: "Air Temperature"
      id: sht_temperature
    humidity:
      name: "Air Humidity"
      id: sht_humidity
    address: 0x44
    update_interval: 60s

button:
  - platform: restart
    name: "ESP - Restart"
    id: restart1
    entity_category: "diagnostic"     # "diagnostic" - hides entity in HA
  - platform: template
    name: "ESP - Send status info"
    id: send_status_info
    #icon: "mdi:emoticon-outline"
    entity_category: "diagnostic"     # "diagnostic" - hides entity in HA
    on_press:
      - logger.log: "Statuses requested."
      - script.execute: send_diagnostics

# end of file 

@stain3565
Copy link

Same issue for me with a Localbytes Tasmota uk plug flashed OTA with ESPHOME.

``Working fine until latest ESPHOME version, Message: WARNING localbytes-plug-11 @ 192.168.0.80: Connection error occurred: localbytes-plug-11 @ 192.168.0.80: The connection dropped immediately after encrypted hello; Try enabling encryption on the device or turning off encryption on the client (ESPHome Logs 2024.5.2).
My yaml is:

substitutions:
  # Device Names
  name: "localbytes-plug-11"
  friendly_name: "Localbytes Plug 11"
  
  # Icon
  main_icon: "power-socket-uk"

  # Default Relay State
  # Aka: `restore_mode` in documentation
  # Options: `RESTORE_DEFAULT_OFF`, `RESTORE_DEFAULT_ON`, `ALWAYS_ON` & `ALWAYS_OFF`
  default_state: "RESTORE_DEFAULT_OFF"

esphome:
  name: "${name}"
  friendly_name: "${friendly_name}"

  # Automatically add the mac address to the name
  # so you can use a single firmware for all devices
  name_add_mac_suffix: False

  # This will allow for (future) project identification,
  # configuration and updates.
  project:
    name: localbytes.plug-pm
    version: "1.6.3"

  on_boot:
    priority: 300
    then:
      #Signal to the template switches that their initial values have been loaded      
      globals.set:
        id: setupComplete
        value: "true"

esp8266:
  board: esp01_1m
  restore_from_flash: true

logger:

dashboard_import:
  package_import_url: github://JamesSwift/localbytes-plug-pm/localbytes-plug-pm.yaml@main

ota:
  password: !secret localbytes_plug_11_ota_password

wifi:
  networks:
  - ssid: !secret wholehome_wifi_ssid
    password: !secret wholehome_wifi_password
  - ssid: !secret wifi_ssid
    password: !secret wifi_password
  - ssid: !secret garden_wifi_ssid
    password: !secret garden_wifi_password

  manual_ip:
    static_ip: !secret localbytes_plug_11_ip
    gateway: !secret wifi_gateway
    dns1: !secret wifi_dns
    subnet: !secret wifi_subnet    

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Localbytes-11 Fallback Hotspot"
    password: !secret localbytes_plug_11_wifi_ap_password

  output_power: 18db
  power_save_mode: light

api:
  encryption:
    key: !secret localbytes_plug_11_api_key

  services:
    - service: calibrate_voltage
      variables:
        actual_value: float
      then:
        - lambda: |-
            id(voltage_multiply) = actual_value / id(voltage).raw_state;
        - number.set:
            id: voltage_factor
            value: !lambda "return id(voltage_multiply);"
          
    - service: calibrate_power
      variables:
        actual_value: float
      then:
        - lambda: |-
            id(power_multiply) = actual_value / id(power).raw_state;
        - number.set:
            id: power_factor
            value: !lambda "return id(power_multiply);"
          
    - service: calibrate_current
      variables:
        actual_value: float
      then:
        - lambda: |-
            id(current_multiply) = actual_value / id(current).raw_state;
        - number.set:
            id: current_factor
            value: !lambda "return id(current_multiply);"

# Make calibration factor data readable/setable from home assistant
number:
  - platform: template
    name: "Voltage Calibration Factor"
    id: voltage_factor
    icon: "mdi:sine-wave"
    min_value: 0
    max_value: 10
    step: 0.001
    entity_category: diagnostic
    mode: box
    lambda: |-
      return id(voltage_multiply);
    set_action:
      lambda: |-
        id(voltage_multiply) = x;

  - platform: template
    name: "Power Calibration Factor"
    id: power_factor
    icon: "mdi:flash"
    min_value: 0
    max_value: 10
    step: 0.001
    entity_category: diagnostic
    mode: box
    lambda: |-
      return id(power_multiply);
    set_action:
      lambda: |-
        id(power_multiply) = x;
        
  - platform: template
    name: "Current Calibration Factor"
    id: current_factor
    icon: "mdi:current-ac"
    min_value: 0
    max_value: 10
    step: 0.001
    entity_category: diagnostic
    mode: box
    lambda: |-
      return id(current_multiply);
    set_action:
      lambda: |-
        id(current_multiply) = x;

binary_sensor:
  # Push Button (Toggles Relay When Pressed)
  - platform: gpio
    pin:
      number: GPIO3
      mode: INPUT_PULLUP
      inverted: true
    name: "Button"
    on_click:

      - max_length: 1s
        then:
          if:
            condition:
              switch.is_off: disable_button
            then:
              switch.toggle: relay
      
      - min_length: 1.5s
        max_length: 5s
        then:
          switch.toggle: disable_led
      
      - min_length: 8s
        max_length: 12s
        then:
          switch.toggle: disable_button
          
  - platform: status
    name: "Server Status"

switch:
  # Relay (As Switch)
  - platform: gpio
    name: ""
    icon: "mdi:${main_icon}"
    pin: GPIO14
    id: relay
    restore_mode: "${default_state}"
    on_turn_on:
      if:
        condition:
          switch.is_off: disable_led
        then:
          light.turn_on: led
    on_turn_off:
      - light.turn_off: led
  
  - platform: template
    name: "Disable LED"
    id: disable_led
    icon: "mdi:led-variant-off"
    restore_mode: RESTORE_DEFAULT_OFF
    optimistic: true
    on_turn_on:
      - if:
          condition:
            lambda: 'return id(setupComplete) == true;'
          then:
          #Flash twice
          - light.turn_off: led
          - delay: 0.15s
          - light.turn_on: led
          - delay: 0.15s
          - light.turn_off: led
          - delay: 0.15s
          - light.turn_on: led
          - delay: 0.15s
      #Final state
      - light.turn_off: led
    on_turn_off:
      - if:
          condition:
            lambda: 'return id(setupComplete) == true;'
          then:
          #Flash twice
          - light.turn_on: led
          - delay: 0.15s
          - light.turn_off: led
          - delay: 0.15s
          - light.turn_on: led
          - delay: 0.15s
          - light.turn_off: led
          - delay: 1s
      #Final state
      - if:
          condition:
            switch.is_on: relay
          then:
            light.turn_on: led


  
  - platform: template
    name: "Disable Button"
    id: disable_button
    icon: "mdi:toggle-switch-off-outline"    
    restore_mode: RESTORE_DEFAULT_OFF
    optimistic: true
    on_turn_on:
      - if:
          condition:
            lambda: 'return id(setupComplete) == true;'
          then:
          #Flash thrice
          - light.turn_off: led
          - delay: 0.15s
          - light.turn_on: led
          - delay: 0.15s
          - light.turn_off: led
          - delay: 0.15s
          - light.turn_on: led
          - delay: 0.15s
          - light.turn_off: led
          - delay: 0.15s
          - light.turn_on: led
          - delay: 0.15s
        #Final state
      - if:
          condition:
            or:
              - switch.is_off: relay
              - switch.is_on: disable_led
          then:
            light.turn_off: led
    on_turn_off:
      - if:
          condition:
            lambda: 'return id(setupComplete) == true;'
          then:
          #Flash thrice
          - light.turn_on: led
          - delay: 0.15s
          - light.turn_off: led
          - delay: 0.15s
          - light.turn_on: led
          - delay: 0.15s
          - light.turn_off: led
          - delay: 0.15s
          - light.turn_on: led
          - delay: 0.15s
          - light.turn_off: led
          - delay: 1s
      #Final state
      - if:
          condition:
            - switch.is_on: relay
            - switch.is_off: disable_led
          then:
            light.turn_on: led



sensor:
  # WiFi Signal Sensor
  - platform: wifi_signal
    name: "WiFi Status"
    update_interval: 60s
    
  # Power Monitoring
  - platform: hlw8012
    sel_pin:
      number: GPIO12
      inverted: true
    cf_pin: GPIO4
    cf1_pin: GPIO5
    change_mode_every: 3
    update_interval: 6s
    
    voltage:
      name: "Voltage"
      id: voltage
      unit_of_measurement: V
      accuracy_decimals: 1
      filters:
        - lambda: return x * id(voltage_multiply);
        
    power:
      name: "Power"
      id: power
      unit_of_measurement: W
      accuracy_decimals: 0
      filters:
        - lambda: return x * id(power_multiply);
        
    current:
      name: "Current"
      id: current
      unit_of_measurement: A
      accuracy_decimals: 3
      filters:
        - lambda: return x * id(current_multiply);
          
  # Total daily energy sensor
  - platform: total_daily_energy
    name: "Daily Energy"
    power_id: power
    filters:
      # Multiplication factor from W to kW is 0.001
      - multiply: 0.001
    unit_of_measurement: kWh

    
time:
  - platform: homeassistant
    timezone: Europe/London



globals:
  - id: voltage_multiply
    type: float
    restore_value: true
    initial_value: "0.3"
    
  - id: power_multiply 
    type: float
    restore_value: true
    initial_value: "0.133"
    
  - id: current_multiply 
    type: float
    restore_value: true
    initial_value: "0.805"

  - id: setupComplete
    type: bool
    restore_value: no
    initial_value: "false"
  
# Relay State LED
output:
  - platform: esp8266_pwm
    id: state_led
    pin:
      number: GPIO13
      inverted: true

light:
  - platform: binary
    output: state_led
    id: led
    
captive_portal:

web_server:
  port: 80

@smic717394
Copy link

smic717394 commented May 24, 2024

still the same problem in 5.3. Here is a video how to back up the firmware before upgrading the v5 or if you already upgraded, how to get back any version of esphome. You can even have the oficial updated and use a legacy for the devices that fail.

https://www.youtube.com/watch?v=IZHdpXfuJU4&t=405s

@KennoPa
Copy link

KennoPa commented May 28, 2024

Hi,
For me, 5.4 update fixed the issue as well as other devices web ui fixes
Sensor responded to wireless ota update and started showing sensor data in Home assistant

@poudenes
Copy link

Hi,
For me, 5.4 update fixed the issue as well as other devices web ui fixes
Sensor responded to wireless ota update and started showing sensor data in Home assistant

That sounds good. Will wait for others who have positive news about the 5.4 version. Then I will try it here also.

@otto2704
Copy link

same here. seems to work again wirg 2024.5.4 - weird

@bantybanty
Copy link

It seams issue has been fixed. 5.4

@stickpin
Copy link
Author

Fixed also on my end.
This is the fix: esphome/esphome#6819

@Gadget43
Copy link

Gadget43 commented May 28, 2024

Just a side note for this issue......

I have a few ESP01's in places I can not remove and just flash when I feel like it (One example is the front gate).

As for the 2024.5.4, I eventually managed to get it to take the flash (after hours of pushing the flash over OTA), however, it still had the same issues where it would drop off from time to time, was not taking the firmware as it always used to, and just seemed to be completely unreliable and unstable (I am referring to the EPS01's, I can not recall if the ESP8266's were behaving or not after the 2024.5.4, as by this point I had completely Lost My S#!t).

I did however notice that the 4 nodes that were most problematic, were the nodes that contained INA219 modules in them (2 x ESP01's and a further 2 x ESP8266 D1 Mini's, both with 2 x INA219 Modules connected to them)

Thankfully I managed to revert back to a previous version (2024.3) as described elsewhere in this thread, and after Many hours of pushing the firmware to the ESP01 node, it eventually took, and is now back to its previously "Well Behaved" disposition.

I could obviously not remove the gate node as it is one that has been soldered in place due to space constraints, and therefore could only be updated via OTA. (And no, my laptop with win7 on it bombed out recently, so that was not an option with the ftd adapter either).

On a side note, I did notice that all nodes bin files seemed around 30% larger (Even with no additional code, and with just the bare minimum of code it was 517KB+/-) which seemed a bit odd. I can not recall the exact size, however, the one nodes bin file I have on backup with just the bare minimum is 455KB, so I landed up removing virtually everything from the gates code to give it every possible chance of success.

I can only surmise this issue is not resolved as I was still having issues with all the ESP01 nodes that had INA219 modules connected to them, after the supposed fix was released.

In conclusion, with all the frustration that has led me up to this thread, I will not be updating ESPHome again soon, as this is now the second time I have had my fingers burnt to a crisp, and I do not enjoy the bitter taste it leaves in my mouth weeks after the ordeal has passed!

@Mikescotland
Copy link

Mikescotland commented May 28, 2024 via email

@Wheemer
Copy link

Wheemer commented May 28, 2024

Confirmed working for my three d1 minis.

Thanks for the fix to all involved. I guess smart alec ain't so smart after all, lol.

EDIT: I've disabled encryption, which may be why it's working for me.

@marky852
Copy link

All is working for me again with the newest update, but my BME680 still says IAQ accuracy is uncertain (this didn’t happen under 2024.4.2).

We forge on!

@Gadget43
Copy link

Gadget43 commented May 28, 2024

I think the D1 Mini is just that... a "mini". I've always had timeout issues updating it and had to boot to safe-mode just get updates done.

I went through the yaml and hashed out everything except the necessary sensors I needed for my automations to work.

I feel hashing out 95% of your code just to get the node to operate "Sort of" again is kind of counter productive, don't you think?

I actually did remove nearly All the code from the one node before it took on OTA, but in my opinion, removing code that actually served a purpose before this update, just means someone screwed something up.

Eventually, bloat will take over and you will be told that you can't use ESP01's and D1 Mini's, because they don't meet the minimum requirements of Esphome, what then?

I suppose if you earn thousands a month, and can afford to throw out all the 1MB devices, good for you, but all I do with an ESP01 is send battery voltages from my gate, so I don't need a million io pins, or updates every 5 seconds, but I guess that's just my use case scenario 🤷🏼‍♂️

The only thing I am currently trying to wrap my head around is how this issue has been marked as "Closed" or "Resolved"

@Gadget43
Copy link

@Wheemer

Confirmed working for my three d1 minis.

Thanks for the fix to all involved. I guess smart alec ain't so smart after all, lol.

EDIT: I've disabled encryption, which may be why it's working for me.

Thanks for the side splitting laugh, I enjoyed that after what I was put through!

I really do have to admit, that as funny as that was, myself, not being a coder/programmer, would not want to be the person responsible for having to repair all these errors.

I take a look at some of the code and code fixes on GitHub and my mind boggles at the shear "mass of knowledge" of some of these guys/gals keeping HA afloat, and I very quickly, re-appreciated how much work has gone in to it, and my frustrations and anger subside... Slightly!

It IS extremely annoying landing up with non working nodes after an update, however, lesson learned, and I will be doing the updates after I have done my due diligence, and not just "Assuming All Is Good".

As the saying goes, fool me once, shame on you, fool me twice, shame on Me!

@ssieb
Copy link
Member

ssieb commented May 29, 2024

It would be a lot better if more people tested the beta. The developers can't test on the huge variety of hardware people have. Also, you should first test on something serial flashable if possible.

@ShonP40
Copy link

ShonP40 commented May 29, 2024

As much as I like running beta software, doing it with ESPHome on a house scale isn't really feasible.
Especially when you're compiling it on a Raspberry Pi 5 which takes about 1.5 hours to upload new firmware to all my devices. (Considering that there are multiple beta releases a week)

Also, out of the 50+ devices I have on ESPHome, only a single one of them had this issue so it'll be hard to find on a small scale install (disabling encryption didn't fix it for me, I just ended up reverting to the latest 2024.4 release).

@ssieb
Copy link
Member

ssieb commented May 29, 2024

I certainly don't mean to run beta on everything, but a couple of tests of some representative hardware would be helpful.
Also, beta is only around a week usually about the second week of the month.
You can watch the #beta discord channel to see when it starts.

@otto2704
Copy link

Well, I also have 25 productive nodes and one had the problem.
Plus: many of them are somewhere in the walls and to gaining physical access is lots of work in some cases.
I understand that beta testing is important, but I do not really have "representative" hardware. I am having minis, 8266 nodemcus, esp32s and so on. Also the sensors attached are varying. The one I had problems with in this case did not have any special hardware. Just some buttons and a relay...

@ShonP40
Copy link

ShonP40 commented May 29, 2024

The one I had issues with only had an IR transmitter with a few template switches/buttons to transmit IR codes

@FGOD1983
Copy link

2024.5.4 did solve the issue for me too

@Gadget43
Copy link

The one I had issues with only had an IR transmitter with a few template switches/buttons to transmit IR codes

Just out of curiosity, what type of node did this cause issues on? Mainly i just wanted to see if there was any relevance to my situation where it mainly affected the ESP01-1M and Esp8266's that are most likely clones.

@ShonP40
Copy link

ShonP40 commented May 31, 2024

The one I had issues with only had an IR transmitter with a few template switches/buttons to transmit IR codes

Just out of curiosity, what type of node did this cause issues on? Mainly i just wanted to see if there was any relevance to my situation where it mainly affected the ESP01-1M and Esp8266's that are most likely clones.

It was a WeMos D1 Mini (ESP8266).
But I have a ton more modes like that and none had the issue

@HWiese1980
Copy link

2024.5.4, I'm just now encountering this very issue. Same setup, Wemos D1 Mini (ESP8266), LD2410.

Encryption enabled -> problem seems to persist
Encryption disabled -> problem seems to be solved

@AdrianGarside
Copy link

AdrianGarside commented Jun 1, 2024

I don't want to upgrade my home assistant esphome for 2024.4.2 but it seems the devices initialized from esphome-web are now on 2024.5.4 and don't get detected/appear for 2024.4.2?

Edit: Actually, probably user error - I had a second device connected to my PC that I was flashing instead of the one I intended to. And that was already in esphome/home assistant. Sadly, esphome let me add the device manually and quite happily overwrote the original yaml file for that device when I used the same esphome-web- format so I'll have to set it back up from scratch.

@RealDeco
Copy link

RealDeco commented Jun 3, 2024

It was a WeMos D1 Mini (ESP8266). But I have a ton more modes like that and none had the issue

no, it also happened with a esp8285, a 01S (8266 compatible), haven't tried the 2024.5.4 yet, i'm in no horry to cause more work than i want for myself as i have a lot of esp devices, so for now i stick the 4.2

@ShonP40
Copy link

ShonP40 commented Jun 3, 2024

2024.5.4 fixed it for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests