Counters / Timers

Thats the same rule I was using, and it doesnt work properly. I ended up using the phantom output method, and it works perfectly. Oh well! So when would you use a counter or a timer?
Glad to hear that this little rule is working. Now on to a try at answering the timer/counter questions above.

I come from a background in industrial automation (such as in PLCs), so I have a lot of experience in implementing timers and counters. Elk M1 rules are similar to , but not the same as in industrial automation, and in my opinion, the Elk method of rule implementation is quite quirky. That being said, still I find that I can still do almost everything I need to in this small and simple automation controller.

1. Why doesn't the counter rule work? I really dont know. One of the M1 quirks is that it has very little debugging capability. It is not possible to examine a timer in operation, and counters can be examined but only by sending a message to the keypad. If we could examine the counter value easily we could debug this. Also it would helpful to be able to examine outputs as you can with inputs. I think the STATUS screen should display the status of outputs, timer values, and counter values, as well as the input status.

2. The ELK timers, as far as I can tell, as always implemented in conjunction with an output. Although there is a setting in the Custom Settings for "timers", "Counters", and "Time of day", I dont know how you would use the "timer" setting. Timers are always used like this: THEN TURN OUTPUT 100 ON FOR 20 SECONDS.

3. Counters can be used to .....well.....count things. One advantage counters have over other M1 variables, is that the value can be sent to the M1 keypad in a "text". For example, lets say the kids are allowed to open the back door 5 times before you get mad. So a counter can be used to count the number of times the door opens and a text is then sent to the keypad every time. Now if you want to check to see how mad you are suppose to be, check the keypad. Perhaps on the sixth time, the M1 girl can make an announcement that the limit has been exceeded, and that you are hopping mad.

Just for understanding purposes.....The failed rule you posted is using a counter as a timer, rather than just using a timer. As I said, I dont know why it doesnt work. the only thing I could suggest is to change this
WHENEVER GARAGE DOOR [COUNTER1] CHANGES TO 0
to this
WHENEVER GARAGE DOOR [COUNTER1] CHANGES TO LESS THAN 1
Perhaps the value is going negative before it is seen as exactly 0.

Have fun and keep trying.
 
Why don't you just use Force Armable on the garage zones? Then you can arm the alarm and it will bypass the garage zone until it becomes secure. Then you can take your time putting the kid in the car seat and getting out of the garage.

I did this, but I also have a rule that alerts me if the garage is open for more than a few minutes. It's only checking on 5 minute intervals though, so If you open the door at 2:04, it will tell you it's open when the clock rolls over to 2:05. I also made it so if the motion sensor is triggered, it won't alarm for 5 minutes. So if I'm out in the garage working on something with the door open, it doesn't drive my wife nuts. I could easily fix this so it would start the timing from when the door was actually opened, but I've been lazy.



Code:
WHENEVER Garage Motion (Zn 161) BECOMES NOT SECURE
  Then turn output 203 on for 5 minutes

Whenever every 1 seconds
 and Door1 is secure
 and door2 is secure
   Then turn output 205 off

Whenever Door1 becomes not secure
 then turn output 205 on
Whenever Door2 becomes not secure
 then turn output 205 on

Whenever every 5 minutes
 and output 205 state is on
 and output 203 state is off
   then announce Misc5 (Garage door is open)
 
Back
Top