Jump to content

Disabled program Run (If) by another program does not revaulate if conditions change while it is in Running Then State


hart2hart

Recommended Posts

Posted (edited)

I've got a series of programs that monitor for the garage doors to open.  Once they open ISY runs a program to see if you are within 10 minutes of the start of exit delay (aka leaving home).  Then it checks to see if the security is system is armed either Away or Stay.  The variables that indicate Stay or away or set to 0 indicating not armed within seconds of event (by DSCLink) happening but I am getting text indicating someone may have forced their way into the garage and are awaiting someone to return home.  Per screen captures of the actual event in progress what am I missing? This happens frequently so I ran inside after arriving home  and captured these images while all was in progress and sure enough after 10 minutes I received text saying "possible intruder".  Obviously, I'm doing something very wrong (and am completely blind to it)  or ISY is not seeing the State variable (in this case Armed Away) change from 1 to 0. 

 

 

Capture of program that determines if you are exiting are possibly have an intruder

 

post-583-0-18555500-1419120606_thumb.jpg

 

Program it runs as part of else to see if system is armed and gives me 10 minutes to get into house (program Disabled so only run as request by other program)

 

post-583-0-56497100-1419120595_thumb.jpg

 

Evidence that program is running the Then clause

 

post-583-0-51975200-1419120584_thumb.jpg

 

Even though both armed away and armed stay have been set to 0

 

post-583-0-16108200-1419120576_thumb.jpg

Edited by hart2hart
Posted

What changes the value of the variable(s)?

Posted (edited)

Program looks fine. With the 10min wait the program should recheck the two variables before sending the email.

Only thing I would recommend is logging the DSCLink sends to the ISY to make sure it's not doing extra variable toggles (doesn't appear to be based on your screen captures)

Edited by io_guy
Posted

Hello hart2hart,

 

The main question is whether or not the variables are being changed or the programs are being executed some other way.

 

I would slightly change your program:

Control x is Switched on

Or Control y is Switched on

 

This program is evaluated every time so, in case x is switched off and then y is switched off within 10 seconds, then the program will stop in the Wait.

 

You might want to consider:

If

( Control X is Switched On

And Control X is not Switched Off)

Or

( Control Y is Switched On

And Control Y is not Switched Off)

Then

...

 

With kind regards,

Michel

Posted (edited)

Resolved

 

Thanks to Steve Lee for reminding me to test in smaller segments.  There is nothing wrong with structure or logic of the programs.  It is more fundamental to the fact that the program at issue is disabled.

 

For anyone else that attempts, hopefully following describes:

 

A program Runs If a disabled program  and the Then branch of disabled program is evaluated true based on a variable (State1) value.  You can see the disabled program  "Running Then" since it has a wait 10 minute command in the then branch. Now one can change the value of the variable (State1) so that the Then branch is no longer true but ISY does not re-evaluate and hence does not stop the program.  I changed variable (State1) via REST and just by simply updating variable in Admin console with same results.

 

This behavior was not what I originally expected given that disabled program was "Running Then" but because program was disabled I understand why it would not be in ISY data structure containing programs being constantly (re-)evaluated.

 

I accomplished required using:

 

 

 

'Garage:Garage Doors Opened So Check for Intruder'

 

If
        Control 'Garage / Garage:Double Door is Closed' is switched Off
     Or Control 'Garage / Garage:Single Door is Closed' is switched Off
 
Then
        Run Program 'Garage:Garage Doors Opened Are We Leaving with Exit Delay' (If)
        Wait  10 minutes
        Run Program 'Garage:Garage Doors Opened Have We Arrived Home' (If)
        Wait  15 seconds
        Send Notification to 'JPaulText' content 'Garage Possible Intruder'
 
Else
   - No Actions - (To add one, press 'Action')

 

 

----------------------

 

'Garage:Garage Doors Opened Are We Leaving with Exit Delay'  (Disabled Program)

 

If
        $SecSys_Exit_Delay is 1   (variable set direct by DSCLink via REST from DSC Alarm Panel)
 

Then
        Stop program 'Garage:Garage Doors Opened So Check for Intruder'
 
Else
   - No Actions - (To add one, press 'Action')

 

 

------------------------------------

 

'Garage:Garage Doors Opened Have We Arrived Home' (Disabled Program)

 

If
        $SecSys_Armed is 0 ($SecSys_Armed_Away & $SecSys_Armed_Stay  from DSCLink via REST were combined into one variable through simple program already in use)
 

Then
        Stop program 'Garage:Garage Doors Opened So Check for Intruder'
 
Else
   - No Actions - (To add one, press 'Action')
 

 

 

There may be a simpler and more straight forward method to accomplish but today it works.  I'm blind for now will consider refactoring later.

Edited by hart2hart
Guest
This topic is now closed to further replies.

  • Recently Browsing

    • No registered users viewing this page.
  • Who's Online (See full list)

    • There are no registered users currently online
  • Forum Statistics

    • Total Topics
      37.2k
    • Total Posts
      372.5k
×
×
  • Create New...