If either the Garage Door or Front Door is open/unlocked
Send a notification
What I’m unclear on is something I see discussed often. What happens if, during the schedule, I open the garage to (say) take out the trash? I assume I will get alerted, right? But what if I close the garage door, then open it again later that night? Will the event re-fire?
I seem to recall that it only gets evaluated once or something to that effect.
Is there something else I may be missing in this simple logic?
[quote=“Bulldoglowell”]How would you like it to behave, a message for every time the door opens?
CheckLocks = DoorsShldBeLocked AND ((GarageOpen AND (GarageOpen;Now<30)) OR (FrontDoorUnlocked AND (FrontDoorUnlocked; NOW < 30)))
this will return true every time either door is opened during the DoorsShouldBeLocked schedule.[/quote]
Remember you should probably not use less than 1 minute for comparing to NOW. It is only updates every minute so it could be over 30 seconds since NOW was updated. Use at least 1:00 (1 minute).
I don’t think you even need the sequences. GarageOpen and FrontDoorUnkocked can be evaluated as just booleans. So you could do:
CheckLocks = DoorsShkdBeLocked AND (GarageOpen OR FrontDoorUnlocked)
This should fire when DoorsShkdBeLocked is true and when either of GarageOpen or FrontDoorUnlocked are true. It will reevaluate because they became true. As soon as the garage door is closed or the door locked they will return to false. I could understand the sequence if you wanted to know if either door was open/unlocked for X minutes or longer, but otherwise I don’t think they are needed.
Thanks for the explanation, Bulldog. I did have the simpler version first but was caught up from the “one time evaluation” rule from the PLEG Basics guide. I suppose I should test it to be sure.
However, your logic also makes sense.
I’ve been more focused on hardware (switches, etc) and have been away from learning PLEG/PLTS/Luup. Every time I refer back to the PDFs, I pick up a few details so I promise I’ll eventually get there and start helping others as I see you and others doing often.
[quote=“Bulldoglowell”][quote=“SirMeili, post:5, topic:180018”]I don’t think you even need the sequences. GarageOpen and FrontDoorUnkocked can be evaluated as just booleans. So you could do:
CheckLocks = DoorsShkdBeLocked AND (GarageOpen OR FrontDoorUnlocked)
This should fire when DoorsShkdBeLocked is true and when either of GarageOpen or FrontDoorUnlocked are true. It will reevaluate because they became true. As soon as the garage door is closed or the door locked they will return to false. I could understand the sequence if you wanted to know if either door was open/unlocked for X minutes or longer, but otherwise I don’t think they are needed.[/quote]
you sure?[/quote]
I’m more than sure. I just tested it using my test pleg and multiswitch.
image 1 is just the "door should be locked (button 1) on
Image 2 is the “door should be locked” and the “garage door is open”
Image 3 is the “door shoudl be locked” and the “front door is unlocked (in this case the switch is on)”
if you look at the time stamps for when the condition is true, you’ll see that it is mere milliseconds after the trigger became true last.
The only time you should worry about the sequence is when you want to check if time has passed, which in this case I don’t think is what the OP is after. He wants to know immediately if the front door is unlocked or the garage door is opened and “DoorsShldBeLocked” is true.
Correct. It does appear to work immediately. It will also fire again if I lock the door and then open it again later.
With that said, it would help if OP was clear with what he wanted!
I suppose a sequence may be helpful. I should give the person who opened the door a chance to re-lock it prior to sending alerts. So maybe waiting 5-10 minutes is a good idea.
I’m learning that so much of this is clearly thinking about what you want, consider as many caveats as you can and THEN implement…I’ll get there…maybe.
I should also note that some triggers never become false. For instance my door lock’s “opened by a pin” is always true (it never enters into a false state since at some point it was opened by a pin). Of course if you wanted to you could use the sequence, or in my case, when I’m using that trigger, I use the “repeats” option which forces it to reevaluate the condition every time something registers true regardless if it has been false since it became true again.
For instance, when I open my door with a pin, the “true” timestamp is updated because it was triggered again, but it was never “false”. I put a screenshot of that trigger on this post so you can see the “false” is 0. A sequence would have worked, but I use this trigger to turn on the foyer light, so I didn’t want to wait up to a minute. This way it evaluates immediately and the light turns on (nearly) instant.
Depends on your needs. I have a teenager in the house… I like to know immediately if a door was unlocked in the middle of the night I also can see how many times any door was opened/closed with time stamps. I don’t currently have it notifying me if any door is opened, but I’m on the verge of that (we have sliders, so no locks)