I’m slowly starting to go insane… but i’m sure it’s me and not the PLEG system because i love it!
I have 2 kfob scene controllers programmed to active scene 1 (arm) when button 1 is pressen and scene 2 (disarm) when button 2 is pressed.
Arming and disarming the alarm with just 1 Kfob is easy, but when it want to bring the second kfob in place things get messy.
I constantly end up with a state where scene 1 active is TRUE on kfob 1, and Scene 2 is True on kfob 2.
This puts my arm/disarm conditions in a loop…
How should i configure the triggers and conditions to make this work??
Triggers:
t1 = Kfob1 button 1 pushed is scene 1 activated
t2 = Kfob1 button 2 pushed is scene 2 activated
t3 = Kfob2 button 1 pushed is scene 1 activated
t4 = Kfob2 button 2 pushed is scene 2 activated
Device properties:
p1 = 0/1 (check motion sensor armed status… 0 is bypass 1 is armed)
Conditions:
c1_arm = (t1 OR t3) AND (p1 eq “0”)
c2_disarm = (t3 Or t4) AND (p1 eq “1”)
Actions:
c1_arm = Arm motion sensor
c1_disarm = disarm motion sensor
My situation is the same, just using smartphones detected on my Wifi, using Ping Sensor.
It looks like what you are doing should be straight forward but…
I’m assuming the kfobs are state based, not momentary.
I don’t get eh Scene 1 & 2 differences? Are these your Arm & Disarm ‘scenes’?
If yes, this is your answer (looked like you had faulty conditions, you never used t2?)…
Assuming: t1 & t3 ARM , t2 & t4 DISARM
your conditions would be…
c1_arm = (t1 or t3) and (p1 eq “1”)
c1_disarm = (t2 or t4) and (p1 eq “0”)
I think you need to use sequence expressions to prevent looping:
Conditions armed p1 eq “1” c1_arm !armed and ((t1 and (!armed; t1)) or (t3 and (!armed; t3))) c2_disarm armed and ((t2 and (armed; t2)) or (t4 and (armed; t4)))
[quote=“RexBeckett, post:3, topic:180610”]I think you need to use sequence expressions to prevent looping:
Conditions armed p1 eq “1” c1_arm !armed and ((t1 and (!armed; t1)) or (t3 and (!armed; t3))) c2_disarm armed and ((t2 and (armed; t2)) or (t4 and (armed; t4)))[/quote]
Does he really need a seq if the keyfob buttons can only enable 1 state at a time (like radio buttons)?
My kfobs are state based so they keep their last pressed button/scene state.
I managed to resolve my issue in the mean time using a completely different approach.
I now compare “LastSceneTime” to identify which scene on which kfob was activated last…
This is then used to perform the needed action… arm/disarm etc…
Triggers
Name Description
T_003_Door Voordeur armed is tripped
T_004_Motion 004_Motion armed is tripped
T_Nous_b1 Kfob_Nous: scene number 1 is activated
T_Nous_b2 Kfob_Nous: scene number 2 is activated
T_Nous_b3 Kfob_Nous: scene number 3 is activated
T_Roel_b1 Kfob_Roel: scene number 1 is activated
T_Roel_b2 Kfob_Roel: scene number 2 is activated
T_Roel_b3 Kfob_Roel: scene number 3 is activated
Device Properties
Name Device Name Device Variable
P_003_Door 004_Motion Armed
P_004_Motion 004_Motion Armed
P_Nous_TS Kfob_Nous LastSceneTime
P_Roel_TS Kfob_Roel LastSceneTime
Conditions
Name Repeat Expression
c1_arm_away No (T_Nous_b1 AND (P_Nous_TS > P_Roel_TS)) OR (T_Roel_b1 AND (P_Roel_TS > P_Nous_TS))
c2_disarm No (T_Nous_b2 AND (P_Nous_TS > P_Roel_TS)) OR (T_Roel_b2 AND (P_Roel_TS > P_Nous_TS))
c3_arm_home No (T_Nous_b3 AND (P_Nous_TS > P_Roel_TS)) OR (T_Roel_b3 AND (P_Roel_TS > P_Nous_TS))
c4_Alarm_trip No T_004_Motion
I still don’t understand how the keyfobs work… are they 1 or 2 buttons? how do they send info to the Vera, etc?
what you built may work but seems like overkill. You could simply create a VirtualDevice (vDevice) that tracks ARM/DISARM state of the Alarm. Then set the vDevice on keyfob press. The Conditions uses the vDevice state and runs proper commands based on the state.
I use button 1 to arm my alarm (kfob sends scene id 1 to vera, and has been defined as input trigger in pleg)
I use button 2 to disarm my alarm (kfob sends scene id 2 to vera, and has been defined as input trigger in pleb)
Both kfob behave the same sending the same scene id’s whenever button 1 or 2 is pressed.
I suspect that all the keyfob does is send a trigger, which is normal for most remotes… thus you can make that trigger whatever you want.
So, all you really need is a simple state logic. Easiest way I found is to use a MultiSwitch to store states - thus also acts as a Security Panel that you can manually control and see on any device. Have the keyfobs directly turn the MultiSwtich buttons on/off - then simply create a PLEG device that watches the MultiSwitch states and triggers Scenes based on the states. Easy Peasy.