Change temp triggered by distance away from home

Any help with this problem I have would be appreciated. I’m trying to follow what Smart Home Junkie on this YouTube video Geofencing in Home Assistant - TUTORIAL - YouTube . I just can’t get it to work, my phone shows I have left the house and over the trigger distance my wife’s also. I checked proximity.home it also shows we are out over the distance. I have been searching on this site and Google also commented to Smart Home Junkie he said it should work am I missing something.

‘’'alias: geolocation_nest
description: "Set temperature based on if we leave or come home "
trigger:

  • platform: numeric_state
    entity_id: proximity.home
    above: “3”
    id: leaving_home
    value_template: mi
  • platform: numeric_state
    entity_id: proximity.home
    id: arriving_home
    below: “3”
    value_template: mi
    condition: []
    action:
  • choose:
    • conditions:
      • condition: trigger
        id:
        • leaving_home
          sequence:
      • service: climate.set_temperature
        data:
        temperature: 74
        target:
        entity_id: climate.living_room
    • conditions:
      • condition: trigger
        id:
        • arriving_home
          sequence:
      • service: climate.set_temperature
        data:
        temperature: 71
        target:
        entity_id: climate.living_room
  • service: notify.mobile_app_zfold
    data:
    message: "Temp Notification "
    mode: single’’’

This is my 2nd try lets see if it works added dir_of_travel

‘’'alias: geolocation_nest
description: "Set temperature based on if we leave or come home "
trigger:

  • platform: numeric_state
    entity_id: proximity.home
    above: 3
    id: leaving_home
    value_template: mi
  • platform: numeric_state
    entity_id: proximity.home
    id: arriving_home
    below: “3”
    value_template: mi
    condition:
  • condition: state
    entity_id: proximity.home
    attribute: dir_of_travel
    state: towards
    for:
    hours: 0
    minutes: 1
    seconds: 0
  • condition: state
    entity_id: proximity.home
    attribute: dir_of_travel
    state: away
    for:
    hours: 0
    minutes: 1
    seconds: 0
    action:
  • choose:
    • conditions:
      • condition: trigger
        id:
        • leaving_home
          sequence:
      • service: climate.set_temperature
        data:
        temperature: 74
        target:
        entity_id: climate.living_room
    • conditions:
      • condition: trigger
        id:
        • arriving_home
          sequence:
      • service: climate.set_temperature
        data:
        temperature: 71
        target:
        entity_id: climate.living_room
  • service: notify.mobile_app_zfold
    data:
    message: "Temp Notification "
    mode: single’’’

You need to remove your value_template lines in your trigger. This is for doing some calculation on the state value but you have set this to ‘mi’ so the automation will always see the proximity as mi not above the actual distance and ‘mi’ will never be greater than 3.

Thank you that was one of the problems I also needed to add to my Config.yaml

Please format your code correctly.

Looks like you might have tried, but it’s three backticks you want: ```.

Your second attempt looks like it’ll fail as conditions are AND by default, but you have two mutually-exclusive conditions.

If anyone is looking to do this you can use the first Automation I put on the post and delete the mi as msp1974 said. You need to add to your configuration.yaml file below I had the proximity part and even though I had my home location set up in HA this auto didn’t work till I added it to the yaml.
‘’’
proximity:
home:
ignored_zones:

devices:
  - device_tracker.crystal_phone
  - device_tracker.zfold
tolerance: 50
unit_of_measurement: mi

zone:

  • name: Home
    latitude: xx.xxxxx
    longitude: -xx.xxxxx
    radius: 50
    icon: mdi:home
    ‘’’