Polygon tracker Zones

Summery: Allow Users define polygon zones for large areas that are in close proximity to other zones. Examples of theses types of places could be University and company campuses or business parks.

Some Ideas on how to do it: I have thought of one way of doing it and that is to have a tool on the home-assistant site that will mainly do the work client side that will allow the user to select a way from Open Street Map to be a polygon, this will the fetch the Info from OSM and encode it in a way home assistant can understand, this could be a YAML Dictionary or JSON. this would the be used along side the existing zone lat long and radius making them optional or ignored if using polygons.

The reason for having a tool on the site would be to reduce the load on OSM’s servers as people will only get the data once instead of on every reboot, it is also easier to select it from a map than to use the Map data layer on openstreetmap.com to get the way number

Just did a tad more research, we could allow geojson for zones as there seems to be tools that exist to make osm data in to geojson data

1 Like

Hey, do you know if there’s something new on it?

That’s can be interesting…

i am also very interested in more flexible zones

Would be perfect,you can use tools like http://geojson.io/ to generate a geoJSON file of polygon zones, which we could then use with HA

I know it’s old, but I really want this feature too.

Please implement this. I would like to set a zone around our high school but doing it with radius is going to mess up other tracking.

1 Like

https://community.home-assistant.io/t/zones-that-are-not-circles/175914/25

Bumping this request, it’s a GREAT idea.

4 Likes

I would love this, there’s a great need for it, since mos building have polygon shapes, and trying to create a zone in a rectangular building ends up creating a massive circle with tons of incorrect parts.

This would make me drop Google share location between my wife and I, would be nice If we used HA for that.

Still looking for something that can do this…if this was supported I wouldn’t need to mess around with Life 360 / Owntracks / Google Maps… Interestingly I was looking at how to do this…it just didn’t seem like something that wouldn’t work out of the box…

Is there any chance that zones will get other shapes? It would be nice to be able to pack zones in an area and not have some of the oddities of overlapping zones.

Squares and rectangles come to mind.

Thanks Matt

1 Like

First, you can upvote your own feature request :wink:
Second, nice idea, but personally I don’t think GPS location is precise enough that you would have any benefits from this.

I did not think it would be accurate enough either, but having multiple zones right on top of each others edges seems to work very well.

I get updates often enough to catch phones in the areas between zones on this map.

I just saw that there’s already feature request for this here. But I can somehow imagine that it gets difficult to implement this programatically.

1 Like

Detecting if a device is in a circular zone is easy (is the device distance from the zone centre less than the zone radius?).

In a square?

Not so easy.

Apparently node red can do it.

I’ve recently implemented this for geolocation integrations - if you think of a square/rectangle as a polygon with four vertices and right angles. Also supports bounding boxes where you define bottom left and top right corner of a rectangle.
Python code is here:

1 Like

python can get it, too.
https://automating-gis-processes.github.io/2017/lessons/L3/point-in-polygon.html

1 Like

Not sure I am good enough to make custom python stuff work. I hope the devs will give this some thought.