Derivative sensor stuck (when it should become 0)
The problem
Hello, I have a pesky issues with a derivative helper sensor. Sometimes it becomes stuck at non-zero values for multiple hours, even tough if the underlying sensor does not increase any more. This is very irretating as we don't actually drain power from the grid but the derivative sensor keeps saying we drain lots of power from the grid.
See in the screen shot, the derivative sensor reports 358W all the way since 7:02 (and currently still does, both screenshots are made at ~8:15).
The source for the derivate sensor is a smart meter sensor (from the EDL21 integration). It reads data from an IR sensor attached to the smart meter and the smart meter is pushing data every second. This sensor stopped increasing exactly at 7:02 as well:
It stopped increasing because we really don't drain power from the grid anymore, everything is handled by the PV modules and battery.
So I'm not actually sure if root cause is with the derivative sensor or with the smart meter sensor. However, I am fairly sure that I didn't experience this problem in core-2024.08.x and earlier. I began observing this immediately after updating to core-2024.09.1 and it still happening.
If you need more info, please let me now.
What version of Home Assistant Core has the issue?
core-2024.9.2
What was the last working version of Home Assistant Core?
core-2024.8.x
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
FWIW, I tried a hack in the edl21 integration to push new values to HA every second (i.e. removed the rate limit here https://github.com/home-assistant/core/blob/dev/homeassistant/components/edl21/sensor.py#L420 ) and while I could clearly see that the smart meter sensors now update very frequently, the derivative sensor was unimpressed. It's still stuck at 358W.
So I guess this indicates that the derivative sensor is really the problem, isn't it?
@emontnemery @dougiteixeira I saw you worked on the derivative sensors recently. Can you please look into this?
Hey there @afaucogney, mind taking a look at this issue as it has been labeled with an integration (derivative) you are listed as a code owner for? Thanks!
Code owner commands
Code owners of derivative can trigger bot actions by commenting:
@home-assistant closeCloses the issue.@home-assistant rename Awesome new titleRenames the issue.@home-assistant reopenReopen the issue.@home-assistant unassign derivativeRemoves the current integration label and assignees on the issue, add the integration domain after the command.@home-assistant add-label needs-more-informationAdd a label (needs-more-information, problem in dependency, problem in custom component) to the issue.@home-assistant remove-label needs-more-informationRemove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.
(message by CodeOwnersMention)
derivative documentation derivative source (message by IssueLinks)
Duplicate of #83496
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.
Fixed by https://github.com/home-assistant/core/pull/125870