core: 0.110.1: Owntracks throws an error during init

The problem

Owntracks throws an error during init.

Environment

arch x86_64
dev false
docker false
hassio false
installation_type Gentoo Linux
os_name Linux
os_version 4.19.113-kernel-x86_64
python_version 3.7.7
timezone Europe/Berlin
version 0.110.1
virtualenv false
  • Home Assistant Core release with the issue: 0.110.1
  • Last working Home Assistant Core release (if known): 0.109.6
  • Operating environment (Home Assistant/Supervised/Docker/venv): native Install on Gentoo Linux
  • Integration causing this issue: owntracks
  • Link to integration documentation on our website: https://www.home-assistant.io/integrations/owntracks/

Problem-relevant configuration.yaml


Traceback/Error logs

2020-05-23 20:47:46 ERROR (MainThread) [homeassistant.util.logging] Exception in async_handle_message when dispatching 'owntracks': (<homeassistant.core.HomeAssistant object at 0x7f5767b99a50>, <homeassistant.components.owntracks.OwnTracksContext object at 0x7f56f05df550>, {'batt': 56, 'lon': xx.xxxxx9478260998, 'acc': 65, 'bs': 1, 'p': xx.xxxxxx68115234, 'vac': 10, 'lat': xx.xxxxxxxxx9960733, 'inregions': ['Home'], 'conn': 'w', 'tst': 1589817963, 'alt': 319, '_type': 'location', 'tid': 'B9', 'topic': 'owntracks/behsiphone/CCxxxxxxxF-6816-4BDB-8D15-485xxxxxxx0B9'})
Traceback (most recent call last):
  File "/usr/lib/python3.7/site-packages/homeassistant/components/owntracks/messages.py", line 391, in async_handle_message
    await handler(hass, context, message)
  File "/usr/lib/python3.7/site-packages/homeassistant/components/owntracks/messages.py", line 196, in async_handle_location_message
    context.async_see(**kwargs)
  File "/usr/lib/python3.7/site-packages/homeassistant/components/owntracks/device_tracker.py", line 34, in _receive_data
    entity.update_data(data)
  File "/usr/lib/python3.7/site-packages/homeassistant/components/owntracks/device_tracker.py", line 157, in update_data
    self.async_write_ha_state()
  File "/usr/lib/python3.7/site-packages/homeassistant/helpers/entity.py", line 290, in async_write_ha_state
    raise RuntimeError(f"Attribute hass is None for {self}")
  File "/usr/lib/python3.7/site-packages/homeassistant/helpers/entity.py", line 588, in __repr__
    return f"<Entity {self.name}: {self.state}>"
  File "/usr/lib/python3.7/site-packages/homeassistant/components/device_tracker/config_entry.py", line 105, in state
    self.hass, self.latitude, self.longitude, self.location_accuracy
  File "/usr/lib/python3.7/site-packages/homeassistant/components/zone/__init__.py", line 102, in async_active_zone
    for entity_id in sorted(hass.states.async_entity_ids(DOMAIN))
AttributeError: 'NoneType' object has no attribute 'states'

2020-05-23 20:47:46 ERROR (MainThread) [homeassistant.util.logging] Exception in async_handle_message when dispatching 'owntracks': (<homeassistant.core.HomeAssistant object at 0x7f5767b99a50>, <homeassistant.components.owntracks.OwnTracksContext object at 0x7f56f05df550>, {'batt': 77, 'lon': 1x.xxxxxx85130505257, 'acc': 65, 'bs': 1, 'vac': 10, 'lat': 4x.xxxxxxx09163031, 'inregions': ['Home'], 't': 'u', 'conn': 'w', 'tst': 157xxx3045, 'alt': 318, '_type': 'location', 'tid': 'F2', 'topic': 'owntracks/michaelasiphone/F61xxxxxxxxxxD-8CE5-E6xxxxxF38F2'})
Traceback (most recent call last):
  File "/usr/lib/python3.7/site-packages/homeassistant/components/owntracks/messages.py", line 391, in async_handle_message
    await handler(hass, context, message)
  File "/usr/lib/python3.7/site-packages/homeassistant/components/owntracks/messages.py", line 196, in async_handle_location_message
    context.async_see(**kwargs)
  File "/usr/lib/python3.7/site-packages/homeassistant/components/owntracks/device_tracker.py", line 34, in _receive_data
    entity.update_data(data)
  File "/usr/lib/python3.7/site-packages/homeassistant/components/owntracks/device_tracker.py", line 157, in update_data
    self.async_write_ha_state()
  File "/usr/lib/python3.7/site-packages/homeassistant/helpers/entity.py", line 290, in async_write_ha_state
    raise RuntimeError(f"Attribute hass is None for {self}")
  File "/usr/lib/python3.7/site-packages/homeassistant/helpers/entity.py", line 588, in __repr__
    return f"<Entity {self.name}: {self.state}>"
  File "/usr/lib/python3.7/site-packages/homeassistant/components/device_tracker/config_entry.py", line 105, in state
    self.hass, self.latitude, self.longitude, self.location_accuracy
  File "/usr/lib/python3.7/site-packages/homeassistant/components/zone/__init__.py", line 102, in async_active_zone
    for entity_id in sorted(hass.states.async_entity_ids(DOMAIN))
AttributeError: 'NoneType' object has no attribute 'states'

Additional information

The sensor seems to run.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 16 (8 by maintainers)

Most upvoted comments

Not advocating moving, if MQTT is working for you keep with it. Sorry if it seemed that was my intent, also sorry for injecting that commentary. I ran into challenges I believe related to my split DNS and iPhone (detail not important), but that was may nights ago.

I have been using Owntracks as one of the combined methods to determine if the Front door should be unlocked for me for over a year now.