srjacob Posted Friday at 06:08 PM Posted Friday at 06:08 PM 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. 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. Steve Quote
Solution Guy Lavoie Posted Friday at 06:31 PM Solution Posted Friday at 06:31 PM 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. Quote
larryllix Posted Friday at 08:46 PM Posted Friday at 08:46 PM 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. 1 Quote
srjacob Posted Saturday at 12:01 AM Author Posted Saturday at 12:01 AM 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. 1 Quote
Geddy Posted 18 hours ago Posted 18 hours ago 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. Quote
srjacob Posted 17 hours ago Author Posted 17 hours ago Thanks. I didn't know I could still run a disabled program. That would simplify things. Quote
Geddy Posted 16 hours ago Posted 16 hours ago 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. Quote
srjacob Posted 15 hours ago Author Posted 15 hours ago 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). 1 Quote
apostolakisl Posted 15 hours ago Posted 15 hours ago 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. Quote
srjacob Posted 15 hours ago Author Posted 15 hours ago Is there a way to comment each line of a program? That would be really nice. Quote
Guy Lavoie Posted 15 hours ago Posted 15 hours ago 15 minutes ago, srjacob said: Is there a way to comment each line of a program? That would be really nice. I've wished for that too. Quote
apostolakisl Posted 15 hours ago Posted 15 hours ago 15 minutes ago, srjacob said: Is there a way to comment each line of a program? That would be really nice. You can add as many comments as you want. They show up as blocks in between each line of code. Quote
larryllix Posted 7 hours ago Posted 7 hours ago 7 hours ago, srjacob said: Is there a way to comment each line of a program? That would be really nice. You can comment lines between lines and also comment the whole program. These are found in different portions of the edit boxes. Quote
larryllix Posted 7 hours ago Posted 7 hours ago 8 hours ago, srjacob said: 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). I use STATE variables to trigger almost all lighting scenes, also. When I want to "borrow" a lighting setup (eg: flash lights) I only need to save the existing value, replace with another value, and then after a delay replace the original value back into the control variable. Also, with mostly WiFi lighting, with no available feedback, I always know what the last lighting scene I left things at is. Using STATE variables for lighting controls makes things so easy to program, from multiple sources, once the bank of drivers is created and tucked away in a folder. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.