Utility meter crashes browser - how to delete history?

I have an energy meter sensor setup via samsung smarthings.

My utility meter config now looks as follows:

utility_meter:
  daily_energy:
    source: sensor.bulb_energy_meter_energy_meter
    cycle: daily
    tariffs:
      - peak
      - offpeak
  monthly_energy:
    source: sensor.bulb_energy_meter_energy_meter
    cycle: monthly
    tariffs:
      - peak
      - offpeak

I have several months of single tariff history but recently added the peak / offpeak tariff.

If I click any of the utility_meter cards in the UI to view the graph, the laptop fans spin up and the browser crashes.

I’m guessing the HA doesn’t know what to do with the old data and gets stuck in a loop.

Is there a way I can delete the historic utility meter data?

I tried using the service reset but from what I gather from reading other posts, this doesn’t affect the history

You can edit the database.

Thanks, I deleted the entries using the Sqlite addon :+1:

delete from events where json_extract(event_data, '$.entity_id') = 'utility_meter.daily_energy';
delete from events where json_extract(event_data, '$.entity_id') = 'utility_meter.monthly_energy';
delete from events where json_extract(event_data, '$.entity_id') = 'sensor.bulb_energy_meter_energy_meter';

delete from states where entity_id = ‘sensor.bulb_energy_meter_energy_meter’;
delete from states where entity_id = ‘utility_meter.daily_energy’;
delete from states where entity_id = ‘utility_meter.monthly_energy’;
1 Like