I have a power value which stays at zero for ages, then leaps up to a known 600w. When I try to use integral sensor to get energy, it always integrates over the whole period from when it first went to zero until it went to 600w, so I get a several kwh jump. Does not seem to matter which of the three integral i choose, and setting a short maximum period time like 2 min does not fix it either, which I thought should be the solution. Does integral just not work right when values is unchanging 0??

Use the correct method for your situation to minimise approximation errors. This,

`method: left`

See: https://www.home-assistant.io/integrations/integration/#integration-method

Thanks, but why does setijng “max sub interval” to 1minute not solve the problem? Seems like integral function is not adjusting ‘start of period’ when sub interval integral addition happens, and it then integrates over the whole main period anyway? OK, I guess sub interval gets you an intermediate update, but imo it should also adjust the base time.