Proximity sensors "not set" - zone definition issue?

I’ve never played with proximity sensors, and I’m starting to now. At the moment I’m only concerned with proximity to my home zone. I have the home zone defined in configuration.yaml:

homeassistant:
  name: Home
  latitude: !secret latitude
  longitude: !secret longitude
  elevation: !secret elevation

…and that works fine. I’m wondering, however, whether my proximity sensors aren’t working because home isn’t defined under zone:. I have attempted to define a home zone under zone: in configuration.yaml, but it just creates a duplicate zone (as described in my post here).

My proximity sensors are defined as:

proximity:
  person1_home:
    ignored_zones:
      - zone1
      - zone2
      - zone3
    devices:
      - device_tracker.person1_device
    tolerance: 10
    unit_of_measurement: mi
  person2_home:
    ignored_zones:
      - zone1
      - zone2
      - zone3
    devices:
      - device_tracker.person2_device
    tolerance: 10
    unit_of_measurement: mi

I have tried also to define the zone in each sensor, rather than leaving it to default:

proximity:
  person1_home:
    zone: home
    ignored_zones:
      - zone1
      - zone2
      - zone3
    devices:
      - device_tracker.person1_device
    tolerance: 10
    unit_of_measurement: mi

…however, in any case, the sensor values are all “not set” when the device_tracker is not_home. When home, the proximity sensor value is 0, with attribute dir_of_travel showing stationary and nearest showing the device_tracker entity… which, to me, says the sensor is doing something, albeit not working correctly.

EDIT: I should say that the Waze Travel Time integration for calculating drive time to my home zone works great. For troubleshooting proximity, I’ve:

  • commented out the latitude, longitude, and elevation under homeassistant: in configuration.yaml, then restarted… which resulted in no change to the home zone.
  • defined the reference zone for the second sensor to a different defined zone. That also resulted in not set values… though that device isn’t moving around at the moment:
  person2_home:
    zone: zone1
    ignored_zones:
      - zone2
      - zone2
    devices:
      - device_tracker.person2_device
    tolerance: 10
    unit_of_measurement: mi

Any tips?

While I haven’t figured out why proximity sensors don’t work… a template sensor works accomplishes the same thing:

  - sensor:
    - unique_id: distance_from_home_person1
      name: Distance from Home Person1
      state: {{ (distance('person.person1','zone.home')) }}

I may never get to the bottom of that zone definition issue from the other thread, though. There was a related issue reported on the Git that closed, but nothing has changed from what I can tell.

2 Likes

Not giving you hope, but jumping on the bandwagon. I have the same issue. I also saw that git issue, not sure what all was done there either.

Well, I’ve suspended looking into it because now my mobile device_tracker entities aren’t updating, which is a much larger problem.

How can you check to see if it even works?

I got it to work just now by the way. I used person.shortname in my yaml file, and I had to go into the companion app > configuration > sensors > enable the background location tracking and anything else related to location that made sense. Let me know if that works for you.

Well, my device_tracker entities are back to working now. But if I understand your question correctly, you can always force the value of a sensor in Developer Tools–>States to test things out. Just be prepared for unexpected behavior if you have any automations looking at those sensors…

Hi
@testuser @DeltaNu1142

I aso don’t seem to be able to get this to work? I think I have setup my home zone and added my user device trackers but not matter what my proximity sensor for always says “far” for every user?

image

image

I think I am misunderstanding something?

I never really got proximity to work for me, either. I disabled those sensors quite awhile ago. I use drive time and distance from the Waze integration.

thanks! I’ll give it a go.