-
Notifications
You must be signed in to change notification settings - Fork 24
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
Use /tmp/clientlist.json in async_get_connected_devices #36
Comments
Looks like a very interesting thing to explore! I'll setup some experimental tests |
I actually have it already running at home and it seems to work much faster, at least to identify devices that left. You can test if it works for you from my branches here Using Native Python JSON (Preferred by me): Or using ORJSON (Requires ORJSON dependency installed, is slightly faster than the native version): I can open a PR if you want, or just take what you need from the changes. |
Yes, I think it should be added as an alternative though, there are like 1mil different versions of asuswrt and I'm not 100 that the file exists in all of these systems ;) |
Hi, |
I' working on this, will probably be added in next version |
I’m having the same issue, RT-AC86U, current firmware 3.0.0.4.386_40451. Turning off wireless on iPhone that has a manual DHCP IP assigned, causes the device to continue to be reported back active for >12 hours (I didn’t wait longer so I do not know if it is ever removed) However the /tmp/clients.json does get updated within a few seconds on disconnect and almost immediately on connect. For my router this looks like a better solution. It’d be good to get this library updated, so that it can get pulled into Home Assistant, and all those users get the benefit of this working better. |
Hi, |
I've been using the clientlistjson/json branch from @rkkoszewski for over a month now through Home Assistant and it has been completely stable, runs faster, and picks up devices on my AiMesh extender by default. It certainly seems that this solution holds some nice benefits for many users, even if it isn't set as the default device polling method. |
I have tested it to and it is as you say more stable and faster. I'd be open to a PR if anyone have the time to put in some effort? I have to much daytime work and no time to play :( |
I could give it a shot. I might have some spare time today after work and could create the PR. |
@imdunne8 how did you manage to use that branch with the Home Assistant integration? I'm having some problems where none of my wireless devices get reported, only wired ones, probably because my RT-AC68U is running in AP mode, so the |
@fcastilloec The easy way to test it (which will likely have to be done again if you update HA) is to:
If you run HA through Docker you will have to run these commands from inside the container. |
thanks @imdunne8 ! |
@niklerus That's just the git commit ID for the latest commit on that branch. Doing a pip install pointing at a github repository with the ID will mean it will always install that particular commit. You can find the ID if you look at the git history. |
Just to say thanks to all involved! This has solved my issues also. __ |
Hi, I´m newbie, so sorry for my questions, but could someone help me with step by step how to install this to home assistant? I´m using native integration asuswrt in HA, but in Aimesh is not working correctly (devices stays still "home"). Thank you. |
Is this file new? I don't seem to have it in MerlinWRT 384.13_2 on my RT-AC87U. |
I see the clientlist.json fork/feature branch is quite old. Will this ever get incorporated into this repository? |
Hi,
I just noticed that the function async_get_connected_devices shows disconnected devices as present, even if they're not. This is probably due to using the dnsmasq.leases file, which keeps the device record till the dns lease is expired.
I noticed there is a file /tmp/clientlist.json that basically shows the same information, but shows disconnected devices much quicker. In that file it also shows the clients separated by wifi "2G", "5G" and "wired_mac", which could also be used in async_get_wl to avoid the loops and multiple calls.
Is there any reason why that file has not been used for this cases?
From my tests, that file was kept updated even when no client was connected to the web admin of the router (Unless I missed out something).
The text was updated successfully, but these errors were encountered: