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

Why lqi value in device info is different from it in topology? #2606

Closed
strawberryhcy opened this issue Sep 25, 2023 · 12 comments
Closed

Why lqi value in device info is different from it in topology? #2606

strawberryhcy opened this issue Sep 25, 2023 · 12 comments
Labels
stale Issue is inactivate and might get closed soon support This request is likely unrelated to quirks and more of a support ticket (e.g. network issues)

Comments

@strawberryhcy
Copy link

1c37bcac78ade5cc8aca227f109b0fcf
aecce818e0e0a4450a16bb6c3d63f9ff

I know what these two lqi values represent in the topology.But i want to know it in the device info.Why two device (coordinater and router)have 3 lqi value?

@MattWestb
Copy link
Contributor

The topology is done with requesting all routers neighbors and the links to them.
The device cars is made from the LQI that the coordinator is getting with the package revived from the network and its depends of the rout its taken and if end devices is direct connected to the coordinator with EZSP you is very likely getting 255 in most firmware versions (best is blocking the coordinator having direct children for getting more stable network).

@strawberryhcy
Copy link
Author

The topology is done with requesting all routers neighbors and the links to them. The device cars is made from the LQI that the coordinator is getting with the package revived from the network and its depends of the rout its taken and if end devices is direct connected to the coordinator with EZSP you is very likely getting 255 in most firmware versions (best is blocking the coordinator having direct children for getting more stable network).
I want to know why the values on the page are different from those in the topology diagram. As far as I know, the value of lqi comes from two places, but it has three values that are different from each other.

@strawberryhcy
Copy link
Author

I want to know why the values on the page are different from those in the topology diagram. As far as I know, the value of lqi comes from two places, but it has three values that are different from each other.

@TheJulianJES TheJulianJES added the support This request is likely unrelated to quirks and more of a support ticket (e.g. network issues) label Sep 29, 2023
@Shulyaka
Copy link
Contributor

Shulyaka commented Oct 5, 2023

As @MattWestb already described, they come from 3 different sources. For the topology, the two LQI between the routers are requested from those routers. For the device info, the LQI is provided by the coordinator firmware and, depending on the firmware, could actually be the LQI of the last hop (i.e. between the coordinator and the nearest router)

@strawberryhcy
Copy link
Author

As @MattWestb already described, they come from 3 different sources. For the topology, the two LQI between the routers are requested from those routers. For the device info, the LQI is provided by the coordinator firmware and, depending on the firmware, could actually be the LQI of the last hop (i.e. between the coordinator and the nearest router)

Thank you for your answer. But in the connection between the router and coordinator, the neighbor table only has one value, and to my knowledge, the other value is the connection quality of the last message determined by the coordinator firmware
dmulcahey/zha-network-visualization-card#46 So, I still feel puzzled about this.

@Shulyaka
Copy link
Contributor

Shulyaka commented Oct 5, 2023

Every value in the topology graph comes from the neighbor tables. It could be the neighbor table of the coordinator itself if the coordinator supports loopback ZDO frames. Two devices would give two values for the link between them. See https://github.com/zigpy/zigpy/blob/50bb2171341bd44239898cfd3dd77b22ac49a03e/zigpy/appdb.py#L332

And the device info (and the zha network card) comes from the coordinator firmware with the last received packet, see
https://github.com/zigpy/zigpy/blob/50bb2171341bd44239898cfd3dd77b22ac49a03e/zigpy/application.py#L1008

I would not rely on the value in the device info because it is only for the last hop (and you would probably be more interested in the first hop).

@MattWestb
Copy link
Contributor

@Shulyaka What is the LQI / RSSI coming for the https://github.com/dmulcahey/zha-network-card ?
I think its its from the nigbur scan from all routers in the network then i have seen it being updated then clicking update and sniffing the network.

@Shulyaka
Copy link
Contributor

Shulyaka commented Oct 5, 2023

It comes from the device attributes (i.e. from the coordinator firmware), not the neighbor scan.

@dmulcahey
Copy link
Collaborator

https://github.com/home-assistant/frontend/blob/f43171f91c51a354fb0d7f8d7f152ab95e8fc16a/src/panels/config/integrations/integration-panels/zha/zha-network-visualization-page.ts#L248

The topology in HA uses the neighbor tables.

@MattWestb
Copy link
Contributor

@dmulcahey is your https://github.com/dmulcahey/zha-network-card#zha-network-card using neighbor scans or the last hope to the coordinator ?

@dmulcahey
Copy link
Collaborator

The table is last hop set by zigpy on a per message basis. Neighbors are not used to build the table.

Copy link

github-actions bot commented Apr 2, 2024

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 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 Issue is inactivate and might get closed soon label Apr 2, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Issue is inactivate and might get closed soon support This request is likely unrelated to quirks and more of a support ticket (e.g. network issues)
Projects
None yet
Development

No branches or pull requests

5 participants