AlexandrErohin / home-assistant-tplink-router

Home Assistant component for TP-Link router administration with sensors, button reboot, switches and device tracking.
https://community.home-assistant.io/t/custom-component-tp-link-router-integration
MIT License
137 stars 16 forks source link

how to use the device tracking function? #34

Closed swwgames closed 9 months ago

swwgames commented 9 months ago

I am trying to setup the device tracking. right now this is my config:

device_tracker:
  - platform: tplink_router
    new_device_defaults:
      track_new_devices: true

but i get this error:

Logger: homeassistant.setup
Source: setup.py:333
First occurred: 2:17:44 PM (1 occurrences)
Last logged: 2:17:44 PM

Error during setup of component device_tracker
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 333, in _async_setup_component
    result = await task
             ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/device_tracker/__init__.py", line 78, in async_setup
    await async_setup_legacy_integration(hass, config)
  File "/usr/src/homeassistant/homeassistant/components/device_tracker/legacy.py", line 204, in async_setup_integration
    legacy_platforms = await async_extract_config(hass, config)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/device_tracker/legacy.py", line 359, in async_extract_config
    raise ValueError(
ValueError: Unable to determine type for tplink_router: None

What am i doing wrong?

AlexandrErohin commented 9 months ago

The integration configurates only from UI. After you have configured it https://github.com/AlexandrErohin/home-assistant-tplink-router?tab=readme-ov-file#configuration all devices are already tracked. To find them - Go to Developer tools and search for your MAC address - you’ll find sensor device_tracker.YOUR_MAC or device_tracker.YOUR_PHONE_NAME.

swwgames commented 9 months ago

Thank you it works!!!