Influxdb setup for electricity & temp

I setup influxdb & grafana when I installed HA years ago.
I’ve never used them. Now it’s just filling up the DB, I want to set it properly.

I have solar from solar analytics.yaml
I have temp/humidity sensors in each room
I have a few power plugs with monitors

I think that’s all I really want recorded.

In influxdb I changed to

    - sensor.sa_mer_percentage
    - sensor.*humidity
    - sensor.*temperature
    - sensor.sa_todays_energy*
    - sensor.sa_data_by_5min_energy*
    - sensor.sa_live_site_data*

Maybe what I want are W(atts)
C (deg)
% (humidity)

Then, how do I:

  1. delete all other data I’ve saved these 2 years from the db
  2. or just delete the whole db and start again?

I found a better way to clean up

use homeassistant; drop measurement "mm"

Seems to remove the index too

Half the time error 504 tho

Also regex isn’t same as sql - why keep making so many similar standards?

use homeassistant; delete from "%" where entity_id =~ /.*battery$/