Jump to content

Programming help needed


Go to solution Solved by Guy Lavoie,

Recommended Posts

Posted

I need some advice on a program.  I have uploaded two screenshot.  PGM1 is the program that exists, but doesn't work as I intended. Yes, I am using the Elk plugin. 
PGM1.thumb.jpg.e639e6bc56645e27b8d26c2c79b9a117.jpg PGM2 (note the red parenthesis) is what I wanted to do, but there doesn't seem to be any way in the eisy programming language to do it.

Could some nice person tell me how to do this.

StevePGM2.thumb.jpg.d0875bb7b86740271cac4b2ddd25118b.jpg

  • Solution
Posted

In the Program content window (top window), click on "Add And (..)" at the bottom right corner. This will add two parenthesis  lines to your program. Then move the parenthesis lines up or down to where you want them.

Posted

Also IoX has a nice provided feature to copy'n paste your programs to this website. It makes it much easier for posters to read and understand.

Right click on the program name in the tree, and select copy to clipboard in the falldown menu, then paste it into the code option box in your post.

  • Like 1
Posted

Copy and paste the program like this?

424Entered Copy Copy - [ID 0021][Parent 0001]

If
       -(
       |     'First Floor / Back Door' Logical Status is Violated
       |  Or 'First Floor / Kitchen Door' Logical Status is Violated
       |  Or 'First Floor / Front Door' Logical Status is Violated
       |  Or 'Basement / Basement Door' Logical Status is Violated
       -)
    And $Away_Off is 1
 
Then
        Send Notification to 'Email' content '424Entered'
 
Else
   - No Actions - (To add one, press 'Action')
 
Send "424 Entered" message if "Away Off" was triggered by garage keypad.

The parenthesis seems to work, too.

I wish there was some way to embed IF statements in the THEN block (like other programming languages).

Thank you for your help.

Posted
On 8/29/2025 at 8:01 PM, srjacob said:

I wish there was some way to embed IF statements in the THEN block (like other programming languages).

While not exactly a “IF” in the “then” portion, but you can run/call another program in the “then”  which contains an “IF” statement that you would want to run/evaluate. One trick is to have that other program (the second) disabled so it is only triggered by the first program to evaluate. I do this often with trigger programs for other programs that have waits in them. Since a program would re-trigger during the wait if it was in the first program and not end if it went false. 

Posted
1 hour ago, srjacob said:

I didn't know I could still run a disabled program.

Yes. That helps having the program disabled by not allowing that "IF" condition to ever be evaluated until you call on it by another program. Just make sure it's not nested in a folder that has false folder conditions - that can keep any program in that folder from running.

Often times people use the underlying program to only run "Then" or "Else" actions, but also being able to run the "If" allows that to be evaluated in case it needs to cause another action. 

The tricky thing becomes knowing that it will only evaluate when called by the first program and not ongoing. If it's something that might happen over a period of time you might need repeats or other triggers. It's a good process, but takes a little testing for fine tuning depending on the first program.

https://wiki.universal-devices.com/ISY-99i/ISY-26_INSTEON:Add_to_Program#Action

I also like being able to enable and disable programs this way. 

Posted

It would be really nice if I could write a Python (or Java) program to do the conditionals.  Any way to do this?

Regarding your comment about repeats or triggers, I use variables as flags (I am an old programmer).

 

Posted
2 hours ago, srjacob said:

Thanks.  I didn't know I could still run a disabled program.  That would simplify things.

Disabling a program only prevents it from self-triggering.  Other programs (or manually) you can instruct it to run if and it will follow through to the then or else.  Or you can directly run then then/else clause from another program.  This effectively is an embedded "if" clause.  You organize using folders and comments so that when you come back to it in a few years, you aren't trying to figure out what you did.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...