Changing Person's location based on wifi

I’m using the iOS app to monitor my location and there is a place that I am sometimes at that is very close to one of the predefined locations. (Less than 200 meters)

Is there a way I can change my location whenever my phone connects to a specific SSID ?

I have tried to set it up as an automation, but didn’t make any progress.

2 Likes

Have you found a solution? I am willing to achieve the same goal.

1 Like

Not yet @mgim.

My last attempt was something like this:

alias: Mark Bruno Away if he is in the coffee shop
description: ''
trigger:
  - entity_id: sensor.sonic_screwdriver_ssid
    for: '00:01:00'
    platform: state
    to: Howaboutcoffee
condition: []
action:
  - condition: state
    entity_id: person.bruno
    state: Away
mode: single

Of course it doesn’t work because I am not aiming at the right property of person.bruno.

The properties available are:

editable: true
id: b88576b7a8304964a28df82c8d1c7b61
latitude: 38.740xxx
longitude: -9.13xxx
gps_accuracy: 65
source: device_tracker.sonic_screwdriver
user_id: e25c96576cc74ea3b03a4f79c40b33cf
friendly_name: Bruno
entity_picture: /api/image/serve/f1d9540427de6b370e5ef48e1d4d37dd/512x512

So I am not sure it is even possible. An option would be to fire a scene meant for when I am away, but that doesn’t allow for tracking when I am actually not home.

I tried using the device_tracker.see which is actually what we try to do. But it didn’t work…

Device tracker works if you try to set the gps coordinates.

But the goal here is not to change the radius or gps of the person. It’s to show to HA that just because it’s inside the radius it doesn’t mean the person is at that location.

What about if you use a binary_sensor helper for home/away instead. If you just want to know if they are home or away you can trigger it on and off based on a template of their iOS device location, SSID, connection to your home wifi etc.

Maybe not exactly what you’re looking for but should accomplish the goal of home/away.

1 Like

I know this is a very old thread, but since it was the top google result for “wifi location home assistant” I feel about reviving it.

I had success using the following automation:

alias: Update work location
description: ''
trigger:
  - platform: state
    entity_id:
      - sensor.phone_wifi_connection
    to: work_wifi_name
condition: []
action:
  - service: device_tracker.see
    data:
      location_name: Work
      dev_id: my_phone_wifi_location
mode: single

just change the entity_id with the wifi entity of the phone you want to monitor, and the work_wifi_name with the correct wireless name.

This creates a new tracker device named my_phone_wifi_location and updates its location to work. Therefore you just have to change the setting of the person to add a new tracker.

6 Likes

Thank you very much for reviving this thread (about two years ago!) :smiley:
This is a great solution. I have adapted your automation to toggle hom/not home on SSID state change, and this seems to work great.
I actually think that this is a great alternative to device position tracking and is likely sufficient and much better for most use cases when trying to determine if someone is home or not (less false positive, more privacy, lighter on the device)…
This should be a default feature;)

1 Like