HA Energy setup not showing correct data

I managed to get the Energy setup working with my inverter data.
I have been running this for 2 hrs and can see the data in the Energy section (Screnshot below)
My inverter data is Watts with “voltronic_pv_in_watts” will max to 2400 W as i have <3KW system and my consumption “voltronic_load_watt” has averaged to <300W for the 2 hrs it have the Energy setup.
My inverter sensors are showing correct Watts, i have been running this for 2 years now.
However if you look at the Energy screenshot its showing consumption 26.68kW and pv output as 107.52kw in less then 2 hrs which is ridiculous.

I am assuming its the Reimann Integration, maybe the parameter " unit_time: min" , should this be sec? or is the issue something else.

below are the values from my inverter, i get them updated in HA from inverter every 5-8 sec . The value is in Watts

  - platform: mqtt
    name: "voltronic_pv_in_watts"
    state_topic: "homeassistant/sensor/voltronic_pv_in_watts"
    unit_of_measurement: "W"
    icon: "mdi:solar-panel-large"
  - platform: mqtt
    name: "voltronic_load_watt"
    state_topic: "homeassistant/sensor/voltronic_load_watt"
    unit_of_measurement: "W"
    icon: "mdi:chart-bell-curve"

below is my Reimann Sum integral integration to supposedly convert the Watts to KWh

  - platform: integration
    source: sensor.voltronic_pv_in_watts
    name: pv_in_battery
    unit_prefix: k
    unit_time: min
    round: 2
  - platform: integration
    source: sensor.voltronic_load_watt
    name: battery_consumed
    unit_prefix: k
    unit_time: min
    round: 2

Below is the display in my energy screen

The pv_in_watts and load_watt display
image

Try removing unit_time completely and see if you get correct results.

Thanks @Burningstone that worked

the values seems correct now. Is there a way to remove old data e.g. all of todays data so it can record fresh from tomorrow

If you don’t care about other data, the easiest way is to completely delete the homeassistant_v2.db file.
Otherwise you need an SQL browser or similar to remove individual entries from the .db file.