Device Tracker on TPLink not working

I just set up a new instance of home assistant V49.0 on Hassbian. The device_tracker had been working for me previously on the V43.0 using all-in-one installation.

Here is the log:
017-07-22 14:28:47 INFO (MainThread) [homeassistant.components.device_tracker] Setting up device_tracker.tplink
2017-07-22 14:28:47 INFO (Thread-6) [homeassistant.components.device_tracker.tplink] Loading wireless clients…
2017-07-22 14:28:47 ERROR (MainThread) [homeassistant.components.device_tracker] Error setting up platform tplink
Traceback (most recent call last):
File “/srv/homeassistant/lib/python3.4/site-packages/homeassistant/components/device_tracker/”, line 151, in async_setup_platform
platform.get_scanner, hass, {DOMAIN: p_config})
File “/usr/lib/python3.4/asyncio/”, line 388, in iter
yield self # This tells Task to wait for completion.
File “/usr/lib/python3.4/asyncio/”, line 286, in _wakeup
value = future.result()
File “/usr/lib/python3.4/asyncio/”, line 277, in result
raise self._exception
File “/usr/lib/python3.4/concurrent/futures/”, line 54, in run
result = self.fn(*self.args, **self.kwargs)
File “/srv/homeassistant/lib/python3.4/site-packages/homeassistant/components/device_tracker/”, line 39, in get_scanner
scanner = cls(config[DOMAIN])
File “/srv/homeassistant/lib/python3.4/site-packages/homeassistant/components/device_tracker/”, line 63, in init
self.success_init = self._update_info()
File “/srv/homeassistant/lib/python3.4/site-packages/homeassistant/util/”, line 303, in wrapper
result = method(*args, **kwargs)
File “/srv/homeassistant/lib/python3.4/site-packages/homeassistant/components/device_tracker/”, line 394, in _update_info
password_md5 = hashlib.md5(self.password).hexdigest().upper()
TypeError: Unicode-objects must be encoded before hashing

I had used an encrypted password before with no problem. I also tried using an unencrypted password.



  • platform: tplink
    username: admin
    interval_seconds: 12
    consider_home: 240
    track_new_devices: yes

Any ideas?

I replaced file from V49.0 with the one from V43.0 and it is now working as expected. Perhaps a bug was introduced at some point?

I have the same problem with V50 too.
How to get from V.43.0?

I had issues to get the tplink TL-WR841N up and running with device_tracker tplink.

After a FW update even a custom script wouldn’t work with their way of integration.
I read that tplink seems to have different mechanisms for different models - device_tracker tplink seems broken for a lot of models (just my impression).

Easy way to fix that for me: Flashed openwrt on my TPLink (took 5min via WebIF + reconfig of WIFI) - works like a charm with device_tracker luci.



It is a solution.

The code for using a tplink router as a device tracker has been removed from Home Assistant. However if you are still interested in using that functionality, I have moved the code into a custom component here.