esphome / issues

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

Periodical esp reboot when using 'platform: integration/total_daily_energy' #2464

Open Spirituss opened 3 years ago

Spirituss commented 3 years ago

The problem

In case I add the platform: integration and platform: total_daily_energy to esp8266, it starts to reboot every 5-15 hours (statistically). If I remove these platforms but keep other parts of the configuration, esp works stable for some months. It seems that integration leads to an unhandled exception which cause esp reboot.

Which version of ESPHome has the issue?

All

What type of installation are you using?

Docker

Which version of Home Assistant has the issue?

All

What platform are you using?

ESP8266

Board

No response

Component causing the issue

No response

Example YAML snippet

Here is my esphome config:

esphome:
  name: ${device_name}
  platform: ESP8266
  board: esp8285
  esp8266_restore_from_flash: true  

....

sensor:
  - platform: integration 
    name: energy_monthly_${device_name}
    id: id_energy_monthly
    sensor: id_power
    time_unit: h
    filters:
      - multiply: 0.001
    accuracy_decimals: 3
    restore: true
    state_class: measurement
    device_class: energy
    last_reset_type: auto
#-------------------------------------------------------------------------------    
  - platform: total_daily_energy 
    name: energy_daily_${device_name}
    id: id_energy_daily
    power_id: id_power
    filters:
      - multiply: 0.001
    accuracy_decimals: 3   
    device_class: energy
#-------------------------------------------------------------------------------
  - platform: hlw8012
    sel_pin:
      number: GPIO12
      inverted: true
    cf_pin: GPIO05
    cf1_pin: GPIO4
    power:
      name: power_${device_name}
      id: id_power            
    change_mode_every: 4
    update_interval: 10s

Anything in the logs that might be useful for us?

No response

Additional information

I use about 100 different esphome devices - the statistics is similar on all of them.

oxan commented 3 years ago

See also #2366.

oxan commented 3 years ago

Are you also using MQTT?

Spirituss commented 3 years ago

Are you also using MQTT?

Do you mean epshome? No. But I use it in HA.

oxan commented 3 years ago

Hmm, that's strange, as in #2366 it was resolved by disabling MQTT. But if you can reproduce it without having MQTT enabled on the ESPHome device, it is unlikely to be cause.

tschundler commented 3 years ago

I updated my ticket a few days ago, but forgot to update here too. It wasn't MQTT. It lasted over a day, but still rebooted and then again much less than a day. So it was mostly by luck I think.

Spirituss, do you also find it seems to be related to how long current is being drawn?

Spirituss commented 3 years ago

Spirituss, do you also find it seems to be related to how long current is being drawn?

Nothing has changed - I still see reboot for some esp every 12-24 hours. I tried different firmware versions, the same result. In case I remove 'integration' component, reboots are gone. So, I'm pretty sure that especially this component is the reason of this headache.

Spirituss commented 2 years ago

Any news here? The bug is annoying

oxan commented 2 years ago

I don't expect any progress on this bug to be made until someone manages to capture a stack trace during the reboot.