esphome / issues

Issue Tracker for ESPHome
https://esphome.io/
290 stars 36 forks source link

ESP32 sporadically hang and MQTT Disconnect when using clock based deep sleep #3799

Open boehser-enkel opened 1 year ago

boehser-enkel commented 1 year ago

The problem

Using MQTT to set deep sleep duration. When using a time (until: "07:00:00") ESP sporadically hangs at startup and or disconnects from MQTT (MQTT Disconnected: TCP disconnected.) This only happens when "lang" is set so the ESP wants to sleep til 07:00:00.

Which version of ESPHome has the issue?

2022.11.1

What type of installation are you using?

Docker

Which version of Home Assistant has the issue?

2022.11.3

What platform are you using?

ESP32

Board

D1 Mini

Component causing the issue

deep_sleep

Example YAML snippet

esphome:
  name: muelltonnen

esp32:
  board: esp32dev
  framework:
    type: arduino

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "soXvUF6gt5kDZTaD3qQQQrp86/6KIfCIWK7cVGyg1wc="

ota:
  password: "0ffa546da2a3363dd9a7871ce306409c"

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

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Muelltonnen Fallback Hotspot"
    password: "0S5gZIpeYaTB"

captive_portal:

#web_server:

time:
  - platform: homeassistant
    id: homeassistant_time
    timezone: "Europe/Berlin"

deep_sleep:
  run_duration: 15sec
  sleep_duration: 15min
  id: deep_sleep_1

mqtt:
  broker: 192.168.88.202
  username: mqtt_user
  password: ************
  on_message:
    - topic: muelltonnen/sleep
      payload: 'aus'
      then:
        - deep_sleep.prevent: deep_sleep_1
    - topic: muelltonnen/sleep
      payload: 'lang'
      then:
        - deep_sleep.enter:
            id: deep_sleep_1
            until: "07:00:00"
            time_id: homeassistant_time

Anything in the logs that might be useful for us?

No response

Additional information

No response

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.