My FR was closed without referal to this(?) thread.
Anyhow, yes, indeed!
It would be fantastic if we could have the option to create polygon based zones instead of just circular ones.
Node-Red´s “geofencing” is one great example where this can be achieved.
Why one would say?
IoT is growing, myself I have just installed an GPS into my robotic lawn mower (ESP8266+GPS module, running Tasmota). It connects over WIFI and sends lat/lon via MQTT to HA.
I need to know it the robot is on the back yard, front yard or side yard of the house.
Zones in HA are not constructed to be that granular (catering for small yards/zones).
Currently I am using Node-Red and the geofence palette to accomplish polygon based zones and then send the results via MQTT for HA to pick up.
What I’d really like to see would be a map displayed with grid lines, so everything is in a square zone. Remember those old Rand McNally maps with letters on the top and numbers on the side? You would look up the street you were looking for in the index, find the page and “square” and eyeball it to find your destination. I’d love to have automatic zones to see objects move from square to square.
I haven’t poked through the code, but I’d imagine you could change the current circular Zone to extend an interface (IZone) and then have all functions that accept Zone accept the interface instead. Then you could create new classes of IZone, such as Square, Poly, etc.
IZone classes would have to implement a function called InZone(long,lat), amongst others.
What node red flow did you use to get this to follow mobiles in home assistant ?
I use the Flight24 version of this but it has planes baked into it. How do we get mobiles or companion app involved to monitor if they are in the area or leaving it ?
I’d like to see this also, currently doing it through an integration, but this should be a part of Home Assistant core. My use case is tracking which yard the automower is in and the amount of time it spends in each zone.
Right now I’m defining a lot of zones that are very close together, and the solution of using several similarly named circles is fine, but also laborious.
Being able to define zones as a polygon would be a huge upgrade of HA!
Lucky I searched. I was going to introduce this as a feature request. I have a zone I use to tell me when my wife is at a certain point on her way home from work. The circle covers too much area when I really just need a zone that covers the freeway she’s on in a rectangular shape.
I also think this would be very useful. because of the circular zone shapes, sometimes I’m forced to include part of the road and it causes false positives for my automations everytime someone drives on that road or is near the edge of the location (buildings and parking lots usually aren’t circles)
A far from perfect but working temporary solution I have found for now if the circle covers too much area is to just create a bunch of small zones with the same name.
I suppose that this would be more like “the devs don’t think it’s important enought to do it right now but if you are able to do it or willing to pay someone to do it you feel free to have the devs receive a PR to implement the feature”.
We really need this!
It needs to be part of “native” HA - with “year of the voice” combined with the weeks of AI I also think that it would be immensely powerful for HA to know more about things location.
What if there was a way to vote with money or tokens on what should be developed - that would be nice
In my case, I’m in a rural town. Some areas I’d like to define are farms, which are obviously quite large and mostly not circular. One of them is squarish and far enough out of town that it wouldn’t likely cause issues to just make a circle…
But another is more rectangular and roughly 3 times in length as it is wide. If I create a single circle over that, the error rate would be huge, with either a large part of the ends of the property not within the circle if I go smaller, or a vast area of the zone circle being outside the property if I cover the corners. I could alternatively create 3 circles to get better accuracy, but that makes things more complicated for making use of those zones.