Keep track of presence of guest

There are countless of uses for sustained location tracking with accuracy. The most obvious: to know where the person is exactly, to leverage the Proximity integration for relative distance and bearing, to trigger automations when approaching a zone…

iOS restrictions deny a great deal of usefulness to location tracking, other than when crossing zone boundaries.

Can you share code for this week and or this month?

I am very newbie with templates

The code in my previous post tracks an entity state since the last Monday midnight. This makes most sense in my context of being a work-time tracker. If you just want the last 7 days, you can set duration and end as below:

duration:
  days: 7
end: now()

You really need to take a look at the History Stats integration page for proper information for how to set this up for your own situation. For the last month, it would be as easy as

duration:
  days: 30
end: now()

The History Stats integration requires two of start, end and duration

1 Like

You make a reasonable point if you are using the proximity integration. I couldn’t think of any uses for that in my own instance but clearly some people use it. I would maintain that most areas of importance can be made into zones though like work, home, gym, shops, etc.

We are fortunate in that we are an iPhone family so we use Find My if for some reason we need extremely accurate location tracking. If you have no alternative because your family is cross platform then I can see that being an issue too.

For automation purposes, you can definitely use workarounds though. For instance, a second zone with the same long/lat but with a greater radius of the zone you want “approaching” info for. For instance, a near_home zone surrounding your home zone. You could also use zones covering the main angles of approach to your home zone by road/footpath, e.g. near_home_north_road. I don’t disagree that this is added complexity but it ought to be a reliable workaround for iOS.

I suppose what I’m saying is that in my own experience of using HA with iPhone location tracking, I’ve never needed to do anything with precise location that couldn’t be achieved with Zones, which work brilliantly well on iOS. I’d be interested to know any use cases of precise location tracking you use for your Android phones though as I am always looking for new automations to add to my own setup.