Jump to content

Problems with an Elk-ISY program


srjacob

Recommended Posts

I posted this in the program forum, but got no helpful replies.  Perhaps someone here understands what is going on.  If I can't get any help here, I will open a trouble ticket.  There doesn't seem to be any good way of tracing a program

I am running the latest ISY994 firmware and the Elk-ISY module.  I can't get this program to work.  The Elk Zone "LeftGarageDoor" is a magnetic reed switch connected to my Elk M1G zones.  It  works great.  I use the Elk as (in addition to a security system), a physical input/output connection for the Insteon lighting and ISY994.  I find that the Insteon input/output modules aren't very reliable.  Most of the time it the Elk-ISY programs work, but this is a head scratcher. LftGarageDoor is an Elk output that toggles the garage door button.  It works great.  I basically want to close the garage door when I push a "night off" button on an Insteon keypad to turn off all the lights in the house. The $GarageDoorClose is a local ISY variable that is normally set to 1.   I open the garage door.   I set $GarageDoorClose to 0 when I want the "night off" program to turn all the lights off and run (IF) this little program.   The problem here is that the garage door doesn't close, but when I run the "Then" section, the door closes just fine.

I tried reversing the two IF conditions, but it still doesn't work.

If I didn't have the $GarageDoorClose variable in there, every time the garage door would open, the reed switch would trip, the Elk would send a message to the ISY, and the garage door would stop, so that part is working.  The $GarageDoorClose  is simply a flag to let the ISY know when I want to turn off or on the close test.  I tried having $GarageDoorClose both be a state variable and an integer, but neither worked.

Using M1ToGo, I can see the "LeftGarageDoor" is violated, and when I toggle the output "LftGarageDoor", the door opens and closes fine.

Anybody have a clue as to why this doesn't automatically close the garage door?

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

Program.

If
        Elk Zone 'LeftGarageDoor' is Violated
    And $GarageDoorClose is 0
 
Then
        Set Elk Output 'LftGarageDoor' On for 5 Seconds
 
Else
   - No Actions - (To add one, press 'Action')

Link to comment
Share on other sites

17 hours ago, srjacob said:

I set $GarageDoorClose to 0 when I want the "night off" program to turn all the lights off and run (IF) this little program.

This is a simple program, so there isn't much to go wrong.  Just the basics:

  • are you positive that you've set the variable $GarageDoorClose to the desired value prior to running this program
  • has the program been saved
  • is the precision set to "0" for the variable (not sure if this would make a difference)

I'm not positive of the order in which the ISY processes things, but you might insert a short wait just after the variable $GarageDoorClose value is set before running this program.  I assume that a separate program sets the variable, then calls the "If" stanza in this program?

You might want to post the program that calls this one.

Link to comment
Share on other sites

On 5/25/2020 at 4:04 PM, srjacob said:

There doesn't seem to be any good way of tracing a program

You can trace program execution using a state variable.  Changes in the value of a state variable appear in the output of the Event Viewer.  So create a state called $sTest.  Then set its value to a particular value to let you know you got to a certain line in a particular program.  The only thing to keep in mind is that only CHANGES to a stare variable are logged.  So if you set $sTest = 1 as the first line of a program, and never set $sTest to any other value, you won't know if it ever executes that first line again.  So I don't use the value of 0 to mean anything.  Then I set $sTest to, for example, 1 and immediately set it to 0.  That way if I ever set it to 1 again, I'll know.  Keep in mind that state variables cause programs to run, so you don't ever want to use $sTest in any of your program IF statements.

Here's a high level example:

Program A

If

  Light is ON

THEN

  $sTest = 1

  $sTest = 0

  Turn light off

ELSE

  $sTest = 2

  $sTest = 0

  Turn light on

Look in the Event Viewer for [VAR X Y] where X=2 for state, and Y=the number of your sTest variable

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.


×
×
  • Create New...