home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
69.76k stars 28.91k forks source link

Different download speed displayed between Fritzbox-tools and Upnp integration #114846

Open christschnman opened 3 months ago

christschnman commented 3 months ago

The problem

As seen below the displayed download speed does not match with upnp integration (Fritzbox 7530). Fritzbox tools: top diagram Upnp Integration: bottom diagram

note the different unit (KiB/KB), but that doesn't explain the large deviation (see scaling!!)

Screenshot 2024-04-04 132331

What version of Home Assistant Core has the issue?

2024.4.0

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Fritzbox Tools, Upnp

Link to integration documentation on our website

https://www.home-assistant.io/integrations/upnp; https://www.home-assistant.io/integrations/fritz

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[bot] commented 3 months ago

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

Code owner commands Code owners of `upnp` 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 upnp` 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)


upnp documentation upnp source (message by IssueLinks)

StevenLooman commented 2 months ago

Thank you for this issue @christschnman. The problem is most likely that the router itself reports different data. The speeds are calculated from the traffic counters. These traffic counters are read regularly (every 30 sec) by Home Assistant and from these (absolute) values the speeds are calculated. I.e., at 12:00:00 the counters reports 3000bytes sent and at 12:00:30 the counters report 6000bytes sent. (6000 - 3000) / 30 --> 3000 / 30 --> 100bytes/sec.

You can check the values the router reports by enabling the (debug) logging for this component. Mind you that it is possible there are other devices on your network using the UPnP (and SSDP) protocol as well, resulting in lots of log entries.

These values is what the integration receives. There isn't much that can be done by this component in case the values reported by the router are off. Note that the fritz-component itself uses different counters than upnp can use.

Fritz! used to have problems like these before, see https://github.com/home-assistant/core/issues/82032 for example.