Zone hysteresis/schmitt trigger

A zone is now defined by its latitude, longitude and radius.
I would like to have an additional hysteresis to the radius as an option.

For instance radius=500 m and hysteresis=100 m:
If you enter the zone the state changes to ‘home’ when you are 400 m away from the center. If you then leave the zone the state only changes to ‘not_home’ after you are 600 m away from the center.

This can be useful to prevent the state changing back and forth between ‘home’ and ‘not_home’ when a person is standing at the edge of a zone. In my case if I was shopping in a supermarket that was close to the edge of my zone or when I was driving home and the road takes me briefly inside my zone then turns to go outside and then goes back inside my zone. This triggered some unwanted behaviour of my automations that only expect me to come home (state change from ‘not_home’ to ‘home’ instead of ‘not_home’, ‘home’ 1 min later ‘not_home’ another min later ‘home’).

Maybe to realise this it is possible to make 2 zones under the hood of HomeAssistant with same center and radius of 400 and 600 m (in case of the example) and then combine the tracking data of those two zones?

The request is a good idea but to fix your issue with the automations that you currently have you can use the “for:” option in the trigger to say “if i’m home for x minutes then trigger”. Then if you enter and leave the zone for less than x minutes the automation won’t trigger.

It’s not fool proof but it might help in the interim.

Thanks for your sugestion @finity, I indeed also thought of the option to use “for x minutes”.
However my Home is quite close to my work where I defined another zone.

Therefore if I leave home to go to work, the device tracker may jump straight from ‘home’ to ‘work’ or go from ‘home’ to ‘not_home’ to ‘work’.
If I define the folowing trigger:

   - platform: state
     entity_id: person.test
     from: 'home'
     for: "00:05:00"

I am not sure if this will trigger corectly if the state changes from ‘home’ to ‘not_home’ and then after 1 minute to ‘work’.

Yeah, that’s similar to what I was envisioning when I said it wasn’t fool proof.

I’ve been using the proximity integration for this. For example, my thermostat will go into away mode when we’re all > 55KM from home, and only turn back on when we’re <45KM. It works well for the most part, but unfortunately proximity isn’t preserved across home assistant restarts and goes to 0 for a minute or two even when all tracked devices are away.

While Thresholds support this, they don’t work with zones since they are a separate domain.

Anyone else come up with good ways to handle this? In my case, I think I could use a zone, but then have a long “for” timer like 10 or 15 minutes.