How do I find and delete a sensor that fails?

I have this warning in my log

Loggare: homeassistant.components.sql.sensor

Källa: components/sql/sensor.py:312
integration: SQL (dokumentation, ärenden)
Inträffade först: 26 december 2025 18:03:32 (1968 förekomster)
Senast loggade: 10:27:05

SELECT table_schema AS 'db_name', ROUND(SUM( data_length + index_length ) / 1024 / 1024, 2) AS 'size_mb' FROM information_schema.TABLES WHERE table_schema='homeassistant' LIMIT 1; returned no results

A few years ago I played with size of the database but failed. I have seen the log now and then but now I want to get rid of it.
I don’t know where the definition of the sensor is so I can’t delete it.
I can see the sensor entity like this:


If I click on it I have no Delete button:

In the Terminal I have tried
find /config/ | grep yaml | xargs grep "sql"
It does not find any definition of the sensor. I have also tried to grep for sensor.database_size, database size.
Anyone who has a proposal for how I can delete the sensor definition to get rid of the warning?

Have you tried with another “word” … i.e “table_schema” ?
( Neither sql, nor sensor.database_size is within the reported query )
And in “folders” etc, if you have old i.e include-folders with sensor.yamls

It Could also be ( a request ) inside 1 of your “old” Views/Cards
( If so you have to remove this request, in the view/card, then after a reload/restart i think you can delete the sensor as well )

You could “un-click” activerad/synlig and update, i know it’s “Not What You want”, but until you find which doc this sensor(request) comes from, it’s might be a “remedy”

You have the SQL integration installed.

If that’s the only entity it has & you no longer need the integration, then disable/delete it.

Here be dragons. Make sure you have reliable, off device backups of your database before you start.

It’s a core integration which simply provides sensors. Deleting it won’t affect their db in any way.

1 Like

He could have wiped it(somehow) already, thou haven’t manually “cleaned up” in Views/Cards :slight_smile: Calling a select

So a peak in a RAW-Log could be “interesting” :slight_smile:

This was the solution. Thanks for pointing me in the right direction!
I removed the SQL integration, the warning is gone and HA works as it should.

1 Like