Error in device_tracker and fritzconnection, KeyError: 'NewIPAddress'

My log file is filled with the following error messages:

2019-11-26 12:57:43 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/device_tracker/setup.py", line 164, in async_device_tracker_scan
    found_devices = await scanner.async_scan_devices()
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/fritz/device_tracker.py", line 68, in scan_devices
    self._update_info()
  File "/usr/src/homeassistant/homeassistant/components/fritz/device_tracker.py", line 88, in _update_info
    self.last_results = self.fritz_box.get_hosts_info()
  File "/usr/local/lib/python3.7/site-packages/fritzconnection/fritzhosts.py", line 73, in get_hosts_info
    'ip': host['NewIPAddress'],
KeyError: 'NewIPAddress'

The relevant entries in the configuration.yaml look like this:

sensor:
#Fritzbox Monitoring
  - platform: fritzbox_netmonitor
    name: FritzboxMonitor

device_tracker:
  - platform: fritz
    host: !secret fritz_host
    interval_seconds: 30
    consider_home: 300
    new_device_defaults:
      track_new_devices: false
      hide_if_away: false

I am using a FritzBox 7490 and homeassistant version 0.102.2 using hass.io on HassOS 2.12 on a RaspberryPi 3B+

The Device tracker detects my devices in the network and the Fritzbox monitor shows the status of the Fritzbox.
Did I configure something wrong or what causes the error messages?

A little late… :slight_smile:

I have exactly the same issue from time to time. As it looks by the raised issues on github, we are not alone with this. As far as I can see, there seems to be no solution for this at the moment. You can add your error, preferable with copies of the log or further information, to one of the github issues.

I do get a feeling, that this has something to do with more than one device getting offline at the same time. I need to try to investigate this further. If I find something, I’ll report back at github.

Here are the issues fromHA:


And the issue of the underlying phyton library (fritzconnection), where the issue is given back to HA, as it is not reproducable only in the library: