Errors in updating position from Companion App

Hi there!

This is my first post but I’m with HA since at least 3 years: this time I have a problem that I couldn’t resolve by myself.

Since a few months ago I’m having issues in my mobile_app integrations: seems that HA is failing to interpretate the update coming from the App, reporting this error in log (I’ve changed the lat/long numbers for privacy):

Logger: homeassistant.util.logging
Source: util/ 
First occurred: 10 dicembre 2020, 18:07:33 (138 occurrences) 
Last logged: 12:28:24
* Exception in update_data when dispatching 'mobile_app_location_update_d137d22a114411eb8b5b3b2eb7f5aee0': ({'altitude': 382.64002990722656, 'battery': 28, 'gps': [45.0, 7.0], 'gps_accuracy': 65, 'vertical_accuracy': 20},) Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/mobile_app/", line 148, in update_data self.async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/", line 296, in async_write_ha_state self._async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/", line 320, in _async_write_ha_state sstate = self.state File "/usr/src/homeassistant/homeassistant/components/device_tracker/", line 104, in state zone_state = zone.async_active_zone( File "/usr/src/homeassistant/homeassistant/components/zone/", line 122, in async_active_zone within_zone = zone_dist - radius < zone.attributes[ATTR_RADIUS] TypeError: '<' not supported between instances of 'float' and 'str'

I have already tried to remove the mobile app integration, reinstall iOS app and so on.
This failures causes my device_tracker state (and person state as well) to be always “unknown”, breaking all my location-based automations.

I waited for a couple of update to see if it goes better somehow, but now I’m here with no more ideas.
How can I try to resolve?

Thank You!

The error here is that it can’t compare a float and a string using <. Glancing at the code, the line it’s referring to is the within_zone = zone_dist - radius < zone.attributes[ATTR_RADIUS].

zone_dist, radius and zone.attributes[ATTR_RADIUS] should all be numbers that are coming from the HA side of things, and not the app, so I think the issue is on that side of things.

Can you double check that the radius of the zone is a number and not a string?


They were int (no double or single quotes around them, just the number): to be absolutely sure that was no yaml-related stuff I just abandoned the text file configuration of zones, using the web-interface built-in one.

Nothing changed.

I suspect too that the issue is on the HA side, but I am always skeptical in calling a “bug” something that appear out of the blue and that no-one else is reporting… :pensive:

I report also here, after I closed the issue on GitHub.

I had a corrupted customize.yaml file, witch was overwriting a string into the “radius” attribute of the home zone.