Proximity sensors

How do the proximity sensors work in Home Assistant? Mine are never populated (e.g., sensor.home_nearest_device, sensor.home_nearest_direction_of_travel, sensor.home_nearest_distance). I do have a ‘person’ set up with GPS trackers populated routinely. What do I have to do to get proximity sensors to work? Thanks!

Anyone able to respond here? Disappointing that I can’t get proximity to work and this doesn’t appear to be well-documented.

How are you connecting your device to Home Assistant?

Is HA accessible to your device outside your local network?

Do you have location services enabled on your device?

I have a Samsung phone and the Home Assistant app is installed on the phone. I use Tasker to update my location via a webhook and ties to my ‘person’, so I can see my location on a map in Home Assistant but it’s not updating the proximity sensor for some reason. Home Assistant is accessible using a Cloudflare tunnel, although I can also access via my IP.

If you have the Home Assistant companion app on the phone, and your HA instance is accessible, why use the Tasker>webhook>?>person method?

Is your Tasker-based method using a device_tracker entity or some other method?

I think anything with gps gps coordinates can display on the map, but that may not be enough for proximity. What did you use to set the gps location from the webhook in an entity? can you show the developr tools info of the entity you use? What did you put in the proximity sensor definition?

I didn’t have it working with Cloudflare before, and the companion app is finicky when it comes to internal vs external networks (AT&T wouldn’t work properly with a loopback), so it would rarely update my location correctly. Maybe it would work better now with Cloudflare, not sure.

Sure, is this what you’re looking for?

Things like if it is a device tracker, if the source type is gps, … This looks like one from a companion app rather than one from a webhook? I see no reason why this one shouldn’t work, provided you give it some time to see movement for some of the entities.

Is this tracker added directly to the proximity sensor in the gui? Or did you put a person there with multiple trackers? Do you use device_tracker.see to set the gps coordinates from the webhook?

And what did you use for the base of the proximity sensor? Are those coordinates set properly too?

This isn’t tied to the companion app - I feed it all these details via the webhook using Tasker.

You refer to the ‘proximity sensor’ as if I can adjust that. Where would I make any changes to what’s included in the proximity sensor? I couldn’t find any documentation to that effect. I have this entity tied to my person along with a couple of other things like I think Bluetooth on my phone and my smartwatch.

image

Looks like those other two things don’t do anything now so I removed them. I think one was a ping sensor and the other was my smartwatch Bluetooth.

Ah, I was looking based on the entity, but there’s actually a Proximity integration that I hadn’t added. I assumed this was just built-in since they removed the previous method. I added the integration and it seems to be picking up now based on the Person entities. Thanks!

What you show so far is a person which gets a location. I assumedyou added the proximity integration (Nabijheid in Dutch for me), where you pick the place to get proximity for, and the entities you want to measure:


The zone should have proper gps coordinates too of course, to measure distance and direction of travel.

I had not but I have now, thank you. Now I have, for example:

sensor.home_2_nearest_distance

Plus:

sensor.home_nearest_distance

The former populates correctly but the latter does nothing. But I can probably work with this and just ignore the ones that don’t populate.

Give it some time, the other will probably populate once ther’s been some movement. They look like two different proximity integrations though (hence the _2), did you also have an (old) one in yaml? Maybe one is not set up right?

Yeah, I think it was set up via yaml before and they removed the yaml method, but I couldn’t find a good explanation of what to do after that.

It should have migrated to gui I think.

Apparently not - I had to manually install the integration. But maybe I messed up something in the yaml version, I could never get it working quite correctly. Excited to try this with the video tutorial and see if I can get my thermostat to adjust when it detects that I’m headed home.

1 Like

Curious though how you get attributes in your tracker that device_tracker.see does not have as parameters?

It’s been a while since I set that up but looks like there’s a Python script that handles setting certain attributes. I didn’t write it myself so must have found that online.