Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zone Component Issues with 0.107.0 #32943

Closed
geekofweek opened this issue Mar 18, 2020 · 28 comments · Fixed by #32963
Closed

Zone Component Issues with 0.107.0 #32943

geekofweek opened this issue Mar 18, 2020 · 28 comments · Fixed by #32963

Comments

@geekofweek
Copy link
Contributor

geekofweek commented Mar 18, 2020

The problem

Location Updates via certain integrations stop working without using default_config: or manually specified zones:

Environment

Problem-relevant configuration.yaml

default_config:
zone:

Traceback/Error logs

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/mobile_app/device_tracker.py", line 151, in update_data
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 297, in async_write_ha_state
    self._async_write_ha_state()  # type: ignore
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 320, in _async_write_ha_state
    state = self.state
  File "/usr/src/homeassistant/homeassistant/components/device_tracker/config_entry.py", line 105, in state
    self.hass, self.latitude, self.longitude, self.location_accuracy
  File "/usr/src/homeassistant/homeassistant/components/zone/__init__.py", line 102, in async_active_zone
    zone.attributes[ATTR_LATITUDE],
KeyError: 'latitude'

Additional information

@probot-home-assistant
Copy link

Hey there @robbiet480, mind taking a look at this issue as its been labeled with a integration (mobile_app) you are listed as a codeowner for? Thanks!

@TomBrien
Copy link
Member

TomBrien commented Mar 18, 2020

So far it seems to be working for me on 0.107.0. At least if I pull down to refresh it seems to update ok.

I should mention this while staying at home I haven’t tried moving.

@geekofweek
Copy link
Contributor Author

You should see the above error in the logs when refreshing. Although mine also forgets state on restart so all devices were marked as away and would never update again.

@TomBrien
Copy link
Member

Yep I don’t see any logs and it seems to be updating. Only errors I see are those related to home-assistant-ios#547. Which version of iOS are you running?

@TheRedBull205
Copy link

TheRedBull205 commented Mar 18, 2020

Same error for the Android companion app.

Android version: 10
Android companion app: 1.8.0-155

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/device_tracker/legacy.py", line 175, in async_see consider_home, File "/usr/src/homeassistant/homeassistant/components/device_tracker/legacy.py", line 403, in async_seen await self.async_update() File "/usr/src/homeassistant/homeassistant/components/device_tracker/legacy.py", line 432, in async_update self.hass, self.gps[0], self.gps[1], self.gps_accuracy File "/usr/src/homeassistant/homeassistant/components/zone/__init__.py", line 102, in async_active_zone zone.attributes[ATTR_LATITUDE], KeyError: 'latitude'

@geekofweek
Copy link
Contributor Author

@TomBrien iOS 13.3.1, latest

@bieniu
Copy link
Member

bieniu commented Mar 18, 2020

I have the same errors for iOS and Android apps. But I think those errors are related with zone component. I don't know why but I don't have zones editor in HA configuration and there is no information about zone component on Developpers tools -> information page.

@geekofweek
Copy link
Contributor Author

@bieniu I agree, I think it is zone related and not the actual Mobile App

@TomBrien
Copy link
Member

TomBrien commented Mar 18, 2020

Makes sense. The zone component is listed on the info page of dev tool for me. So that might be it. I am running iOS 13.4b4 but as others have pointed out it doesn’t seem to be that (just checked a 13.3.1 device and it seems fine to).

I have my zones specified manually in configuration.yaml

@geekofweek
Copy link
Contributor Author

My Home zone is manually configured in configuration.yaml but the rest of the zones I migrated to the Lovelace UI

@bieniu
Copy link
Member

bieniu commented Mar 18, 2020

All my zones have been configured via UI.

@TomBrien
Copy link
Member

TomBrien commented Mar 18, 2020

Home zone is configured under homeassistant: so I guess neither of you have a zone: section in configuration.yaml?

@geekofweek
Copy link
Contributor Author

@TomBrien correct, I used to but don't anymore

@dshokouhi
Copy link
Member

Do you guys have default_config ? Seeing something similar in the forums: https://community.home-assistant.io/t/0-107-multiple-lovelace-dashboards-adds-helpers-new-media-player-card/179393/83?u=dshokouhi

@geekofweek
Copy link
Contributor Author

@dshokouhi I do not, might try that.

@bieniu
Copy link
Member

bieniu commented Mar 18, 2020

I don't have zone nor default_config in configuration.yaml file. I don't want to use default_config because of issue with stream component.

@TomBrien
Copy link
Member

default_config: calls zone: so that would be another sign that that is the issue

@dshokouhi
Copy link
Member

I am guessing this is a consequence of #32880 ?

@TomBrien
Copy link
Member

@dshokouhi yep I’d agree with that.

@geekofweek
Copy link
Contributor Author

geekofweek commented Mar 18, 2020

so changing to default_config: fixed it, also would explain @TomBrien working with manually configured zones. it needs zone: in the config

@bieniu
Copy link
Member

bieniu commented Mar 18, 2020

With default_config in configuration.yaml there is zones editor in configuration and zone component is listed on information page. Definitely issue is related with zone component.
@geekofweek Could you change title of this issue?

@probot-home-assistant
Copy link

Hey there @home-assistant/core, mind taking a look at this issue as its been labeled with a integration (zone) you are listed as a codeowner for? Thanks!

@geekofweek geekofweek changed the title Mobile App (iOS) Location Updates Broke Zone Component Issues with 0.107.0 Mar 18, 2020
@geekofweek
Copy link
Contributor Author

@bieniu done

@balloob
Copy link
Member

balloob commented Mar 19, 2020

Can someone please look at their states dev tool and give me a list of which zones are there? Looks like a zone got created without latitude/longitude? 🤔

@eekdood
Copy link

eekdood commented Mar 19, 2020

All of my zones previously created with the UI are still listed and listed as "restored"

zone.school | unavailable | restored: true supported_features: 0 friendly_name: School icon: mdi:school

I do not have zone: or default_config: in my configuration.yaml. I've never used default_config: and migrated all of my zone: to the UI a few versions ago.

@balloob
Copy link
Member

balloob commented Mar 19, 2020

Ooooh I see what is happening !

Zone integration is not being loaded because it's no longer a dependency of device_tracker. But the restored zones are set as unavailable and have no latitude/longitude.

And you can't set up zone right now with just an empty config because of a bad config validation.

@balloob
Copy link
Member

balloob commented Mar 19, 2020

Fix incoming.

@balloob balloob mentioned this issue Mar 19, 2020
20 tasks
@balloob
Copy link
Member

balloob commented Mar 19, 2020

btw, if you have removed default_config, you will need to add zone: to your configuration. This will be possible with 107.1. Restoring old behavior for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants