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
71.35k stars 29.89k forks source link

tplink.py device tracker not retrieving all wifi clients #10575

Closed egorian closed 6 years ago

egorian commented 6 years ago

Home Assistant release: 0.57.2

Python release: Python 3.6.1

Component/platform: Device Tracker / tplink (tplink.py)

Description of problem: When having a lot of wifi clients the component only retrieves the first 8 clients, this is because the access point webpage paginate the information and the component only retrieve the first page and completely ignores the next pages. Applies to: Archer C7 firmware 150427 but potentially affects many others tplinks access points. Expected: Retrieve all wifi associated clients, traversing the pagination.

Problem-relevant configuration.yaml entries and steps to reproduce:

device_tracker:
  - platform: tplink
    host: 192.168.1.254  #access point IP
    username: useradmin
    password: abcdefghij
  1. Configure device_tracker/tplink component.
  2. Have more than 8 clients (in my case more than 20) connect to the wifi router.
  3. HomeAssistant only shows the first ones as known devices.

Additional info: I managed to implement a workaround (but there is probably a better/elegant way to code it). I modified the tplink.py line:

      # Check both the 2.4GHz and 5GHz client list URLs
        for clients_url in ('WlanStationRpm.htm', 'WlanStationRpm_5g.htm'):

Changed to:

        # Check both the 2.4GHz and 5GHz client list URLs
        for clients_url in ('WlanStationRpm.htm', 'WlanStationRpm_5g.htm', 'WlanStationRpm.htm?page=2', 'WlanStationRpm.htm?page=3', 'WlanStationRpm_5g.htm?page=2', 'WlanStationRpm_5g.htm?page=3'):
balloobbot commented 6 years ago

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 :+1:

balloobbot commented 6 years ago

This issue will be auto-closed because there hasn't been any activity for a few months. Feel free to open a new one if you still experience this problem 👍