What am I doing wrong?

I’m trying to fire a scene when a valid user code is entered on my front door lock AND when the alarm system is in the armed state. I created a trigger that is “when valid user code #1 is entered on the lock”, and a device property for the alarm that says when the Armed State is Disarmed. Then a condition that says:

(t1) AND (NOT p1)

But it doesn’t fire. Here’s a log:

06	12/02/13 22:48:16.907	Device_Variable::m_szValue_set device: 137 service: urn:rts-services-com:serviceId:ProgramLogicC variable: ObjectStatusMap was: {{name = 'c1', state = false, seq = 1385954898.8061},{name = 't1', state = true, seq = 1385955452.2963},{name = 'p1', state = 'Armed', seq = 1386046015.3176},} now: {{name = 'c1', state = false, seq = 1385954898.8061},{name = 't1', state = true, seq = 1386046096.9044},{name = 'p1', state = 'Armed', seq = 1386046015.3176},} #hooks: 0 upnp: 0 v:0xb84fc0/NONE duplicate:0 <0x2b8a1680>

Shouldn’t my logic work? Or am I formatting things incorrectly?

p1 is a device property with a text value so you cannot test it as a boolean state. Try:

ConditionName (t1) AND (p1 ne “Armed”)

[quote=“RexBeckett, post:2, topic:178062”]p1 is a device property with a text value so you cannot test it as a boolean state. Try:

ConditionName (t1) AND (p1 ne “Armed”)[/quote]

Sweet! That worked. I thought the value shown in the settings menu was what I was testing for, not what it currently is. Thanks!

Ok, well, it sorta worked. The logic basically says if a valid pin is entered and the alarm is NOT disarmed (it’s in one of the arm states), then run an Elk task that is setup to disarm the alarm. I tested it a few hours ago, it worked.

Now, I just tried to arm the alarm when going to bed, and it immediately disarmed itself. I tried 3 times. Looking at the logs, PLEG is matching the conditions and disarming it immediately, even though the last valid PIN was entered a few hours ago. It’s showing t1 as “true” in the Status.

Is there a way around this? Is there a way to get the status of t1 to reset a couple of seconds after I enter a valid user code?

I had the same issue with it disarming the alarm. I haven’t had time to mess with it but would be interested in the solution

What kind of trigger is T1 ? Sounds like it is one that rarely goes false.

You may need something like:

PulseT1 = t1 and (p1;t1)

PulseT1 is ONLY true when T1 actually triggers.

Then change your condition to:
(PulseT1) AND (p1 ne “Armed”)

Please show a REPORT in the future instead of parts of your log file … Unless the log file has an error!
THe REPORT provides more context for what you are doing.

Here’s the status report. What does the “;” do in your example above? I tried adding t3, it worked the first time, but stays “true”.

Disarm Area 1 on Valid Lock Code

Triggers

Name Description Last Trigger State
t1 PIN Code #1 is entered on Front Door Lock 2013-12-03 17:55:40.696 true
t2 PIN Code #2 is entered on Front Door Lock 0 false
t3 Front Door Lock is opened 2013-12-04 07:43:57.956 true
Device Properties

Name Device Name Device Variable Last Change Value
p1 Partition 1: Area 1 ArmMode 2013-12-04 09:57:15.110 Disarmed
Conditions

Name Expression Last True State
c1 ((t1 OR t2) AND (t3)) AND (p1 ne “Disarmed”) 2013-12-04 09:57:14.894 false
Actions

Actions for Condition: c1

Immediate

Device Action Arguments
Elk Task 1: Disarm SetTarget newTargetValue=1

You need to read up on the Sequence expression. This is used to handle temporal relationships of events.

This is all to work around the fact that the LOCKS really mean:
PIN CodeN was the last code entered on XX.

This stays that way until a different code is entered.
So we use things like:

PulseT1 T1 and (P1; T1)
PulseT2 T2 and (P1; T2)
PulseT3 T3 and (P1; T3)

So if the alarm changes all PulesTN will be set to false. Also if any new code is set
the correct one will cause only PulseTN to be true.

Then use PulseTN (1, 2,3) in your logic.

signal15 May I ask what your ELK task is? How did you do it? I’m trying to do the same here.

Many thanks!

I created an Elk task that disarms the alarm. The reason I did this is that the ELK plugin requires you to enter in a PIN every time LUUP is restarted if you want to disarm through the built in stuff in the plugin. If you create a task on the ELK to disarm, you can just call the task from the ELK plugin and it will disarm w/o the PIN code.

Yes, I know it’s not as secure. I’ve got my Vera on it’s own DMZ/Security zone, no ports are open to the internet, etc… Yes, I know it’s still a risk, but the risk is low.