which integration method should be used to calculate energy for for this power graph?
Left or Trapezoidal ? https://www.home-assistant.io/integrations/integration/#integration-method
#Intergration method to calculate energy using this power graph
1 messages · Page 1 of 1 (latest)
Left is usually a good choice
Not sure if right has been fixed
Trapezoid only if it changes constantly and doesn't have many similar values
So left in this case
99,9% of the time left, yes
And trapezoid in this case
Could also do left there
Yes this is confusing me... I have both and both are same value
For now, maybe
It's about how it does the math, either through an average or an under/overestimate of the area
They all do have edge cases where their behavior differs significantly and over time those differences will accumulate
When in doubt, left is always a good choice
I asked both chatgpt and DEEPseek both insisted on trapzoidal
Used even paid model such as Gpt 4-o and GPT 4.1 they were quite insisting on trapzoidal
That is why I was in doubt
HA community always recommended left
llms don't really know, they just figure a likely response
They can actually calculate the data and reason why and which method to use but it seems they are still artifical intelligent only 🤣
Gemini same response
Gemini 2.5 pro reasoning math and code 🤣
trapezoidal has lower error and in most applications that's more important. But the LLM doesn't know HA sensors only stores values that are different from the previous one. That's where trapezoidal method would have large errors
Integration uses state_reported now, so having repeated values would not be a problem for it.
Trapezoidal would only be a problem if the sensor did not report an update for a long time. If it continually reports updates but at the same value, that will calculate correctly.
in this case Trapezoidal will work?
Ok great that avoids some of the error. But many devices don't report anything when they're off, like my AC. It will suddenly report 1kW and then trapezoidal will have a very large error
does constant value of 0 count as reporting?
sure
Install emoncms...
Emoncms?
Emoncms on any device. Is made for that. Integrates into HA.