Help with garage automation

I have been trying to setup an automation to automatically open or close my garage when I leave my house or get home. Ive tried multiple set ups none of them work. I have 2 zones setup on my street before I get home G1 and G2.

The first idea was to have the automation trigger when I go from G1 to G2, but that requires using “state: from: to:” and the automations never work when looking for a state, only for a zone. Zone does not have the ability to use from: to:, every time i try that it throws errors when I do a config check

Without going from G1 to G2 or G2 to G1 HA doesnt know whether im coming or going, unless someone has another way of doing that.

Another idea I had was to trigger an actionable notification when I enter a zone, and have it ask if I want to open or close. I can do that with no issues, but it wont appear on apple car play. And when I make it a critical notification, it does appear on car play, but is no longer actionable.

Im pulling what little hair I have left out, there’s got to be a better way. Please help

Man… I wouldn’t auto-close a garage door. Just wait till you’re pulling in and it closes right in front of you.

What might help though with your G1 to G2 and stuff is to enable high accuracy mode on approach of yyour zones. Then the updates can be configured to be extremely accurate and you’d have a better experience with faster location updates as well.

EDIT: Although that may be more geared for android which is what I use.

Thanks for the input.

I am leaning towards the actionable notification approach, so I can choose.

But in regards to your post, I have watched on the app while driving my HA sees when im in each zone perfectly, so that’s not the issue. Thanks for the input though

In addition to what calisro said, when your HA system reboots or resets the presence detection, you’ll get an in-zone event just as if you had entered the zone. This would likely result in your garage door opening when you’re already at home.

OK, makes sense. Im going to focus on the actionable notification method, which i like better anyway. Im going to make a new thread focused on that

Here is the way I do it…

I set up proximity sensors based on my mobile app and/or life360 location:

proximity:
  home_me_ft: 
    devices:
      - device_tracker.life360_me
    tolerance: 50
    unit_of_measurement: ft
  home_me_ft_mobile: 
    devices:
      - device_tracker.my_mobile_app
    tolerance: 50
    unit_of_measurement: ft

then I use those in my garage door automations:

automation:
  - id: gd_auto_open_north_garage_door
    alias: GD Auto Open North Garage Door
    trigger:
      - platform: template
        value_template: "{{ states('proximity.home_me_ft') | int < 1000 or states('proximity.home_me_ft_mobile') | int < 1000 }}"
    condition:
      - condition: or
        conditions:
          - "{{ state_attr('proximity.home_me_ft', 'dir_of_travel') == 'towards' }}"
          - "{{ state_attr('proximity.home_me_ft_mobile', 'dir_of_travel') == 'towards' }}"
      - "{{ 'AA:DD:EE:62:FA:FE' in state_attr('sensor.my_mobile_app_bluetooth_connection', 'connected_paired_devices') }}"
      - condition: state
        entity_id: cover.north_garage_door
        state: 'closed'
    action:
      - service: script.open_gdn

  - id: gd_auto_close_north_garage_door
    alias: GD Auto Close North Garage Door
    trigger:
      - platform: numeric_state
        entity_id: proximity.home_me_ft
        above: 1000
      - platform: numeric_state
        entity_id: proximity.home_me_ft_mobile
        above: 1000
      - platform: state
        entity_id: person.me
        from: 'home'
    condition:
      - condition: or
        conditions:
          - "{{ state_attr('proximity.home_me_ft', 'dir_of_travel') == 'away_from' }}"
          - "{{ state_attr('proximity.home_me_ft_mobile', 'dir_of_travel') == 'away_from' }}"
      - "{{ 'AA:DD:EE:62:FA:FE' in state_attr('sensor.my_mobile_app_bluetooth_connection', 'connected_paired_devices') }}"
      - condition: numeric_state
        entity_id: proximity.home_me_ft
        above: 1000
      - condition: state
        entity_id: person.me
        state: 'not_home'
      - condition: state
        entity_id: cover.north_garage_door
        state: 'open'
    action:
      - service: script.close_gdn

It opens the door if both proximity sensors are <1000 ft from home, my phone is connected to my truck (only needs to open if I’m in my truck) and I’m going toward home.

it closes if I’m more than 1000 ft away, moving away, I’m not home and my phone is connected to the truck.

there is some redundancy here but that’s OK.

It sounds like you tried to trigger based off the state of a zone rather than the state of the person entity.

I think you just gave me the answer, i didnt even realize that was availible. Im going to try it later, thank you!