Securifi Community Forum

Securifi Products => Almond+ => Topic started by: bwainscott on February 14, 2015, 11:29:52 am

Title: R70 rules are definitely cross wired
Post by: bwainscott on February 14, 2015, 11:29:52 am
I have two rules that are interacting in a strange way:

Rule 6: if front door closes, wait 180 seconds then lock door
Rule 7: ARM button on fob -> turn off light

If I press the ARM button on the fob, it turns out the light AND ALSO TRIGGERS RULE 6
If I then open and close the door, it triggers BOTH rules (turns out the light).   As long as the last key pressed on the fob was ARM, closing the door turns out the light.

If I open or close any other sensor connected door (one without any rule attached to it) nothing happens.  It LOOKS like when the door closes, the rules engine says "Hey, the fob is ARMED so I need to turn out the light also", like it is intentionally checking the fob state whenever any other rule runs?  I guess I could understand this (though I don't like it).  But I have NO idea why pressing the ARM button on the fob triggers the "close door" rule.

Here are the relevant rules from my Rules.xml file:

        <Rule ID="6" Name="3 Min -&gt; Lock Door">
                <Triggers Count="1">
                        <Trigger ID="1" TriggerType="Device" DeviceID="6" DeviceIndex="1" GroupingType="AND" Condition="eq" Validation="true">false</Trigger>
                </Triggers>
                <Results Count="1">
                        <Result ID="1" ResultType="DeviceResult" DeviceID="8" DeviceIndex="1" PreDelay="180" Validation="true">255</Result>
                </Results>
        </Rule>
        <Rule ID="7" Name="ARM -&gt; off">
                <Triggers Count="1">
                        <Trigger ID="1" TriggerType="Device" DeviceID="15" DeviceIndex="1" GroupingType="AND" Condition="eq" Validation="true">3</Trigger>
                </Triggers>
                <Results Count="1">
                        <Result ID="1" ResultType="DeviceResult" DeviceID="13" DeviceIndex="1" PreDelay="0" Validation="true">00</Result>
                </Results>
        </Rule>


and here is info from rulesEngine.log:

Press ARM button (should do rule 7):

[2015-2-14 8:17:30.657194553]    {PRINT}         Callback Received for Device 15,Index:1,Value:3
[2015-2-14 8:17:30.657514240]    {PRINT}         Msg Received for Device 15,index:1,Value:3,ruleslist size:5,bytes read:33
[2015-2-14 8:17:30.660189166]    {PRINT}         Rule 6 executing for AND condition is success
[2015-2-14 8:17:30.660374873]    {PRINT}         setting Job after 180 seconds for Rule 6 Result 1
[2015-2-14 8:17:30.660521346]    {PRINT}         rulesEngine:device and index matched,cvalue:3,Avalue:3
[2015-2-14 8:17:30.660636759]    {PRINT}         Rule 7 executing for AND condition is success
[2015-2-14 8:17:30.664278193]    {PRINT}         rulesEngine:setting Device 13 Index 1 to Value 00.
[2015-2-14 8:17:30.664479500]    {PRINT}         rulesEngine:device and index matched,cvalue:2,Avalue:3
[2015-2-14 8:17:30.664600093]    {PRINT}         All Rules Done

Door opens (should do nothing):

[2015-2-14 8:18:3.250729919]     {PRINT}         Callback Received for Device 6,Index:1,Value:true
[2015-2-14 8:18:3.251008559]     {PRINT}         Msg Received for Device 6,index:1,Value:true,ruleslist size:5,bytes read:33
[2015-2-14 8:18:3.251302733]     {PRINT}         rulesEngine:device and index matched,cvalue:false,Avalue:true
[2015-2-14 8:18:3.253412753]     {PRINT}         Rule 7 executing for AND condition is success
[2015-2-14 8:18:3.256096673]     {PRINT}         rulesEngine:setting Device 13 Index 1 to Value 00.
[2015-2-14 8:18:3.258196546]     {PRINT}         All Rules Done

Door closes (should do rule 6):

[2015-2-14 8:18:6.735915980]     {PRINT}         Callback Received for Device 6,Index:1,Value:false
[2015-2-14 8:18:6.736204446]     {PRINT}         Msg Received for Device 6,index:1,Value:false,ruleslist size:5,bytes read:33
[2015-2-14 8:18:6.736462866]     {PRINT}         rulesEngine:device and index matched,cvalue:false,Avalue:false
[2015-2-14 8:18:6.736575953]     {PRINT}         Rule 6 executing for AND condition is success
[2015-2-14 8:18:6.736703266]     {PRINT}         setting Job after 180 seconds for Rule 6 Result 1
[2015-2-14 8:18:6.738738733]     {PRINT}         Rule 7 executing for AND condition is success
[2015-2-14 8:18:6.740756466]     {PRINT}         rulesEngine:setting Device 13 Index 1 to Value 00.
[2015-2-14 8:18:6.743615393]     {PRINT}         All Rules Done


This is very frustrating -- I want to be able to use the ARM button to shut down the house for the night.  But then any time after that (until I press a different fob button), every time someone goes through the front door it turns off all the lights.

I think I can work around this for now by just always pressing the "disarm" button (which is not set to trigger any rule) after the "arm" button has done its thing.  But why the "arm" button should trigger rule 6 is a mystery.  If rules are accidentally triggering other rules then I'm glad I don't have a water shut off valve or a siren in the system...


UPDATE: seems if I have any fob button programmed to do anything, then pressing ANY fob key (even one that should not trigger a rule) triggers rule 6.  When I have time later this weekend I'll try rebooting, deleting and re-adding all rules and see if that helps.  I hope Securifi can get this working stably -- basic home automation is what I backed this device for and though things seem to keep improving, the pace is extremely disappointing
Title: Please fix this SERIOUS rules bug!
Post by: bwainscott on February 15, 2015, 09:06:16 am
Lars,

I think I know what is going on.  Every time an event happens that fires a rule, ALL the sensor states are being checked, and rules fired again.

I set up 4 rules that trigger based on sensors:

1 - If front door closes, lock door 180 seconds later
2 - If I press the "arm perimeter" button on the fob, turn on kitchen light
3 - If I open the laundry door, turn on family room light at 99%  (why is there no 100%??)
4 - If I close the laundry door, turn on family room light at 10%

With the front door closed, when I press the "arm permiter" button.  It turns on the kitchen light, but also sets the door to lock (because the front door is closed), and turns the family room light on at 10% (because the laundry room door is closed).

If I then open the laundry room door, it turns the family room light on at 99%, but also sets the door to lock and turns on the kitchen light.  When I close the laundry room door, it turns the family room light to 10%, but also sets the door to lock and turns on the kitchen light.

The behavior seems to be: when a sensor is triggered, EVERY RULE that is triggered by a sensor is checked and run if the current states of the sensors match the rule.  I believe the behavior should be: when a sensor is triggered, every rule that contains THAT sensor in the rule conditions should be checked.

This is a SERIOUS bug and makes having multiple sensor based rules completely useless.  I hope you can get this fixed right away.

UPDATE (Suggestion):  Actually, what I think would be very useful would be another level of trigger, or a distinction between triggers.  For example, suppose I have two lights near my front door.  As things stand now, I could have a rule that says:

If the door is unlocked AND light A is off, turn on light B

The point being, I don't really care if A or B is on, just as long as one of them is.   The problem with this is that both the door unlocking AND light A being off are triggers: if the door is in the state "unlocked" (say, I'm at home and just didn't lock it) and I turn A off, the rule will turn B on.  I really only want the act of unlocking of the door to trigger the rule -- light A being off is just an additional condition to the action.

So I propose/suggest a "conditional" layer between the trigger and the event.   So in this case the door unlocking is the only thing that could trigger the rule -- the action would then be conditional on the state of light A:

If the door becomes unlocked then (if light A is off, turn on light B)

Title: Re: R70 rules are definitely cross wired
Post by: Ohiomedic on February 17, 2015, 12:06:41 am
That explains while if I have lights randomly come on or off.  I thought it had something to do with sometimes I forget and turn my link bulbs of with the switch.

Example.

I have two light in the living room call them L1 and L2. I have a rule that whenever L1 turns on or off L2 does also. If I have L1 turned on and have L2 off and any sensor states changes say I turn on my porch light it turns L2 back on.