Everything posted by SMonk
-
Nested If's?
Wow - Guy - thanks for all of this. This is really expanding my horizons about what I might be able to do and potentially simplify some of the things I have already done. Truly appreciated!!! Now.....about world peace.......
-
Nested If's?
Well now you have piqued my interest even more. So if I create a program (NOT Disabled) with an 'IF" statement that simply looks at a state variable (e.g. in my case the "Poll_Running" integer variable) - so for example "If Poll_Running = 1" - does that mean that this program will run whenever that variable gets set to 1 without specifically being called by another program? If so - does that not mean that the "else" portion of that program would be "true" almost all the time (except when Poll_Running = 1") and hence would be constantly "running"? I must be missing something here..... If so - that blows my mind - I had assumed that programs were only triggered either by looking at insteon device state or control statements when someone manually operates a switch OR when called by another program. Is this not the case - and that programs with a simple variable in the IF will be automatically triggered if that variable changes to the required value? I also remember someone telling me that programs that have Control/State "if" tests of insteon devices are only triggered by manual changes to a device and NOT by changes initiated by a program - so that would then kinda be in conflict with the above would it not? Or perhaps I just have made a leap of logic to somewhere that does not exist LOL.... Please elaborate. This is extremely interesting......
-
Nested If's?
No all you have to do is tell me how to make program calls in a synchronous manner (so that my parent program waits for the called programs to finish before executing the next command) rather than executing them all (basically) simultaneously and then moving on immediately LOL. If you can do that - I'm thinking you may also have a solution for world peace?
-
Nested If's?
That is very interesting - so if you mark a program as disabled you can still call it? I was not aware of THAT - I thought if it was disabled - then it is disabled. Thate introduces some quite interesting concepts for me. Just to clarify - setting to disabled then really only means "do not react automatically to status or control changes within the insteon network" (for example if I use a Status or a Control element in the "if" for a device - if that device is manually turned on or off - the program will not fire), however it WILL run if I call it from another program? Very interesting - please confirm that my understanding of that is correct.
-
Nested If's?
Yes - this is the approach I decide to try out. It does work - but it's just a lot of programs (as I need to do this for many rooms (one program per room, and one line of the if statement for each device in a room) - hence looking to try and reduce number of programs by finding some potential alternative. This is very interesting - I have never used the "Repeat While" function - I will investigate that. This "could" be the solution to reducing the number of programs significantly. I'll let you know how it goes.
-
Nested If's?
I originally thought about this (the Poll_Running variable is already an integer - set by a prior program). Unfortunately if I add th ePoll_Running variabel to the if clause - then when this runs if Poll_Running is "not" 1 - then it will default to the "else" clause when triggered - which I do not want it to do.
-
Nested If's?
Hi - trying to find out if there is a way to do a nested "if". In other words - I need the "if" to be inside the "Then" and the "Else" (I need to do this for a variable test as part of a program that tests status of several devices). I cannot add this test as part of the first "if" because then the "else" will fire and run those commands - though I need the same "if" within the else. Basically the code would be: IF status Device_X is off AND status Device_Y is off AND status Device_Z is off Then if variable Poll_Running =1 Then do something Else if variable Poll_Running =1 then do something different Bottom line - if the Poll_Running variable is not 1 - then I don't want anything to happen irrespective of the state of the devices. Any thoughts?
-
All Off Keypadlinc with notice
I discovered the reason. I needed to introduce a delay into the process before attempting to turn off the LED. If looks like the program was performing the command to turn off the LED - but it looks like the system had not "settled" down to all the activities that were happening. The button controlled (turned off via a scene) 90 insteon devices - as a result this took a little time to complete. I added a 10 second delay just prior to setting the LED scene to off - and this works pretty reliably. 5 seconds and it never worked. Thought I should let everyone know.
-
Synchronous or Asynchronous?
EISY IoX Firmware: 6.0.5 Due to a requirement to handle a lot of devices I have created a number of programs that look at various "groups" of devices (basically rooms, areas and floors) to determine their status prior to then executing other programs. I wanted to try to create this is a modular fashion so as to minimize the amount of code created and to make maintenance easier (define the code once - call it from multiple sources). In some cases some of the programs call several of these programs in sequence. This gets to the root of this question - and I think I know the answer - but I wanted to confirm. Does the EISY execute program commands in a Synchronous or Asynchronous way? I think I have discovered that it is Asynchronous (basically when calling several programs - it calls the next program immediately without waiting for the first program to finish). Can this be confirmed? If it is indeed Asynchronous - is there an approach that can be used to create (basically) modular subroutines (other programs) that will make the calling program wait until its execution has finished?
-
Non-Toggle[Off] - Flashes?
Hi, KeyPadLinc secondary button (Master Off) set up as Non-Toggle[Off] (so it only sends off to any responders in a scene where it is the controller). Works perfectly. I noticed that when I click the button it flashes twice - I am guessing that this is just to let you know it did something. I created a program that turns the "Master Off" keypadlinc LED "On" when a user clicks any of the other switches that this "Master Off" controls - works perfectly. Here is what I have found that is weird (took me literally HOURS of trying to work this out due to the debugging I put in the program). I created another program that will turn this LED light off when the "Master Off" is clicked - but what I found is that unless I program a 5 second delay into the program just before the command to turn off the "Master Off" LED - the LED will stay lit....If I program a 5 second delay you can see the button doing its own "flashing" thing - then a couple of seconds later the LED will dim. If its anything less than 5 seconds - the LED will flash away - but will then stay lit.... If the delay is less than the 5 secs - then the program is definitely triggered (I created some variables to debug and capture what the program was going) - its just that the LED "off" command seems to be sent before the "flashing" process concludes - and for some reason the LED stays on. Has anyone encountered this - and have any insights why this might be happening? I suppose I can live with the delay at the Master Off when I click it - it just is a little weird...... Thoughts/pointers/ideas? Has anyone set up a Non-Toggle[Off] - "Master Off" like this (that becomes lit when any of its "children" are On and Off when not, and will also turn off when you push it)?
-
Start Linking- cannot exit?
No button in the console worked - in the end I pulled the plug and had it reboot…. That did work 😁
-
Start Linking- cannot exit?
Hi - II accidentally clicked start linking - there was no "cancel" and the "x" in the top right of the window did not work - so I ended up just closing the browser. No each time I open - it basically reopens some window that says "linking" Any one any idea: a. What it is doing b. how to stop it? Thanks!
-
All Off Keypadlinc with notice
noticed an error in the program - here is the corrected version (still does not work :-) ). Note that I also cleared the log and then clicked that keypad linc button - and - nothing in the log at all - completely empty (as it happens the admin console generates errors when the log is empty ). But - it is empty. So does that mean that when a keypadlinc button is set up like this and someone presses it that the EISY does not get any kind of notification? MainLevelAllOffLEDReset - [ID 0025][Parent 0022] If 'MainLevel / Kitchen Area / Entry / KitEntPad3_5_MainAllOff' Status is Off Or 'MainLevel / Kitchen Area / Entry / KitEntPad3_5_MainAllOff' is switched Off Then Set 'MainLevel / Kitchen Area / Entry / Scenes / MainLevelOffLEDControl' Off Else - No Actions - (To add one, press 'Action')
-
All Off Keypadlinc with notice
Hello all, Me again. I am now trying to set up a keypad linc button to only send an "off" signal - that part has been done and is working great. (set keypad linc secondary button toggle mode to "Non-Toggle [Off]" - add to a scene as a controller and then the other items I want to turn off added as responders). All good works like a charm. Now we get to the tricky bit. The keypadlinc pad is by the door and I want it to "light" if any of the responders are switched on by a person. Ok - I also got that to work by writing a program the monitors for each of the "responders" to get switched - and if so then it sets the keypadlinc button to "On" (created a scene where the keypad linc button is a responder and program turns on the scene). This also works fine - and whenever I turn something on - the keypadlinc secondary button lights up - all good so far. Here is the issue - when I click the keypad linc button - it turns everything off still as it should - but the keypad linc button stays lit (which I thought it would anyway due it no longer being defined as a toggle switch). So I thought the way around this would be to write a program to capture when the keypad linc button is pressed - and then just set its own LED to "off" (I used a scene for this where the keypad linc button is simply a responder - so I set the scene to off). However, this program simply will not "fire" - or its not working (I have the If statement checking if the keypadlinc button is switched off OR if the status is off. Anyone any idea on how I can what I thought would be a simple process to work to turn off the LED when I click the keypadlinc button? Here is the program watching for the keypadlinc button press: MainLevelAllOffLEDReset - [ID 0025][Parent 0022] If 'MainLevel / Kitchen Area / Entry / KitEntPad3_5_MainAllOff' Status is Off Or 'MainLevel / Kitchen Area / Entry / KitEntPad3_3_InAllOff' is switched Off Then Set 'MainLevel / Kitchen Area / Entry / Scenes / MainLevelOffLEDControl' Off Else - No Actions - (To add one, press 'Action')
-
One KeyPadLinc Button to Rule Them All?
Wow - very interesting (and I must admin a little over my head - never looked at logs - so not sure exactly what everything means in there). Just a huge THANK YOU to all who commented and responded. It is TRULY appreciated!
-
One KeyPadLinc Button to Rule Them All?
Hi all, Thanks for the input and feedback - it is truly appreciated. My programs are working and running very well - but intrigued by the thought of eliminating the first program (i.e. the one that uses the "control" checks) - and just relying on the status aspect (basically my program 2). The things I had read were that the "status" aspect can be less reliable than the "control" side of the house - hence went with program 1 (to be initiated on any physical change at any switch) - which would always then be "true" - thereby calling program 2 which tests the actual status to then set or not the master LED. Wonder if there is a way to determine if one is more reliable than the other (control vs status). Thanks for feedback!!
-
One KeyPadLinc Button to Rule Them All?
Hello Everyone - as promised I wanted to share the code I wrote so you could see if any better way to approach (a few other posts helped on this too). Situation: 3 banks of lights in basement Rec Room - each bank is defined as its own two way circuit: Near Bank: KeypadLinc (uses main button for Rec Room Bank) + I3 Paddle (load on I3 Paddle) Mid Bank: 2477S + I3 Paddle (load on I3 Paddle) Far Bank: 2477S + I3 Paddle (load on I3 Paddle) Each pair is defined to a scene where each is a controller - works fine. Top of Basement Stairs: KeyPad Linc - button "C" to control each of the three banks (either on or off). One scene defined where the Top of Stairs button is defined as the Controller - and each of the devices in the rec room are defined as responders (to push an all on/all off command). Additional Scene (Bsmt_StairTop_RecLED) where KeyPad Linc Button is a responder only. To handle the occasion when the top of stairs button is not use - but individuals turn on or off buttons in the basement rec room - need to keep the top of stairs keypad linc master button "C" in sync (shows lit or not) - I have created three programs as follows: Program 1 (just waiting for any physical action on any of the basement rec room devices): 1_WatchRecRmDeviceChanges If 'Basement / RecRm / Devices / Rec_ByPat_Far I3' is switched On Or 'Basement / RecRm / Devices / Rec_ByPat_Far I3' is not switched On Or 'Basement / RecRm / Devices / Rec_ByPat_Mid I3' is switched On Or 'Basement / RecRm / Devices / Rec_ByPat_Mid I3' is not switched On Or 'Basement / RecRm / Devices / Rec_ByPat_Near I3' is switched On Or 'Basement / RecRm / Devices / Rec_ByPat_Near I3' is not switched On Or 'Basement / RecRm / Devices / Rec_ByStr_Far' is switched On Or 'Basement / RecRm / Devices / Rec_ByStr_Far' is not switched On Or 'Basement / RecRm / Devices / Rec_ByStr_Mid' is switched On Or 'Basement / RecRm / Devices / Rec_ByStr_Mid' is not switched On Or 'Basement / RecRm / Devices / Rec_ByStrPad1_Near' is switched On Or 'Basement / RecRm / Devices / Rec_ByStrPad1_Near' is not switched On Then Wait 2 seconds Run Program '2_MasterRecRmStairTopLEDStateCheck' (If) Else - No Actions - (To add one, press 'Action') Program 2 (if any basement device is not off - then turn on stair top master LED - and vice versa): 2_MasterRecRmStairTopLEDStateCheck - [ID 0006][Parent 0007] If 'Basement / RecRm / Devices / Rec_ByPat_Far I3' Status is not Off Or 'Basement / RecRm / Devices / Rec_ByPat_Mid I3' Status is not Off Or 'Basement / RecRm / Devices / Rec_ByPat_Near I3' Status is not Off Or 'Basement / RecRm / Devices / Rec_ByStr_Far' Status is not Off Or 'Basement / RecRm / Devices / Rec_ByStr_Mid' Status is not Off Or 'Basement / RecRm / Devices / Rec_ByStrPad1_Near' Status is not Off Then Set 'Basement / Stairs / Scenes / Bsmt_StairTop_RecLED' On Else Set 'Basement / Stairs / Scenes / Bsmt_StairTop_RecLED' Off Program 3 (status poll - recursive program - just in case something gets missed in above programs): 3_RecRmLightStatePoll - [ID 0009][Parent 0007][Run At Startup] If 'Basement / RecRm / Devices / Rec_ByPat_Far I3' Status is not Off Or 'Basement / RecRm / Devices / Rec_ByPat_Mid I3' Status is not Off Or 'Basement / RecRm / Devices / Rec_ByPat_Near I3' Status is not Off Or 'Basement / RecRm / Devices / Rec_ByStrPad1_Near' Status is not Off Or 'Basement / RecRm / Devices / Rec_ByStr_Mid' Status is not Off Or 'Basement / RecRm / Devices / Rec_ByStr_Far' Status is not Off Then Set 'Basement / Stairs / Scenes / Bsmt_StairTop_RecLED' On Wait 5 minutes Run Program '3_RecRmLightStatePoll' (If) Else Set 'Basement / Stairs / Scenes / Bsmt_StairTop_RecLED' Off Wait 5 minutes Run Program '3_RecRmLightStatePoll' (If) Please feel free to comment, correct, suggest improvements - always open to anything to make as efficient and resilient as possible.
-
Progs - Simple way to initiate on any state change?
Ah yes - I have a similar monarchy at my house. Appears I am at the bottom of the totem pole - and that includes the dog…..
-
One KeyPadLinc Button to Rule Them All?
Ok - cool thanks. Maintenance is a given of course - though at this time do not anticipate adding anything else to the scenes (famous last words eh?)....... Thanks - on some tests I did I also noticed a delay - so will take that into account. Cheers!
-
Progs - Simple way to initiate on any state change?
Ok - perfect - that is much simpler. Will incorporate this knowledge. I could potentially then also incorporate tests about "state" - thanks all. Interesting on the using the switches to dim the lights - are we not supposed to do that? I do it all the time in one of our rooms - curious about what the alternative might be?
-
Programs - Control vs State?
Ok - cool - thanks - so the programs for a "switch" will trigger whenever that switch is tapped irrespective of whether the program "IF" uses the "control" check whether it uses the "status" check - interesting - was not aware of that. Thank you - that helps - and also good to know. Thanks! Regarding posting the programs - yup planning on doing that when I gain the right level of knowledge to construct it/them appropriately (and will post the text - not a screen shot LOL). Cheers!
-
Removal of links when adding device to new scene
Ok - got it - thanks @IndyMike !
-
Programs - Control vs State?
Hi - just looking for insight on more programming tips. When creating if statements - one has the option of using "Control" or "State". I just want to clarify the difference to see if my understanding is correct. Control: An if statement that uses "Control" means that the program is triggered automatically by the EISY if the appropriate action has been taken from the control. For example, if the program (Program A) has "If x-control is switched on" - this will automatically fire the "Then" statements - so if someone turns on that switch - this program will automatically be initiated by the EISY. Conversely if the program contained "if x-control is switched off" then if someone turns off the control then the "then" part of the program would be initiated y the EISY. Finally - if the if contained "if x-control is switched on OR if x-control is switched off" then the EISY would initiate the "then" part of the program with the control is switched on or off. Follow up to this - if the x-control is turned on via another program - would this also trigger "Program A" as defined above - in other words - it does not matter whether the switch is physically or logically turned "on" - the EISY would initiate "Program A"? Status: This simply allows you to check the status of a control from within a program - but is not automatically initiated by the EISY if something physically happens at that control (or if the control status is changed by a program). Can someone confirm that this is the case? Or am I missing something?
-
One KeyPadLinc Button to Rule Them All?
Hello All (long post - sorry), In a bit of a quandary related to the best way to approach a process - so looking for advice. I will describe below the situation - and then what I "think" is the best way to do this (then ask for guidance related to the specifics). Situation: I have a Rec Room in my basement that has three banks of lights. Each bank of lights is controlled independently from both sides of the large room (so each bank is set up as a two way). In this case I have an I3 Paddle connected to each "load" and then on the far side of the room there is a 2477S for each circuit. Each I3 Paddle and 2477S is set up in a scene to act as the two way - with both objects as controllers. Works perfectly fine. At the top of the basement stairs I have installed a 6 button keypad linc - and one of the buttons on this keypadlinc I want to use to either turn on or off all three banks of lights (so one keypad linc button to rule them all). I can (and have) created a scene where the keypad linc button is the controller - and each of the other objects are responders (lets call this the "Ruling Scene") - so when I use the button at the top of the stairs this has an immediate response from everything else (either quickly on or quickly off). This issue is when someone turns one of the banks of lights on or off directly from the I3 Paddles or 2477S switches - I need the keypad linc button to stay "in-sync" with the status of the lights in the basement. Basically if anything is on - or partially on as the lights are dimmable - then the keypad linc button should be either turned on/lit or should stay on (if it was already lit), and vice versa - if someone in the basement turns off the last light from either a 2477S or a I3 paddle then the keypad linc button light should get extinguished. I thought that the best way would be as follows: Create a scene with the keypad linc button as a responder (to use in a program) - lets call this the "Master LED" Scene (using a scene as not sure about the effectiveness of directly addressing a keypad linc button in a program). Create a program that is initiated when ANY action is performed on ANY of the switches in the basement (any of the I3 paddles or 2477S switches) - this ties in to a previous post I made about trying to find any easy way to determine if any action has been performed on a switch) - in this program if anything has "happened" then check the state of any of the basement switches (are any on, or partially on - and if so then set the "Master LED" scene to on - otherwise set the "Master LED" scene to off). Just in case the above sometimes flakes out and maybe a signal gets dropped create another program that schedules itself at regular intervals (say 5 minutes?) that polls the state of the I3 Paddles or 2477S switches - and again - if any are on/off then set the "Master LED" scene on or off respectively - then wait 5 minutes and initiate the polling program (i.e. call itself) once again Does anyone have a different or better approach to do this? One thing I am not sure about - if the program sends an "on" to the "Master LED" scene due to ONE of the banks of lights being turned on in the basement - will this then trigger the "Ruling Scene" thereby turning on all the lights in the basement (which I do not want to occur - I want to just light the LED on the keypad linc so it can then be used to turn anything off that is "on' in the basement if someone leaves the basement via the stairs and uses the button at the top of the stairs)? Any help/guidance (and best practices for the programs) would be most welcome.
-
Progs - Simple way to initiate on any state change?
Hi, Quick question related to programs. I am trying to initiate a program when a switch (in this case an I3 paddle) has changed (I don't care what has changed - anything will do). When I look at the "If" options for a control (namely the I3 paddle) - there is a multitude of possibilities (on/off/fast on/fast off/fade up/fade down ....yada yada yada). Is there anything in the "if" option testing a control just to ask "if this control did anything"? - so therefore reducing (or eliminating) a multitude of "or" statements? This becomes particularly apparent/inefficient when I am trying to perform this set of tests across three switches - so I have 9 "or" statements for each switch - so 27 or statements in the program - I come from a programming background (not this kind) and having this many "or" statements was a little silly (usually there were single line alternatives).