Repeating announcement while zone violated

RobWalker

Active Member
I am trying to implement a repeating announcement (every 15s) while a zone is not secure.

I currently have three rules:

WHENEVER Zn1 BECOMES NOT SECURE
AND Output 208 STATE IS OFF
THEN TURN Output 208 ON FOR 15 SECS

--

WHENEVER Output 208 IS TURNED ON
THEN ANNOUNCE vm241

--

WHENEVER Ouput 208 STATE IS TURNED OFF
AND Zn1 IS NOT SECURE
THEN TURN Output 208 ON FOR 15 SECS


---

This sort of works, but the announcement is repeated twice when the 15 seconds elapses. I'm not at all familiar with the finer details of the M1's rule execution... any comments on why this is and how to restrict it to a single announcement.

Thanks
 
I am trying to implement a repeating announcement (every 15s) while a zone is not secure.

I currently have three rules:

WHENEVER Zn1 BECOMES NOT SECURE
AND Output 208 STATE IS OFF
THEN TURN Output 208 ON FOR 15 SECS

WHENEVER Output 208 IS TURNED ON
THEN ANNOUNCE vm241

WHENEVER Ouput 208 STATE IS TURNED OFF
AND Zn1 IS NOT SECURE
THEN TURN Output 208 ON FOR 15 SECS

This sort of works, but the announcement is repeated twice when the 15 seconds elapses. I'm not at all familiar with the finer details of the M1's rule execution... any comments on why this is and how to restrict it to a single announcement.

I'm no expert but give this a try:

WHENEVER [Zn1] BECOMES NOT SECURE
THEN TURN Output 208 ON FOR 15 SECS

WHENEVER Output 208 STATE IS TURNED OFF
AND [Zn1] IS NOT SECURE
THEN ANNOUNCE vm241
THEN TURN Output 208 ON FOR 15 SECS

(and be sure to disable or delete your other rules so they don't conflict)
 
Or just another option:

WHENEVER EVERY 15 SECONDS
AND Zn1 IS NOT SECURE
THEN ANNOUNCE vm241
 
WHENEVER EVERY 15 SECONDS
AND Zn1 IS NOT SECURE
THEN ANNOUNCE vm241

No, this won't work as it would announce the message anytime zone 1 happened to open at the right 15 seconds. Say zone one is a door and he wants to make an annoucement to close the door. He only wants to make it if it's been opened for 15 seconds, not if it's been opened for 2 seconds, but the "every 15 seconds" timer happens to expire.
 
WHENEVER EVERY 15 SECONDS
AND Zn1 IS NOT SECURE
THEN ANNOUNCE vm241

No, this won't work as it would announce the message anytime zone 1 happened to open at the right 15 seconds. Say zone one is a door and he wants to make an annoucement to close the door. He only wants to make it if it's been opened for 15 seconds, not if it's been opened for 2 seconds, but the "every 15 seconds" timer happens to expire.

I think it would still work, just in a slightly different way. In the 1st 15 second cycle, the announcement would happen randomly between 1-15 seconds, because the door opening event is asynchronous to the system's 15 second timer. After the first cycle it will be in "sync" and only announce every 15 seconds. That may or may not be OK for Rob's intended use.

If you want to minimize the lines of rules (accepting the fact that the first cycle's announcement will vary), that might be a fine way to do it. If on the other hand you want to minimize the perpetually-running timers, and instead tie everything to a specific event when you can, you'd need more rules and dependent triggers.
 
Yup, it works just like Lugnut described. The first announcement is variable depending on where the clock is, but it is 15 seconds each time thereafter. They each have pros and cons depending on the exact scenario desired and resources on the controller.
 
I currently have three rules:

WHENEVER Zn1 BECOMES NOT SECURE
AND Output 208 STATE IS OFF
THEN TURN Output 208 ON FOR 15 SECS

WHENEVER Output 208 IS TURNED ON
THEN ANNOUNCE vm241

WHENEVER Ouput 208 STATE IS TURNED OFF
AND Zn1 IS NOT SECURE
THEN TURN Output 208 ON FOR 15 SECS

Anyone care to try and describe exactly what's happening with Rob's 3 sets of rules?
I'm not sure I've got it figured out.

(never mind the other question I had here before)
 
Thanks, guys (& gals?)

The 'whenever' approach will work fine for this application (the garage entry), and does have the benefit of being concise. I like being able to express the intent in a single rule rather than a co-operating pair.

I'd still appreciate any suggestions as to why I'm getting double announcements with the original set. I have a number of rules I'm wanting to set up so want to make sure I understanding the model the M1 uses.
 
I scratched my head for a while because I did not see the problem, so I put in the 3 rules exactly as illustrated and I do not get double announcements. The rules as shown only makes an announcement when the Output is turned on and the Output only gets turned on every 15 sec in the third rule. The first rule is only going to fire 1 time when the door is actually opened.

If I were a betting man, I would bet you have another rule someplace, or even the third rule duplicated someplace where you are turning Output 208 on a second time. Use the Find feature in RP and look for all occurrences of Output208 and see if you are turning it on someplace else.
 
It's interesting that you can't reproduce the problem. I've doubled checked my rules (all 9 of them...) and there are no other references to output 208.

Here are the relevant rules (4, 5 & 6) exactly as shown in case my pseudo-code messed things up:

elk_rules.jpg


Is the ordering of Elk rules in anyway significant to their execution?
 
It's interesting that you can't reproduce the problem. I've doubled checked my rules (all 9 of them...) and there are no other references to output 208.

Here are the relevant rules (4, 5 & 6) exactly as shown in case my pseudo-code messed things up:

elk_rules.jpg


Is the ordering of Elk rules in anyway significant to their execution?

Strange...I tried it in the order listed with your screen capture and I get the double announcement every 15 seconds after the initial (single) announcement from opening the door. For the double announcement, the 2nd one is right after the first one, with no delay, and both announcements are always the full message (i.e. not cut off).

But if I reverse the order of the rules (as listed/numbered in the rules window in RP), I get only a single announcement every 15 seconds (plus the initial announcement when the door is opened).

I don't get it.
 
Back
Top