Geofency state becomes "unknown" after HA restart

Hi, I’m a newcomer to HA coming from another software tool. Been using Geofency with that for many years without issue. I have Geofency configured and assigned to a person (me) as a device tracker.

Testing the Gefoency webhook for enter/exit correctly updates my presence in HA.

My issue is that when HA is restarted, my state becomes “unkown” and I have to resend the webhook commands from Geofency again to get it updated.

Am I missing something here? I would have thought that HA would “remember” the state prior to the restart.

Any help would be appreciated as I continue to evaluate HA as a viable solution moving forward.

Thanks

Had same issue for long time. But when geofency sends a new location it’s back again.

I moved to a different way to let HA know we went home of leave… At iPhone I use homekit and his leave arrive automation to turn on a input_switch for every person in household. Works great and even better

Thanks @poudenes

Problem is definitely with the integration as GeoFency works perfectly elsewhere.

Would it be possible for you to share how you got around the issue (details)?

As I mentioned, I’m new to HA so not sure how I can associate the input switch to a person as a device tracker.

I created 2 input_booleans:

input_boolean.helpers_kay_home_homekit
input_boolean.helpers_peter_home_homekit

Those 2 are in my homekit on my iPhone. So I can turn them on and off manual. I created automations in homekit to do this automatic. 4 in total. 2 for me and 2 for my partner. When I leave turn of this input_boolean and turn on when I arrive.

Then I created a binary_sensor. This is my Group Family. It will turn on when 1 of 2 input_booleans is on.
All my automation in HA is triggered on this sensor.

- binary_sensor:
    - name: "Group Family Manual"
      unique_id: "3e43a954-abc1-447a-af7c-8f789ba73f2f"
      state: "{{ is_state('input_boolean.helpers_kay_home_homekit', 'on') or is_state('input_boolean.helpers_peter_home_homekit', 'on') }}"
      device_class: presence
      delay_off: "00:00:30"

Hope you understand the way how I did it.

1 Like

Thank you @poudenes
I appreciate you taking the time to help and for sharing your code.

I will try and see if I can replicate that in my HA install

1 Like

And? Did.you make it work?

@poudenes
I took a similar approach but I’m still using Geofency

I have it send the webhook and I’m checking the json.entry data (1=home, 0=away) and store that as an input Boolean. I then have an automation that checks the value and updates a device tracker entry which is linked to my person entity.

The small issue was that on HA restart it would always set the device tracker to away so I created an automation to run on HA start up that checks the value of the input Boolean and updates the device tracker accordingly

Seems to work good so far !

1 Like