core icon indicating copy to clipboard operation
core copied to clipboard

Derivative sensor stuck (when it should become 0)

Open kugel- opened this issue 1 year ago • 2 comments

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). grafik

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: grafik

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

kugel- avatar Sep 22 '24 06:09 kugel-

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?

kugel- avatar Sep 22 '24 08:09 kugel-

@emontnemery @dougiteixeira I saw you worked on the derivative sensors recently. Can you please look into this?

kugel- avatar Sep 22 '24 08:09 kugel-

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 close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign derivative 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)


derivative documentation derivative source (message by IssueLinks)

home-assistant[bot] avatar Sep 29 '24 10:09 home-assistant[bot]

Duplicate of #83496

karwosts avatar Nov 27 '24 05:11 karwosts

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

karwosts avatar Jul 07 '25 14:07 karwosts