Home Assistent dying when cooking

I’m using Home Assistant OS 6.6 with core-2021.11.5 and supervisor-2021.10.8 on a Raspberry Pi 3 B. Furthermore, I’m using two plugins: ESPHome and “Terminal & SSH”.

I’m using a pulse_meter sensor to measure energy consumption in my home by looking at the 10,000 imp/kWh LED on my power meter. Whenever the energy consumption in my house rises above roughly 4 kW, Home Assistant stops working altogether.

When this happens, Home Assistant does not respond to connections on any port I’m aware of:

  • no SSH (port 22)
  • no Observer (port 4357)
  • no dashboard (port 8123)

What does work is ping to the IPv4 and IPv6 addresses.

After some time, typically after the massive power consumption has gone down, the observer and ssh come back up, however, the dashboard remains dead. To revive the system I need either a full restart or a ha core restart (over SSH).

Supervisor don’t show anything, Core logs start afresh after the restart so if there would be anything here, it’d be lost.

My current theory is, hence, that the frequent reporting of the ESPHome sensor to HA overwhelms the system. When the power consumption goes down and the reporting rate drops, the system becomes reachable, again, however, the core component remains dead. This seems supported by uptime reporting a load way beyond 20 after the systems gets reachable again.

Question:

  1. Can you give me any pointers what I should look at in addition?
  2. Is there a possibility to tell the ESPHome pulse_meter to report less often?
  3. If not, can we make Home Assistant store to the database less often? (no idea if that would already help)
My power meter sensor configuration
sensor:
  - platform: pulse_meter
    name: 'Power'
    state_class: measurement
    device_class: power
    pin: 
      number: 15
    unit_of_measurement: 'W'
    internal_filter: 10ms
    accuracy_decimals: 0
    filters:
      - multiply: 6.0
    total:
      name: 'Energy'
      unit_of_measurement: 'kWh'
      state_class: total_increasing
      device_class: energy
      accuracy_decimals: 3
      filters:
        # multiply value = 1 / imp value
        - lambda: return x * (1.0 / 10000.0) + 14796.5;

My current theory

Use the throttle filter:

1 Like

Do you have another power supply for the Pi?
Perhaps during the high energy consumption you experience voltage drop and it “browns out” the power to your Pi?
Just a thought.

1 Like

Thanks both, the throttle filter worked as expected. I’m using a 3A power supply intended for use with Raspberry Pi and hope power isn’t an issue.

What remains is that HA core regularly crashes when I’m compiling ESPHome. I can then ssh into the box and run ha core restart to remedy.

  1. Is there a way to auto-restart core on crash?
  2. It’s there a way to limit concurrency during platformio building? This may already be enough to fix the crashes.

increase the swap size:

Thanks. Adding a swap space seems to circumvent the core crash.