Integration - Riemann sum integral Helper

I have a heater in my workshop (1.3kW) which is controlled by a Sonoff Power R2 switch . The Switch is named sensor.sonoff_workshop_heater. I use the power entity {sensor.sonoff_workshop_heater_power) in a ‘integration - Riemann sum integral’ Helper to create ‘Workshop Heater Consumption’ in kWh. The heater is switched on and off using an automation that monitors the temperature in the workshop. Normally, when switched on it stays on for approx 30min.

The issue I have is that as soon as the heater switches on the kWh consumption increases by approx 5kWh. It then continues to increase as expected based upon the 1.3kWh load over the next 30 mins. Obviously this initial large increase in consumption is totally incorrect but I dont know why it is happening. See image.

Workshop Energy

Does anyone have any ideas why this is happening but more to the point on how to solve it

Thanks
The Boffin

I’m not at all sure what could be wrong, but may I ask what method you chose for the integration? As far as I understand it you should choose Left when dealing with power consumption.

Thanks for your response zenzay42. I am not sure which method is being used because there doesn’t seem to be a way of checking once the helper has been created. Do you know of a way to check it or is the only option to delete and recreate it.

As far as I know, you can only change number precision after having created the helper. So yeah, it does seem like the only option is to delete and recreate it.

Edit: I’ve just looked and you can probably find the setting if you open up the core.config_entries file, which should be in the (hidden) .storage folder on your HA installation.

I just quickly created a dummy helper called test and found this in core.config_entries:

      {
        "entry_id": "7df4804ed6d318e1a594d47b4c5ee04a",
        "version": 1,
        "domain": "integration",
        "title": "test",
        "data": {},
        "options": {
          "name": "test",
          "source": "sensor.autolight_sun_angle",
          "method": "trapezoidal",
          "round": 2.0,
          "unit_prefix": "none",
          "unit_time": "h"
        },
        "pref_disable_new_entities": false,
        "pref_disable_polling": false,
        "source": "user",
        "unique_id": null,
        "disabled_by": null
      }

many thanks for the info, your help is very much appreciated.
I checked and found that the helper is set to “trapezoidal”. Not sure if I can safely edit the ‘core.config_entries’ file so I’m going to delete and recreate as ‘Left’. I will update once tested.
Many thanks again

Update: It looks likely that changing from “trapezoidal” to “Left” has stopped the step increase