Clear History?

I testing out the Unfi device tracker and had it set to track all new devices. Forgot to turn it off after I got what I wanted and now I have a ton of devices being tracked in history that I do not want. Is there a way to clear out all the history records and start fresh? this way it only picks up on the devices that I have set to track.

Delete \hassio\config\home-assistant_v2.db and restart.

1 Like

That worked, thank you!

I deleted home-assistant_v2.db, excluded entity in recorder component, restarted, but I still see history for the excluded component. Where elsewhere are history data stored?

recorder:
  purge_keep_days: 3
  purge_interval: 1
  exclude:
    entities:
      - sensor.business_keypad
      - sensor.home_keypad
      - binary_sensor.servis__motion
      - binary_sensor.servis__door
      - binary_sensor.shop__front_door
      - binary_sensor.shop__motion
      - binary_sensor.warehouse
1 Like

I can automatically have this done for the history of a month old

Hi

I deleted this file and now my HA will not start up!

You deleted only “home-assistant_v2.db”, correct? Something else would be causing the issue. I’ve had to delete the file numerous times due to database corruption, and never had an issue.

1 Like

thank’s a lot for this tips ! It fixed a 2 days head scratching issue :slight_smile:

1 Like

It is always a good idea to stop the Home Assistant host first before deleting the home-assistant_v2.db file.