How to delete data in InfluxDB? Questions

Hi there!

I need to delete some entries in InfluxDB:

USE "home_assistant"; SELECT * FROM "kWh" WHERE "entity_id" = 'strom_bezug' AND "value" = 0

Here I see exactly 100 entries. Those I want to delete.

So I thought - as naive as I am - I just try this:

USE "home_assistant"; DELETE FROM "kWh" WHERE "entity_id" = 'strom_bezug' AND "value" = 0

This gets me the error:

“fields not supported in where clause during deletion”

So this is not working. Then I tried to delete the entries by date, what is also not working:

I get one entry through “SELECT”:

"2024-08-08T07:46:10.909+02:00",,,,,,,,,"energy","sensor","strom_bezug",,"Strom-Bezug",,,,,,,,"HA","total_increasing",,"0"

And try to delete that specific entry by using:

USE "home_assistant"; DELETE FROM "kWh" WHERE time="2024-08-08T07:46:10.909+02:00"

But it is not deleted ans is still visible through a “SELECT” query… I also tried to play around with the timestamp. Even to delete an entry around that timestamp like:

USE "home_assistant"; SELECT * FROM kWh WHERE time >= '2024-08-08 07:46:10' AND time <= '2024-09-08 08:46:11'

But especially THAT last command just deletes EVERYTHING from 2024-08-08 07:46:10 until now… which is wierd…

Thanks for reading this far! :smiley:
So my questions are:

  • How can I delete all those entries properly?
  • I am right here in InfluxDB, right? So my wanted data is not stored in “home-assistant_v2.db”, right? Because I was wandering, that my Energy-Board did not refresh (erroneously) deleted data instantly. Does I need to wait here, until the Energy-Dashboard refreshes? Info: I just saw my configfile says: recorder: db_url: mysql://homeassistant:KDF26!jf1!jhfJJhhJH213499D@core-mariadb/homeassistant?charset=utf8mb4
    Does that mean, my Energy-Dashboard gets its Data from MariaDB? What did I then configure InfluxDB for? Is it redundant then?

Thanks SO much… I just wasted SO many hours now… I am desperate…Hope you guys can figure this out with me :slight_smile: