Close garage door

I have created an automation to open the garage door when any of the device_tracker are within a certain area of the home. That automation has been pretty successful every now and then it will not open but for the most part works fine.

Now I would like to have HA check to see if all device_trackers are gone from the house then close garage door. Can anybody help me out with this automation.

Thanks in advance for any help!!

Probably something like:

- alias: Away Mode - General
  hide_entity: True
  trigger:
    platform: state
    entity_id: group.all_devices
    from: 'home'
    to: 'not_home'
  action:
    - entity_id: cover.garage_door
      service: cover.close
1 Like

Does that mean I need to setup a state for group.all_devices?

normally the groups group.all_* are automatically set up by HA. Check for it in the states <> tab on the sidebar.

After looking at states <> tab there are multiple items that show home all the time. Not sure how that state would change to not_home?

You could either remove those entities from being tracked or create a new group containing only the entities that you want the trigger to be based off.

Might go without saying but be really careful automating something like a garage door. I know ours weighs a ton, so any automation is out of the question for us until we have some kind of safety feature in place.

Sorry to sound like a kill joy

One more hurdle. I have a couple of states for device_tracker, home, not_home, work and one other location. How do I get HA to see multiple locations for trigger? Anything but home would be great.

You would simply use not_home.

away = not in any specified zone
not_home = not at home

I am still pretty green with HA where do I establish those values?

You would specify a group in your configuration.

Sorry I was not very specific, I have created the group with the device-trackers I just do not know how to establish how those trackers report either home or not_home. I am using Life360 as the presence detector and not sure how to get HA to see only home or not_home

Iā€™m not familiar with the Life360 component, but most device trackers default to home and away, unless other zones are specified. The not_home state is special in that it returns true if the tracker reports any location other than home even if the actual state reported is away, work, etc.