home-assistant / iOS

:iphone: Home Assistant for Apple platforms
https://companion.home-assistant.io
Other
1.57k stars 304 forks source link

Geocoded location option to show zone (if inside) #347

Closed Swiftnesses closed 4 years ago

Swiftnesses commented 5 years ago

I previously used the geocode component (https://github.com/michaelmcarthur/GoogleGeocode-HASS) which has an option to replace / insert the geocoded location with the zone name, could this be added?

SeanPM5 commented 5 years ago

I think this is a great suggestion.

Since the whole point of geocoded sensor is to display coordinates in a more friendly way, it would make sense to simply display the zone name (if inside one) rather than "1234 Main Street, NY."

Might be useful to expose the current zone as an attribute of the geocoded location sensor too if possible.

TomBrien commented 5 years ago

I know in the code there is a comment about using the native MapKit Placemark (and then the code uses CLPlacemark to do the reverse geocode) so this may require something of a change of methodology.

https://github.com/home-assistant/home-assistant-iOS/blob/master/Intents/SendLocation.swift#L104

robbiet480 commented 5 years ago

While possible, this will take quite a bit of rework as the geocode sensor we have right now doesn't have a way to get the zone that we are currently in. Expect this later in 2.0, if not 2.0.X build after release.