-
-
Notifications
You must be signed in to change notification settings - Fork 34.6k
Description
The problem
Hello,
I have tracked down an issue where a core component of Home Assistant is creating a constant stream of events where the event_type
is NULL in the recorder database.
The Problem:
- On every Home Assistant restart, the system creates a "burst" of ~175-300 NULL events.
- After the initial burst, it continues to create a slow but steady "drip" of new NULL events during normal operation.
How I confirmed this is a Home Assistant Core issue:
I have performed an extensive and systematic process of elimination and can confirm the issue is not caused by any user-configured integration or configuration.
- The issue occurs on a clean MariaDB database.
- I systematically disabled every single custom component (HACS, Loxone, etc.) -> The problem persisted.
- I systematically disabled every single UI-configured integration (Mobile-App, cloud integrations, etc.) -> The problem persisted.
- I then switched to a minimal
configuration.yaml
containing onlydefault_config:
and therecorder:
entry. - Even in this absolute minimal, clean state, a restart still creates a burst of ~175 NULL events, and the number continues to rise slowly over time.
This proves the issue is not in my configuration, but within a core component loaded by default_config:
or the supervisor itself.
After re-enabling all my integrations (~1000 entities, 51 automations), the number of NULL events is increasing much faster than in the minimal setup.
I have discovered the problem is not just the events
table.
The states
table is also being filled with records where the entity_id
is NULL
.
When I run the following query to find the most active entities, it shows that ALL state changes are being recorded without an entity_id
:
SELECT entity_id, COUNT(*) FROM states GROUP BY entity_id;
This query returns a single row where entity_id is NULL and the count is over 50,000.
And I just switched to MariaDB a few hours ago. I must have had this problem before since my database file had over 2gb within just a few weeks.
I ran the following two diagnostic queries to verify if events are being written to the Home Assistant database:
SELECT state_id, entity_id, state, last_updated_ts FROM states WHERE entity_id IS NULL LIMIT 5;
state_id | entity_id | state | last_updated_ts
256 | NULL | home | 1753082301.28
512 | NULL | unknown | 1753082301.79
768 | NULL | on | 1753082303.89
1024 | NULL | unavailable | 1753082315.07
1280 | NULL | 8.0 | 1753082315.18
Let me know if you need any further logs or diagnostics.
What version of Home Assistant Core has the issue?
2025.7.2
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant OS
Integration causing the issue
No response
Link to integration documentation on our website
No response
Diagnostics information
No response
Example YAML snippet
### Anything in the logs that might be useful for us?
```txt
Additional information
No response