Proximity


The proximity component allows you to monitor the proximity of devices to a particular zone and the direction of travel. The result is an entity created in Home Assistant which maintains the proximity data.

This component is useful to reduce the number of automation rules required when wanting to perform automations based on locations outside a particular zone. The zone and state based triggers allow similar control but the number of rules grows exponentially when factors such as direction of travel need to be taken into account.

Some examples of its use include:

  • Increase thermostat temperature as you near home
  • Decrease temperature the further away from home you travel

The Proximity entity which is created has the following values:

  • state: Distance from the monitored zone (in km)
  • dir_of_travel: Direction of the closest device to the monitored zone. Values are:
    • ‘not set’
    • ‘arrived’
    • ‘towards’
    • ‘away_from’
    • ‘unknown’
    • ‘stationary’
  • dist_to_zone: Distance from the monitored zone (in km)

To enable this component in your installation, add the following to your configuration.yaml file:

# Example configuration.yaml entry
proximity:
  home: 
    ignored_zones:
      - twork
    devices:
      - device_tracker.car1
    tolerance: 50
    unit_of_measurement: mi

Configuration Variables

proximity

To add multiple proximity components, simply use a list in your configuration.yaml file:

# Example configuration.yaml entry
proximity:
  home:
    ignored_zones:
      - work
      - school
    devices:
      - device_tracker.car1
      - device_tracker.iphone1
      - device_tracker.iphone2
    tolerance: 50
    unit_of_measurement: mi
  home3:
    devices:
      - device_tracker.iphone1
    tolerance: 50
  work:
    devices:
      - device_tracker.iphone2
    tolerance: 10