Zones that are not circles

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

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.

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

I’d like this too, found this simple python code that works a treat. I have no idea how to make this a custom component or appdaemon app though

It may not serve everyone’s purpose but I created several overlapping zones with the same name for an area we visit from time to time, works well. Reports people as being in ‘The Woods’ regardless of which actual zone they’re in. You can make all sorts of shapes then.

Didn’t realise you could do that, I have just used your idea, thanks.

I tried creating a group with them in but it doesn’t seem to work

I’ve never tried creating a group - what additional functionality does that give you?

Was going to use it in automations but didn’t work. I can just list all the zones in the triggers I think

ah, OK. I don’t have any automations based on zones outside the house. I just use it to ‘spy’ on my son :slight_smile: and make sure he’s mostly, roughly where he’s supposed to be.

He is, of course, fully aware of that.

1 Like

As you can get lat and long coridinates from a device tracker you can write a sensor that detects if a device is between two lats and two longs and use that.
This is an area that is parallel to the equator though so not perfect but probably just a bit easier than multiple overlapping circles - But that is a neat idea @eggman I suppose they all add to the tools in our toolbox


Am I the only one who finds this a bit creepy?


Problem with a solution like that is not ‘inside/outside’, it’s the drawing on a map. Pretty sure that’s why a custom component doesn’t exist. Basically need a lot of backend and fronend work to support the shape visually before you can even get the ‘inside/outside’ working.

lol - he works with a volunteer group that manage local woodland, which the council would otherwise let go to rot. Some lovely paths, wildlife areas, gardens, streams kept clear of silt etc.

1 Like

Creepy ?

Depends if he is also tracking device_tracker_vampire
who is also in the ‘woods’ and sun.sun is below_hozizon


I might struggle

this works well for my needs

1 Like