Automations sometimes won't start

This morning I stepped into the bathroom first thing and the lights didn’t come on. I checked the logs and motion was detected but the automation never started. I tried my other motion detector and same thing - lights were dead even though motion was detected. I tried to turn on the lights in the guest room. Nothing happens - button event registers but the automation to turn the lights on doesn’t start. Same for every button I try that requires automation (buttons with successful bindings still works).

After a few minutes one of the lights suddenly come on (automation kicked in) without me doing anything. One light after another slowly begin to turn on, buttons respond faster and faster and eventually everything is back to normal.

This happens from time to time but never this bad. It is usually in the morning when I turn on the first light that it takes half a minute or so and after that all is normal. This morning was about 10 minutes before things started working.

Anyone have a clue to what’s happening?

ZHA events do fire.
Automations are as simple as can be (made from UI):

alias: Guest room window on
description: ''
trigger:
  - device_id: a30c
    domain: zha
    platform: device
    type: remote_button_short_press
    subtype: turn_on
condition: []
action:
  - type: turn_on
    device_id: f30a
    entity_id: switch.control_outlet_2_on_off
    domain: switch
mode: single

System:
Raspberry Pi 4
Home Assistant OS 6.6
supervisor-2021.10.8
core-2021.11.5

Are you monitoring your CPU load?

1 Like

After your tip I have now installed the systemmonitor sensor and the processor_use variable/entity. If this happens again I will be able to check that.

I agree that this feels like a 100% CPU problem. However, the UI was very responsive and why would CPU be spiking for at least 10 minutes when everyone is sleeping and it’s not used at all? The system is dedicated to HA. Backups are done much later - like at 10.

There’s also the automation trace you can use to see what happened.

1 Like

No, the automations really never fired hence no trace. When they do they work fine with trace.

The only other thing to check is the state of your zigbee network. Maybe that is getting flooded with garbage messages?

1 Like

Yes, I thought of that and tested for it - zha_events were coming in to HA instantly and bound devices (Device → Device) worked perfectly. Some of the automations are from blueprints and some have sun.sun dependencies and I thought about that for a while but not even the simple and condition free Button → Switch automations fired (‘Last triggered’ time was not updated).

Happened again yesterday morning. Bathroom motion (registered instantly in HA) didn’t fire the automation, tried entrance sensor and same thing there. Unfortunately I didn’t have time to spend any time on investigating but Processor use was at 2% the whole time. This was well an hour before sunrise so my sun.sun dependency suspicion is ruled out.