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 sensors upload / download " state_class: total_increasing , Not working #72591

Closed
boheme61 opened this issue May 27, 2022 · 20 comments
Closed

Comments

@boheme61
Copy link

boheme61 commented May 27, 2022

The problem

Haven't used these 2 sensors since i installed the AsusWrt-Integration, But "sensor.asuswrt_upload" + "sensor.asuswrt_download" have state_class: total_increasing , and measurement_unit GB(not that last matters in the context) , however these 2 Sensor turns up as either unknown or unavailable in GUI and DB

What version of Home Assistant Core has the issue?

core-2022.6.0b1

What was the last working version of Home Assistant Core?

No response Must be awhile ago, don't really know

What type of installation are you running?

Home Assistant OS

Integration causing the issue

AsusWrt

Link to integration documentation on our website

No response

Diagnostics information

"integration_manifest": {
"domain": "asuswrt",
"name": "ASUSWRT",
"config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/asuswrt",
"requirements": [
"aioasuswrt==1.4.0"
],
"codeowners": [
"@kennedyshead",
"@ollo69"
],
"iot_class": "local_polling",
"loggers": [
"aioasuswrt",
"asyncssh"
],
"is_built_in": true
},
"data": {
"entry": {
"entry_id": "b46f7d8cf94d1441ff3b9867e5a74371",
"version": 1,
"domain": "asuswrt",
"title": "192.168.50.1",
"data": {
"host": "192.168.50.1",
"username": "REDACTED",
"protocol": "ssh",
"port": 1066,
"mode": "router",
"password": "REDACTED"
},
"options": {
"consider_home": 180,
"track_unknown": true,
"interface": "eth0,eth1, eth2,eth3,eth4,eth5, eth6",
"dnsmasq": "/var/lib/misc"
},
"pref_disable_new_entities": false,
"pref_disable_polling": false,
"source": "user",
"unique_id": null,
"disabled_by": null
},

"device": {
"area_id": null,
"config_entries": [
"b46f7d8cf94d1441ff3b9867e5a74371"
],
"configuration_url": "http://192.168.50.1",
"connections": "REDACTED",
"disabled_by": null,
"entry_type": null,
"id": "c6a9a59c266863d8b2e7decb3211a504",
"identifiers": "REDACTED",
"manufacturer": "Asus",
"model": "RT-AX68U_EPA",
"name_by_user": null,
"name": "192.168.50.1",
"suggested_area": null,
"sw_version": "3.0.0.4 (build 386)",
"hw_version": null,
"via_device_id": null,
"is_new": false,
"entities": {

"sensor.asuswrt_upload": {
"unique_id": "REDACTED",
"platform": "asuswrt",
"area_id": null,
"capabilities": {
"state_class": "total_increasing"
},
"config_entry_id": "b46f7d8cf94d1441ff3b9867e5a74371",
"device_class": null,
"device_id": "c6a9a59c266863d8b2e7decb3211a504",
"domain": "sensor",
"disabled_by": null,
"entity_category": null,
"hidden_by": null,
"icon": null,
"id": "692cc49a4a8c0a020e711935757b0f8a",
"name": null,
"options": {},
"original_device_class": null,
"original_icon": "mdi:upload",
"original_name": "Asuswrt Upload",
"supported_features": 0,
"unit_of_measurement": "GB",
"state": {
"state": "unknown",
"attributes": {
"state_class": "total_increasing",
"hostname": "192.168.50.1",
"unit_of_measurement": "GB",
"icon": "mdi:upload",
"friendly_name": "Asuswrt Upload"
},
"last_changed": "2022-05-27T10:50:09.609656+00:00",
"last_updated": "2022-05-27T10:50:09.609656+00:00"
}

"sensor.asuswrt_download": {
"unique_id": "REDACTED",
"platform": "asuswrt",
"area_id": null,
"capabilities": {
"state_class": "total_increasing"
},
"config_entry_id": "b46f7d8cf94d1441ff3b9867e5a74371",
"device_class": null,
"device_id": "c6a9a59c266863d8b2e7decb3211a504",
"domain": "sensor",
"disabled_by": null,
"entity_category": null,
"hidden_by": null,
"icon": null,
"id": "619000f5456b73da6d9653cf0681c526",
"name": null,
"options": {},
"original_device_class": null,
"original_icon": "mdi:download",
"original_name": "Asuswrt Download",
"supported_features": 0,
"unit_of_measurement": "GB",
"state": {
"state": "unknown",
"attributes": {
"state_class": "total_increasing",
"hostname": "192.168.50.1",
"unit_of_measurement": "GB",
"icon": "mdi:download",
"friendly_name": "Asuswrt Download"
},
"last_changed": "2022-05-27T10:50:09.892281+00:00",
"last_updated": "2022-05-27T10:50:09.892281+00:00"
}

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No errors in logs

Additional information

No response

@probot-home-assistant
Copy link

asuswrt documentation
asuswrt source
(message by IssueLinks)

@probot-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!
(message by CodeOwnersMention)

@ollo69
Copy link
Contributor

ollo69 commented May 27, 2022

I do not understand what is the issue here?

@jazzyisj
Copy link

jazzyisj commented May 27, 2022

@ollo69 The upload and download sensors, both speed and data don't work. They all just report a value of zero. It's been months. I posted on the forum about the issue, nobody else responded so I figured it was just me until recently when a couple more people chimed in and confirmed.

https://community.home-assistant.io/t/asuswrt-upload-download-stats-not-working/402502
https://community.home-assistant.io/t/asuswrt-monitoring-wan/425239

I've recently changed over to a custom integration, so I don't have ASUSWRT installed but if someone will be actively working on this issue I can reinstall to help test any changes.

@boheme61
Copy link
Author

Sensor in ASUSWRT and a "working" sensor below

image

image

@ollo69
Copy link
Contributor

ollo69 commented May 27, 2022

I working on AsusWRT integration from sometime with the objective to use a new library to fix various problems. I opened some days ago PR #71899 that is based on this integration and related library.
I wasn't aware that this sensors was not working anymore, but probably the library based on http protocol should fix also these issues. If you can test the custom integration mentioned before and provide your feed-ack should be useful.

@boheme61
Copy link
Author

boheme61 commented May 27, 2022

I guess we don't know how to get these sensors to work, as they show as "unknown" or "unavailable" regardless of all attempts, If you need additional "data" feel free to ask.

Yes, i've testing the "mentioned" custom-integration now

https://github.com/Vaskivskyi/ha-asusrouter

It works(out of the box), but i don't know what info you might be interested in ?
Do you want same as above, for a specific sensor ?

PS: As i haven't used the upload/download sensors in asuswrt, since October last year, i can't say how it looked back then ...But i get a feeling that it's "missing" State + Attribute

@ollo69
Copy link
Contributor

ollo69 commented May 27, 2022

That integration is based on the code that I developed for https://github.com/ollo69/ha_asuswrt_custom but use a different library.
PR #71899 use the same code I implemented for custom integration.
So if sensors in https://github.com/ollo69/ha_asuswrt_custom will work, it is expected to work also in native integration if PR #71899 will be merged.

@boheme61
Copy link
Author

i will try ( hope it's enough to just disable asuswrt ) as i only disabled it, hours ago, testing the other custom_component

@boheme61
Copy link
Author

boheme61 commented May 27, 2022

So if sensors in https://github.com/ollo69/ha_asuswrt_custom will work, it is expected to work also in native integration if PR #71899 will be merged.

Hmmm, don't turn up in search, only the same "default" ASUSWRT ,and the one im currently testing

image

Ahh, i get it, you use that ;) , guess i have to remove the "disabled" one then :)

PS: Thou now i don't have any "router-integrations" and when i try to ADD above ASUSWRT , type in the credentials, it just "jump" and fails :(

image

And this is what i get now :( ... just out of the blue

image

And this:

image

PS: Sorry, got it up and running after 2nd reboot of the system, testing now

@ollo69
Copy link
Contributor

ollo69 commented May 27, 2022

No, isn't that. Name of integration is ASUSWRT Custom. If you don't see in the list, just refresh browser cache.
During setup choose HTTP or HTTPS as protocol, because I maintained also SSH and Telnet but only for compatibility.

@boheme61
Copy link
Author

boheme61 commented May 27, 2022

No, isn't that. Name of integration is ASUSWRT Custom. If you don't see in the list, just refresh browser cache. During setup choose HTTP or HTTPS as protocol, because I maintained also SSH and Telnet but only for compatibility.

Yes , most likely some probs, with my firefox, lately it has become weird, needs new installation regularly :)

Anyhow, it's up now Asuswrt Custom, over http

Download/Upload(Accumulated) Sensors and Connected_Devices works fine :) 👍

image

@ollo69
Copy link
Contributor

ollo69 commented May 27, 2022

Anyhow, it's up now Asuswrt Custom, over http

So could you better explain your comment on PR? Really do not understand that!

@boheme61
Copy link
Author

Anyhow, it's up now Asuswrt Custom, over http

So could you better explain your comment on PR? Really do not understand that!

Can't really :) , i have an inpatient nature, so after i (for some reason) chose'd to look into your work for ha_asuswrt_custom, and saw your PR, i thought i would get faster response there, but i sincerely admit that everything was caused by me(or in my end) , and i did clear browser and restart etc over and over, until i finally saw the ASUSWRT-Custom ...

Please feel free to add this to your PR, so far everything looks great, and no errors in log, im on core-2022.6.0b1

What still buggin me thou was why i was unable to install core "Asuswrt" again, after i had to uninstall it (Was only disabled) , but i guess that was due to SSH, but still strange it has been working for 6-7 month

@ollo69
Copy link
Contributor

ollo69 commented May 27, 2022

What I really suggest is to come back to PR, remove that comment (I will do the same about the answer) and add a new one just providing feed-back about your test. My only objective it is just to have at the end the native integration working properly for all, for this reason I leave for the moment the support also for the SSH / Telnet library, but not sure that this is the right option, so any comment and suggestion are welcome.

What still buggin me thou was why i was unable to install core "Asuswrt" again, after i had to uninstall it (Was only disabled) , but i guess that was due to SSH, but still strange it has been working for 6-7 month

Just today I see I a similar issue from other user, that was solved just disabling and enabling again SSH on his router. I really don't know the reason, may be is in some way related to 2022.6.0b1.
But generally speaking, I think is not a good idea have multiple version of same integration, they could generate conflict. May be the router itself do not like to have multiple connection coming from same IP

@boheme61
Copy link
Author

May be the router itself do not like to have multiple connection coming from same IP

I don't think that's a problem(ass i've been running with both asuswrt and UPnP/IGD) , but i do understand that asuswrt and asuswrt_custom could implicated some conflicts, as for the SSH, i was checking the Router, but was not thinking about disable/enable again "holes"
But your idea of building and maintaining this integration sounds great 👍 (and core asuswrt is currently "basic"), as Routers now do provide alot useful information/features, that could be used in automations etc. How much one can pull/do without telnet/ssh i don't know, but the "Asus_Router" Custom integration does shows that "Core" needs to follow up( in my slightly humble opinion ) :)

@ollo69
Copy link
Contributor

ollo69 commented May 27, 2022

but the "Asus_Router" Custom integration does shows that "Core" needs to follow up

For sure exist additional sensors and commands (e.g restart button) that can be added, but I will do this with multiple step, because PR should be always as small as possible

@boheme61
Copy link
Author

boheme61 commented May 27, 2022

Yes i understand, but i would say "it's ready :) , i hope it will be "accepted"

I just saw a strange "DiFF" in regards to Download/Upload
image

This is how it looks like in Router ( Seems like "Download" above is Total )

image

In GB
image

PS: I might "correct" my self again (thou can't say for sure, as my previous "Router_Uptime" is gone now, so im not sure for how long it's has been Running this time ) :( , ... but maybe the Sensor shows more "accumulated" than the Router GUI shows ( as it's shows for " Last 30 Days (2022-04-28 ~ 2022-05-27) " ) ... probably my Router has been up close to 40 days

@ollo69
Copy link
Contributor

ollo69 commented May 27, 2022

The Download and Upload in HA should be download and upload from last boot, so could be different, as you said.
But I also know that Asus is converting from Byte to GB considering 1GB = 1.073.741.824 byte = 1024^3 byte = 2^30 byte.
While this is quite common, is wrong, because this is not GB but GiB (gibibyte)
The correct conversion, used in HA, is 1GB = 1.000.000.000 byte = 1000^3 byte = 10^9 byte

You can find detail about this also here

@boheme61
Copy link
Author

boheme61 commented May 27, 2022

You can find detail about this also here

Yeah, that seems to have passed my ears and eyes for more than 20th years :) , or i forgot through the years, or really didn't care :) ... But good to get that "right" if confusions occurs again.
I like this "little" note, in the WIKI

image

Microsoft and the U.S. Congress fighting about the use of, Metric / Decimals definition VS binary definition of GB 👍

PS: I also noticed WD and other manufactures of i.e RAM and Disks for same reasons seems to "report" different, depending of (what they find right) , so apparently "dividing" a sensor with 1024(something), to get a reasonable human reading number, can be very wrong, hmmmm ... so who says that the US Congress is right ? LOL

Well atleast i know/remember now what "base 2" VS "base 10" is now

@github-actions github-actions bot added the stale label Jun 26, 2022
@github-actions github-actions bot closed this as completed Jul 3, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Aug 2, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants