For presence detection, we feed our phone's GPS into HA (I use the minimal version of the app, so a separate app does the GPS feed direct to my HA without Google / Apple datacenters)
I have a large "Almost Home" zone centered around our home, but with a much larger radius - this allows for time delays / bad signal, so that the house can turn on lights, etc. before we arrive.
Then I use ping to detect that we really are at home.