Error setting up device tracker

Hi

I am trying to setup my device tracker to access my router, but I keep getting the following in the log file:

2018-02-10 21:54:40 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File “/usr/lib/python3.6/asyncio/tasks.py”, line 182, in _step
result = coro.throw(exc)
File “/usr/lib/python3.6/site-packages/homeassistant/components/device_tracker/init.py”, line 711, in async_device_tracker_scan
found_devices = yield from scanner.async_scan_devices()
File “/usr/lib/python3.6/asyncio/futures.py”, line 332, in iter
yield self # This tells Task to wait for completion.
File “/usr/lib/python3.6/asyncio/tasks.py”, line 250, in _wakeup
future.result()
File “/usr/lib/python3.6/asyncio/futures.py”, line 245, in result
raise self._exception
File “/usr/lib/python3.6/concurrent/futures/thread.py”, line 56, in run
result = self.fn(*self.args, **self.kwargs)
File “/usr/lib/python3.6/site-packages/homeassistant/components/device_tracker/huawei_router.py”, line 65, in scan_devices
self._update_info()
File “/usr/lib/python3.6/site-packages/homeassistant/components/device_tracker/huawei_router.py”, line 82, in _update_info
data = self._get_data()
File “/usr/lib/python3.6/site-packages/homeassistant/components/device_tracker/huawei_router.py”, line 99, in _get_data
array_regex_res = self.ARRAY_REGEX.search(self._get_devices_response())
File “/usr/lib/python3.6/site-packages/homeassistant/components/device_tracker/huawei_router.py”, line 120, in _get_devices_response
cnt_str = str(cnt.content, cnt.apparent_encoding, errors=‘replace’)
TypeError: str() argument 2 must be str, not None

My configuration for this is as follows:

device_tracker:

  • platform: gpslogger
    name: GPS
  • platform: huawei_router
    name: Wifi
    host: 192.168.0.1
    interval_seconds: 10
    consider_home: 180
    username: admin
    password: password
    new_device_defaults:
    track_new_devices: True
    hide_if_away: False

Any advice would be helpful. I have spent a lot of time searching the forums and have not found an answer so far.

Thanks

Tim

I would try taking it back to basics … and see if it changes anything then add one line at a time till you find the error line…

  - platform: huawei_router
    host: 192.168.0.1
    username: admin
    password: password

Thanks for the response Keith.

I have done as you said and stripped it right back. but I am still getting the same error:

2018-02-11 20:45:13 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File “/usr/lib/python3.6/asyncio/tasks.py”, line 182, in _step
result = coro.throw(exc)
File “/usr/lib/python3.6/site-packages/homeassistant/components/device_tracker/init.py”, line 711, in async_device_tracker_scan
found_devices = yield from scanner.async_scan_devices()
File “/usr/lib/python3.6/asyncio/futures.py”, line 332, in iter
yield self # This tells Task to wait for completion.
File “/usr/lib/python3.6/asyncio/tasks.py”, line 250, in _wakeup
future.result()
File “/usr/lib/python3.6/asyncio/futures.py”, line 245, in result
raise self._exception
File “/usr/lib/python3.6/concurrent/futures/thread.py”, line 56, in run
result = self.fn(*self.args, **self.kwargs)
File “/usr/lib/python3.6/site-packages/homeassistant/components/device_tracker/huawei_router.py”, line 65, in scan_devices
self._update_info()
File “/usr/lib/python3.6/site-packages/homeassistant/components/device_tracker/huawei_router.py”, line 82, in _update_info
data = self._get_data()
File “/usr/lib/python3.6/site-packages/homeassistant/components/device_tracker/huawei_router.py”, line 99, in _get_data
array_regex_res = self.ARRAY_REGEX.search(self._get_devices_response())
File “/usr/lib/python3.6/site-packages/homeassistant/components/device_tracker/huawei_router.py”, line 120, in _get_devices_response
cnt_str = str(cnt.content, cnt.apparent_encoding, errors=‘replace’)
TypeError: str() argument 2 must be str, not None

I’m not sure if it is just that my router is not compatible.

This is my config now:

device_tracker:
#- platform: gpslogger
#name: GPS
#password: !secret

  • platform: huawei_router
    #name: Wifi
    host: 192.168.0.1
    #interval_seconds: 10
    #consider_home: 180
    username: admin
    password: password
    #new_device_defaults:
    #track_new_devices: True
    #hide_if_away: False

I haven’t got one but the only other thing that might help is putting the host: ip_addr in either single quotes or double quotes since it seems to be complaining about a string. Other than that I’m out of ideas :frowning: , maybe someone that has the router will chime in :slight_smile: