home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
72.76k stars 30.47k forks source link

Wrong Riemann Sum value #106917

Closed CapitanCatarro closed 9 months ago

CapitanCatarro commented 9 months ago

The problem

Hello there, so I have this Blitwolf SHP13 smart plug with power meter, integrated via ZHA using a Conbee II. The smart plug exposes 2 sensor: One is the Power The other one is the Energy

As I don't trust the Energy, I've decided to create a Rieman Sum Helper using the sensor with the Power, but something is going wrong with the Riemann Sum. I've attached a water boiler for making tea, when is on the Power is about 1000 W, it stays on, I don't know, few minutes (about 2 to 5) but the Riemann Sum adds suddenly about 5 kWh to the amount (while the exposed Energy Sensor only adds some decimals) as you can see from pictures...

image

Power (with very short peaks)

image

The exposed energy sensor (as you can see it only adds some decimals)

image

The Riemann Sum (that adds about 5kWh)

I have to say that I have another identical smart plug, with the washing machine attached, I've made the same Riemann Sum sensor and it only differs on decimal with the smart plug exposed one:

image

(0,5 is quite a lot for just one day, but I can say that the value is correct)

Any Idea?

What version of Home Assistant Core has the issue?

core-2023.12.4

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

No response

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

home-assistant[bot] commented 9 months ago

Hey there @dgomes, mind taking a look at this issue as it has been labeled with an integration (integration) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `integration` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign integration` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


integration documentation integration source (message by IssueLinks)

dgomes commented 9 months ago

water boiler is a resistive load, you should use method left for it.