This weekend the door triggered an OPEN while I was sitting in the living room due to Life360 triggering an AWAY event and HOME event in the same minute.
To combat this I added the following this morning:
@pnbruckner your last edits worked. It clears the entries upon use as it should.
Only issue now is when we both leave together. It triggered on my girl and opened the correct door, however, an hour later, I triggered as being home. It then ran the automation again. Opened the same door, waited, and then closed it, per the catch to close the door.
I am pondering how to clear both entries when we both leave and return together.
I have created a script to manually run when we both come home as a stop gap while i figure this out.
I added the text âClearedâ to the entity as a marker of running the manual script.
Now RatGDO has a new sensor with a Laser, that I could swap in that will actually tell me if the vehicle is in the spot. Easy catch to add to the automation then. If car in slot, Stop.
Will see if I go that way or come up with something else âŚ
This is awesome regardless, so happy with the added functionality
In this scenario, what would you have it do differently? Should it not open a door when you get home? Should it open a different door, and if so, which one?
Do you usually play musical chairs, or does everyone usually park in one position? If the latter, then why not just have it open a particular door for each person when they get home? And, if you have a sensor for each car position, even better. Like you said, when a person gets home, if their carâs position in the garage is not occupied, then open that door. If it is occupied, then donât.
In the above scenerio is when we left and returned together in one car.
When we leave at different times and different cars, everything works awesome.
When we both leave in the same car is where this last issue pops up (sometimes) as it stores the correct door we left from in each of our helpers, but then upon return, it only triggers one of us and if the next persons return trigger was delayed in triggering, then it will run the automation again as the helper wasnât cleared.
Taking the above example @pnbruckner how would I add the following scenario?
Only saving the âlast doorâ used within the last XX minutes?
New Logic Issue:
Last night at 9PM ET, AWAY triggered for myself. It stored the âLast_doorâ as my girls from earlier, as that was the last door used, which occurred at 6PM. Then at midnight, HOME was triggered, thus opening the door.
My thought it, if we limit it to only save the last triggered door within the last 30 minutes. IF no door was used recently it would just fail and not continue, thus eliminating the issues of ghost triggering automations and grabbing whatever was lat used under an unrestricted time scale.
When i look at Life360, it shows that i have been home for 3 days, which is accurate.
I think you need to work on resolving why a tracker entity is changing to not_home when it shouldnât be. E.g., maybe your Home zone is too small.
In theory, even if a tracker reports a fairly inaccurate location reading, it should also indicate that with a larger accuracy attribute at the same time. The result should be that the trackerâs location circle (i.e., latitude/longitude at the center, with a radius defined by the accuracy attribute) still overlaps where the device really is, and if itâs in the Home zone, then the device should still be reported as home.
In practice, though, that isnât always the case. Sometimes, for some reason, a tracker will report an inaccurate location without increasing the accuracy attribute accordingly. (If you track the entity on a map with breadcrumbs/history, youâll see a âjumpâ in its location.) For situations like this, it might be best to increase the size of the Home zone to help avoid these issues.
Thx @pnbruckner . I have been trying to understand the ghost jumps. It happens so infrequently it i shard to catch. Still diving in there. (Hence the 2 weeks between postings as it was flawless)
Just to keep everyone updated whom is following for easy reference. Here is the current complete code that is now in place for saving the last door used:
alias: Garage - Save last door used v1.12
description: ""
triggers:
- trigger: state
entity_id:
- device_tracker.life360_Person1
- device_tracker.life360_Person2
from: home
to: not_home
conditions:
- condition: template
value_template: |-
{{
(now() - states[last_door].last_changed).total_seconds()
<= 30 * 60
and states.input_text
|selectattr('entity_id', 'contains', 'input_text.door_')
|select('eq', last_door)
|list|length == 0
}}
actions:
- action: input_text.set_value
target:
entity_id: "{{ helper }}"
data:
value: "{{ last_door }}"
variables:
helper: >-
input_text.door_{{ trigger.entity_id.removeprefix('device_tracker.life360_')
}}
last_door: >-
{% set doors = [
states.cover.ratgdov25i_1be829_door,
states.cover.ratgdov25i_1be833_door
]
%} {% set last_door = (doors|sort(attribute="last_changed"))[-1] %} {{
last_door.entity_id }}
Does it evaluate to true or false, or report an error? If it evaluates to true or false, does it change to the opposite if you change <= to > in the template?