Contact Sensor Opened > 1 minute ago how ?
-
Hi
I'm stuck migrating one of my PLEG conditions.
tFrontDoorOpened;NOW>1:00
Which means the trigger "Front Door Opened" happened more than 1 minute ago.
How do I do this in MSR ? An expression I assume ?
I want to use it as part of a Constraint.
Any help please.
Thanks.
-
If you use sustain for 60 seconds, then the sensor would need to be tripped for a minute before going true.
I'm not sure that will work for what I am trying to setup.
In fact I don't think I can even replicate the set of conditions I had setup in PLEG for this same rule.
Let me back up and start again, as I am sure there will be a better way of doing this.
Doorbell Camera Motion detected is the trigger for this rule.
The actions "Set Reaction" is to do some TTS and bring up the camera feed on some tablets / TVs etc.
The conditions "Constraints" I only want this rule to run its actions, If the front door hasn't been recently opened or closed for that matter.
e.g. when I come back in to the house and open / close the door to get in, I don't want this rule to run.
But if I am already in the house and its someone else outside mooching about near the doorbell cam, then I do want the rule to run its actions.
-
I'm not sure that will work for what I am trying to setup.
In fact I don't think I can even replicate the set of conditions I had setup in PLEG for this same rule.
Let me back up and start again, as I am sure there will be a better way of doing this.
Doorbell Camera Motion detected is the trigger for this rule.
The actions "Set Reaction" is to do some TTS and bring up the camera feed on some tablets / TVs etc.
The conditions "Constraints" I only want this rule to run its actions, If the front door hasn't been recently opened or closed for that matter.
e.g. when I come back in to the house and open / close the door to get in, I don't want this rule to run.
But if I am already in the house and its someone else outside mooching about near the doorbell cam, then I do want the rule to run its actions.
@cw-kid Try this:
Ignore my device names. They should be at least close enough to express the relationships.
The trigger is the motion sensor. Easy enough.
The constraints have been set to NOT AND, which inverts the output of its logic. The only condition in the constraints is a check to see if the door sensor has changed state, and it delays reset for 60 seconds. When the door changes state to either open or closed, the changes operator will start the 60-second clock and be true that entire period, which means the Constraints will be false (because of the not). When the time expires, the condition will go false, which means the Constraint group is then true, and reactions can run.
In English: run the reactions when the motions sensor trips and the door hasn't changed state in the last 60 seconds.
-
@cw-kid Try this:
Ignore my device names. They should be at least close enough to express the relationships.
The trigger is the motion sensor. Easy enough.
The constraints have been set to NOT AND, which inverts the output of its logic. The only condition in the constraints is a check to see if the door sensor has changed state, and it delays reset for 60 seconds. When the door changes state to either open or closed, the changes operator will start the 60-second clock and be true that entire period, which means the Constraints will be false (because of the not). When the time expires, the condition will go false, which means the Constraint group is then true, and reactions can run.
In English: run the reactions when the motions sensor trips and the door hasn't changed state in the last 60 seconds.
@toggledbits said in Contact Sensor Opened > 1 minute ago how ?:
In English: run the reactions when the motions sensor trips and the door hasn't changed state in the last 60 seconds.
Yes that's what I want.
I will give it a try.
Thank you.
-
No worries. FYI, watch out for a small UI bug (fixing, of course): if you edit an existing condition with the changes operator in it, it will put "null" in the operands where they were previously blank before, and when you save that, the condition will stop working. Will fix for today's build, but be on the lookout. Just blank those fields back out before saving. You don't care what the change is (open to close or close to open isn't relevant -- it's either).
-
No worries. FYI, watch out for a small UI bug (fixing, of course): if you edit an existing condition with the changes operator in it, it will put "null" in the operands where they were previously blank before, and when you save that, the condition will stop working. Will fix for today's build, but be on the lookout. Just blank those fields back out before saving. You don't care what the change is (open to close or close to open isn't relevant -- it's either).
OK this is what I've got. I also added a check for a virtual switch in the constraints, hope that works.
I haven't tested anything yet.
-
You don't have the delay reset on, it appears (the three dots would appear yellow if you did).
And you're bringing in a group and another device, so that changes the logic. You didn't mention that before, so you need to work it into the logic correctly given that the entire Constraints group is now inverted (false means true and true means false). Have you accounted for that in the test of the switch state? And... why wrapped in a group? Are you going to add more conditions there?
-
I've changed the constraints to this:
I think this is working. If in Vera I trip the front door opened then closed and then trip the doorbell camera motion sensor, the rules reaction is not run as expected.
If I wait over the 60 seconds and trip the doorbell camera motion sensor again, then the rules reaction does run as expected.
I need to test it actually approaching the front door from outside and really opening / closing it, to then hear if it does the TTS announcement or not, that is in the reaction. I shouldn't hear the TTS if I have just changed the doors state etc.
-
Another thing that's been annoying, is when my garden lights via a schedule turn on or off in the back garden, the Hikvision IP camera triggers motion being detected as a result.
I could maybe use this method to stop that happening and stop MSR running the actions "Set Reaction", by checking that the state of the lights hasn't changed within the last X seconds.
Seems to be working, checking if the patio door has changed state in the last 60 seconds OR if the Festoon Lights in the garden have changed state in the last 10 seconds.
-
T toggledbits locked this topic on
-
C cw-kid referenced this topic on