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

Asus WRT total transferred data amount resets when reach 4GB #31404

Open
daha76 opened this issue Feb 2, 2020 · 48 comments
Open

Asus WRT total transferred data amount resets when reach 4GB #31404

daha76 opened this issue Feb 2, 2020 · 48 comments
Assignees

Comments

@daha76
Copy link

daha76 commented Feb 2, 2020

The problem

I have latest Hassio running in docker on RPi 3B+. I added AsusWRT integration but when I streaming/downloading the amount of transferred data can show maximum of 4GB and then it starts form 0. Looks like counter overflow.

Environment

arch | armv7l
dev | false
docker | true
hassio | true
os_name | Linux
python_version | 3.7.6
timezone | Europe/Bratislava
version | 0.104.3
virtualenv | false
mode | storage
resources | 0
views | 4

Problem-relevant configuration.yaml

asuswrt:
  host: 192.168.1.1
  username: admin
  password: !secret asus_router
  sensors:
    - upload
    - download
    - upload_speed
    - download_speed

Additional information

Link to the download sensor stats https://drive.google.com/open?id=10Nq5VoGWbOcAzAS7jLQm-ZlzfWGRuRQ9

@probot-home-assistant
Copy link

Hey there @kennedyshead, mind taking a look at this issue as its been labeled with a integration (asuswrt) you are listed as a codeowner for? Thanks!

@ZetaPhoenix
Copy link

More information and history in #18643 that got closed due to inactivity.

@daha76
Copy link
Author

daha76 commented Feb 3, 2020

Hmmm thanks for the info. As there is no solution, it looks like nobody cares. My router reports proper amount of transferred data and because there is a 4.3GB max value it looks like counter overflow. This overflow can be a risky or can cause memory leaks.

@kennedyshead
Copy link
Contributor

I care about this, Its just that I have not found the solution yet ;)

@daha76
Copy link
Author

daha76 commented Feb 3, 2020

Ok, THX ;-) Just a wrong assumption as the previous thread was closed because of inactivity. Sorry.

@wtzb
Copy link

wtzb commented Apr 30, 2020

image

Also able to reproduce this issue.

@robertormpc
Copy link

Im having the same issue, when the download and upload counter reaches 4.3gb it individually resets.
I have Home assistant 109.6 and asuswrt to the latest version 3.0.0.4.385_20490 - router RT-AC88U.

I would love to have a proper meter for this.

Not sure if it helps, but at the post #18643 (comment) looks like @arigit found a workaround. Im not technically capable to perform it with such overview guidelines though.
I holp there's a solution to this.

All the best,

@mwunderling
Copy link

Throwing my hat in the ring as I care about this as well. Having the same issue as the other commenters. This renders the upload/download sensor data meaningless. Would hugely appreciate any commentary whether a fix may be available "soonish" or if a viable workaround like using a template counter is possible.

@brunokelo
Copy link

I have the same problem.

@CoreyVidal
Copy link

I care about this. There's 2 threads I've been following for years now:

#18643 and #19002

Any ideas?

@automaton82
Copy link
Contributor

I also have this problem. It appears the library aioasuswrt the following to get the RX / TX amounts:

_RX_COMMAND = 'cat /sys/class/net/{}/statistics/rx_bytes'
_TX_COMMAND = 'cat /sys/class/net/{}/statistics/tx_bytes'

The problem is that file is not accurate, and there doesn't seem to be any other way to get an accurate value out of it.

So at this point I think there's no way to solve this unless HA starts maintaining historical data for this, which is probably not ideal.

@github-actions
Copy link

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.

@github-actions github-actions bot added the stale label Jan 26, 2021
@daha76
Copy link
Author

daha76 commented Jan 26, 2021

It looks like nobody willing to fix this...

@github-actions github-actions bot removed the stale label Jan 26, 2021
@ildar170975
Copy link

ASUS AC66U, ASUS AC68U - same problem:
изображение

@BaQs
Copy link
Contributor

BaQs commented Mar 5, 2021

I suppose this issue is similart to what you could see in snmp: when the counter is "too high", it resets to zero. and does not increment itself.

@ildar170975
Copy link

It may depend on type of variable used to calculate traffic: if it is 32bit integer then the max value is 2^32=4294967296 which may be presented as ~4.3 (which is not actually right).

@github-actions
Copy link

github-actions bot commented Jun 3, 2021

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.

@github-actions github-actions bot added the stale label Jun 3, 2021
@CoreyVidal
Copy link

This should not be closed.

@probot-home-assistant
Copy link

asuswrt documentation
asuswrt source
(message by IssueLinks)

@probot-home-assistant
Copy link

Hey there @ollo69, mind taking a look at this issue as its been labeled with an integration (asuswrt) you are listed as a codeowner for? Thanks!
(message by CodeOwnersMention)

@mattmoo
Copy link

mattmoo commented Sep 25, 2021

Would be good to see a solution.

@mattmoo
Copy link

mattmoo commented Oct 6, 2021

Maybe one day this will be fixed, until then I added some sensors using the integration platform that seem to work okay.

- platform: integration 
  source: sensor.asuswrt_upload_speed
  name: asuswrt_upload_integral_total_mbit
  unit_time: s
  round: 0
  method: left
  
- platform: template 
  sensors:
    asuswrt_upload_integral_total_gb:
      friendly_name: "Upload total"
      value_template: "{{ (states('sensor.asuswrt_upload_integral_total_mbit')|float / 8192) | round(1) }}" 
      unit_of_measurement: GB

      
- platform: integration 
  source: sensor.asuswrt_download_speed
  name: asuswrt_download_integral_total_mbit
  unit_time: s
  round: 0
  method: left

- platform: template 
  sensors:
    asuswrt_download_integral_total_gb:
      friendly_name: "Download total"
      value_template: "{{ (states('sensor.asuswrt_download_integral_total_mbit')|float / 8192) | round(1) }}" 
      unit_of_measurement: GB

@issue-triage-workflows
Copy link

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.

@ildar170975
Copy link

up

@github-actions github-actions bot removed the stale label Feb 19, 2023
@iprak
Copy link
Contributor

iprak commented Feb 19, 2023

Yes still an issue.

@mattmoo
Copy link

mattmoo commented Feb 20, 2023

I think we can consider this abandonware, move to https://github.com/Vaskivskyi/ha-asusrouter

@ollo69
Copy link
Contributor

ollo69 commented Feb 20, 2023

I think we can consider this abandonware, move to https://github.com/Vaskivskyi/ha-asusrouter

Nothing to do with this issue that will not be fixed by a different integration version.

@issue-triage-workflows
Copy link

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.

@ildar170975
Copy link

up

@issue-triage-workflows
Copy link

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.

@ildar170975
Copy link

up

@github-actions github-actions bot removed the stale label Aug 22, 2023
@kennedyshead
Copy link
Contributor

Imo. the stastics integration is the way to go here, its either that or saving the value somewhere and appending to it but that seems to me as the same solution as statistics integration with the difference that its supported and a native solution to homeassistant.
maybe the new http version will handle this once merged

@issue-triage-workflows
Copy link

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.

@ildar170975
Copy link

up

@issue-triage-workflows
Copy link

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.

@ildar170975
Copy link

Still there
2024.2.3

изображение

@iprak
Copy link
Contributor

iprak commented Feb 27, 2024

up

@kaijk
Copy link

kaijk commented Apr 11, 2024

Until/if this issue is resolved, consider passing the data into a template sensor with a state_class: total_increasing. That sensor should not reset to zero even if the source sensor does so. Best also to convert to MB or GB units in the template sensor. (Note: I'm not sure what the units are from the native sensor so you may need to adjust the divisor).

platform: template:
  sensors:
    - unique_id: asuswrt_cumulative_upload
      name:      ASUSWRT Cumulative Upload
      state_class: total_increasing
      unit_of_measurement: "MBits"
      state: >-
        {{ 
              sensor.<your router>_upoad | int(0) / 1024
        }}

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