Can't detect Huawei HG659 Router

Hi,
Been trying to set up device_tracker with the following code but unfortunately doesn’t work.

    # Example configuration.yaml entry
    device_tracker:
      - platform: huawei_router
        host: 192.168.1.1
        username: admin
        password: password
        consider_home: 180
        track_new_devices: yes

The error shows:

`Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/homeassistant/components/device_tracker/__init__.py", line 695, in async_device_tracker_scan
found_devices = yield from scanner.async_scan_devices()
  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 100, 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 121, in _get_devices_response
cnt_str = str(cnt.content, cnt.apparent_encoding, errors='replace')
TypeError: str() argument 2 must be str, not None`

Any help would be appreciated, thanks.

1 Like

Hi Emnaudin, did you get the solution?
I got the same problem as yours.