i am trying to run an action if an event happened within the past 3 seconds. my problem is that sometimes the logs do not go back far enough and i get an incorrect negative value. these are 2 conditions that i have in my rule:
Time Since Event: contact(open) on Back Door(0:25:19) exceeds 0:00:03 TRUE (unused)
Time Since Event: contact(open) on Front Door(?) exceeds 0:00:03 FALSE (unused)
i know the back door was opened 25:19 minutes ago, which exceeds 3 seconds, so the condition evaluates TRUE. however, i believe since the logs only go back 12 hours or 7 entries, not sure how it works, and the front door has not opened within that time according to logs. it incorrectly evaluates FALSE due to unknown value (?), let's assume the front door has been opened in the past, so this should evaluate TRUE with a large time. this is what i see as my front door logs:
dev:1572023-06-10 08:49:15.745 AMinfoFront Door battery is 100%
dev:1572023-06-10 07:38:06.521 AMinfoFront Door battery is 100%
dev:1572023-06-10 06:26:57.370 AMinfoFront Door battery is 100%
dev:1572023-06-10 05:15:48.169 AMinfoFront Door battery is 100%
dev:1572023-06-10 04:04:38.864 AMinfoFront Door battery is 100%
dev:1572023-06-10 02:53:29.622 AMinfoFront Door battery is 100%
dev:1572023-06-10 01:42:20.432 AMinfoFront Door battery is 100%
my first question: i dont know why the battery level was reported about ever hour last night. is there a way to suppress battery level reporting frequency? maybe if there were not so many battery level reports, the logs would have the last time the door was opened, which should have been sometime on 2023-06-09.
absent this, my second question: what i really want is to know is TIME SINCE EVENT is LESS than. the only option in TIME SINCE EVENT is EXCEED. i want to know if an event has occurred in the last 3 seconds, and if it has, then evaluate TRUE, to avoid any issues of incorrect FALSE values i am getting above due to lack of logs. if i was able to put negative (-3) seconds in the condition, that should techically work too, but i am unable to enter in negative numbers.
or is there another way to do what i am looking for?
my issue is that part 1 fires based on presence at 2:27:
app:4162023-06-10 02:27:20.443 AMinfoAction: Run Actions: Amazon Echo TTS Notification - Welcome Home Part 2
app:4162023-06-10 02:27:20.403 AMinfoAction: END-IF
app:4162023-06-10 02:27:20.400 AMinfoAction: Set globalArrivalNames to '%globalArrivalNames% and %device%(SANDY and SANDY)' (skipped)
app:4162023-06-10 02:27:20.380 AMinfoAction: ELSE (skipping)
app:4162023-06-10 02:27:20.365 AMinfoAction: Set globalArrivalNames to '%device%(SANDY)'
app:4162023-06-10 02:27:20.323 AMinfoAction: IF (Variable globalArrivalNames( ) = ' '(T) [TRUE]) THEN
app:4162023-06-10 02:27:20.292 AMinfoEvent: SANDY presence present
then part 2 fires at 2:27, and waits for 3 minutes until 2:30 for the door to open, but since the door never opens during the 3 minute wait, it skips everything, event timeout.
app:4182023-06-10 02:30:20.714 AMinfoAction: END-IF
app:4182023-06-10 02:30:20.712 AMinfoAction: playAnnouncement('Welcome home %globalArrivalNames%. The temperature is %localTemp%.(Welcome home SANDY. The temperature is 76.)') on Kitchen - Echo (skipped)
app:4182023-06-10 02:30:20.707 AMinfoAction: Delay 0:00:02 (skipped)
app:4182023-06-10 02:30:20.704 AMinfoAction: ELSE-IF (Front Door contact open(F) [FALSE]) THEN (skipping)
app:4182023-06-10 02:30:20.693 AMinfoAction: playAnnouncement('Welcome home %globalArrivalNames%. The temperature is %localTemp%.(Welcome home SANDY. The temperature is 76.)') on Kitchen - Echo (skipped)
app:4182023-06-10 02:30:20.687 AMinfoAction: Delay 0:00:02 (skipped)
app:4182023-06-10 02:30:20.685 AMinfoAction: IF (Back Door contact open(F) [FALSE]) THEN (skipping)
app:4182023-06-10 02:30:20.602 AMinfoWait over: timeout
app:4182023-06-10 02:30:20.595 AMinfoWait Event: timeout timeout
app:4182023-06-10 02:27:20.514 AMinfoAction: Wait for event: Front Door, Back Door any contact open --> timeout: 0:03:00
app:4182023-06-10 02:27:20.492 AMinfoAction: Set localTemp to Living Room - MultiSensor Temperature(76.5)
app:4182023-06-10 02:27:20.474 AMinfoEvent: Actions run by Amazon Echo TTS Notification - Welcome Home Part 1
the issue is that the presence is identified too late and my wife has already walked in through the door at 2:26, one second before part 1 fires
dev:4782023-06-10 02:26:46.493 AMinfoBack Door is closed
dev:4782023-06-10 02:26:42.695 AMinfoBack Door is open
so i would like to evaluate whether someone has walked in the door within the last 3 seconds. looking at logs over time, 3 seconds would usually be enough time.
the problem with using the door open as a trigger is that it would fire "welcome home" if someone has been present in the home incorrectly (did not just arrive) every time the door is opened. and i am back to my original problem. i would need to know if someone just arrived in the past within 3 seconds.
edit: i think i understand what you are getting at. it will take quite a bit of spaghetti if thens. let me think about it.