Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ASUSWRT: download/upload traffic sensors have "total_increasing" - but they may change down #117598

Open
ildar170975 opened this issue May 16, 2024 · 6 comments

Comments

@ildar170975
Copy link

The problem

This is a different issue than #31404.

Here is a history for "download" & "upload" sensors (along with "uptime" sensor):

изображение

The "uptime" sensor is provided by SNMP integration.
On this graph is is clearly visible that "download" & "upload" data are reset at every router's reboot.

Both "download" & "upload" sensors have a state_class: total_increasing:

изображение

There a warnings in Log:

2024-05-17 00:35:10.521 WARNING (Recorder) [homeassistant.components.sensor.recorder] Entity sensor.ac68u_download from integration asuswrt has state class total_increasing, but its state is not strictly increasing. Triggered by state 0.406751801 (0.416624954) with last_updated set to 2024-05-16T21:33:01.314263+00:00. Please create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+asuswrt%22
2024-05-17 00:35:10.522 WARNING (Recorder) [homeassistant.components.sensor.recorder] Entity sensor.ac68u_upload from integration asuswrt has state class total_increasing, but its state is not strictly increasing. Triggered by state 0.247178351 (0.248717192) with last_updated set to 2024-05-16T21:33:01.314467+00:00. Please create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+asuswrt%22
2

What version of Home Assistant Core has the issue?

2024.5.3

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Container

Integration causing the issue

ASUSWRT

Link to integration documentation on our website

https://www.home-assistant.io/integrations/asuswrt/

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
Copy link

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

Code owner commands

Code owners of asuswrt 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 asuswrt 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)


asuswrt documentation
asuswrt source
(message by IssueLinks)

@ollo69
Copy link
Contributor

ollo69 commented May 26, 2024

Based on HA development guide, in the section How to choose state_class and last_reset, the state_class total_increasing should be the right one for this kind of sensor. I think that the issue here is not in the integration but in the way that HA is managing this state_class.

@ildar170975
Copy link
Author

Imho, if some entity is declared as “total_inreasing” - it is assumed as “always increasing”, right?
Then, if this entity becomes less - this is probably considered as an error - and we can see that warning.
So, probably the integration should never ever make this entity less, only “increasing”.

@ollo69
Copy link
Contributor

ollo69 commented May 26, 2024

Imho, if some entity is declared as “total_inreasing” - it is assumed as “always increasing”, right?

No, this is not what is explained in the link that I put in my previous post, please read it.

@ildar170975
Copy link
Author

ildar170975 commented May 28, 2024

please read it.

I see, guess this is what you meant:

изображение

So, in this doc it is said that the total_inreasing can be 0.
If "download" & "upload" sensors may be reset to 0 (which happens in fact) - this is either "by design" or "bug".
In both cases - HA should NOT consider this fact as a bug, yes?
If so - shall I close THIS issue and open an issue for HA "in general"?
(in my experience - many issues I opened in core are staying w/o any feedback)

@ollo69
Copy link
Contributor

ollo69 commented May 28, 2024

Let me just do some additional checks. It could be possible that when router reboot first value reported after reboot is not 0 and may be this create issue in the ha logics...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants