JJJ Posted Saturday at 09:13 PM Posted Saturday at 09:13 PM I have programs that update variables when switches are switched on or off. I have both Insteon and Lutron switches. The Lutron switches trigger the program when I change it manually, in UD Mobile, The Lutron App or from Alexa. The Insteon switch only triggers the program if I manually turn it on or off. If I use UDI mobile or Alexa, the status updates in the Main device screen on the administrative console but the program doesn't trigger. The program is very simple. If light is switch on or if status of the light is on, then change Variable_Light to 1 and program 2 is If light is switched off or if status of the light is off, then change Variable_Light to 0. Quote
mmb Posted Saturday at 11:51 PM Posted Saturday at 11:51 PM 2 hours ago, JJJ said: I have programs that update variables Are you updating Integer or State variables? Quote
Guy Lavoie Posted Sunday at 12:06 AM Posted Sunday at 12:06 AM It would be clearer if you could post the actual program(s). Bring up the program, right click on the program name, and then "copy to clipboard" at the very bottom. 1 Quote
JJJ Posted Sunday at 07:26 AM Author Posted Sunday at 07:26 AM I am updating State Variables, Below are some programs 3B2-Front Lights Hold On V2 - [ID 00CD][Parent 00CE] If 'Devices / F3 / Foyer-C / 3C_4 Front Lights' is switched On And $Front_Lights is 0 Then $Front_Lights = 2 Else - No Actions - (To add one, press 'Action') 3B2-Front Lights Hold Off V0 - [ID 00CC][Parent 00CE] If 'Devices / F3 / Foyer-C / 3C_4 Front Lights' is switched Off Or 'Devices / F3 / Foyer-C / 3C_4 Front Lights' Status is 0% Then $Front_Lights = 0 Else - No Actions - (To add one, press 'Action') Quote
GlowingHair Posted Sunday at 09:50 AM Posted Sunday at 09:50 AM (edited) @JJJ I'm not familiar with Lutron switches, but in Insteon world, I believe using "switched" (control) in the if statement means just that, that the switch is switched, physically. Using "status" in the if statement would cover all possibilities, e.g., physically switching, Alexa/GH commands, etc. To cover all bases, status and control can both be used in the if statement. Edited Sunday at 10:39 AM by GlowingHair Quote
oberkc Posted Sunday at 11:29 AM Posted Sunday at 11:29 AM 1 hour ago, GlowingHair said: I'm not familiar with Lutron switches, but in Insteon world, I believe using "switched" (control) in the if statement means just that, that the switch is switched, physically. Adding to this thought, I have several z-wave switches and none would trigger programs from a "control" (switched on) condition. A few would not even trigger status conditions. I start to wonder if, in the IoX world, the control condition is unique to Insteon devices. Perhaps Lutron switches also fail to trigger programs from a control condition? I second the motion to try "status" instead. Quote
Guy Lavoie Posted Sunday at 12:49 PM Posted Sunday at 12:49 PM Question: are you able to trigger scenes (created in IoX) with those Lutron switches? If you create a scene where a Lutron switch is a controller and an Insteon switch is a responder, does the Lutron switch control the Insteon one? 1 Quote
JJJ Posted Sunday at 08:27 PM Author Posted Sunday at 08:27 PM Both Control and Status are in my program. Insteon only triggers when the switch is done manually, Lutron will trigger the program whether manual or through UD Mobile, Lutron App or Alexa. Quote
CoolToys Posted Sunday at 10:37 PM Posted Sunday at 10:37 PM @JJJ, there are several issues at play here, and I just want to clarify, you are actually pushing the insteon switch with a finger, not activating it through a program or scene? Lutron and Insteon both send a position change over the network. In this way they are similar. If that is true that you are physically pressing the button, then @GlowingHair is correct. In my case I set up one of each to test and both work as below. There are two six button keypads one on each side of the bed. Forgive my very lazy naming of the buttons both refer to the bottom off button or status of the ON/OFF buttons. The big question is why are you using a switch to set a state and unset the state? A direct command would be a lot easier or setting the switch as a scene controller. Why "2" as the state shift? I am guessing there are some complex interactions when $Front_Lights = "2". Using a state variable to monitor switch position is a bit of overkill? Is there a State where Front_lights = "1"? What happens if you force feed $Front_Lights to "2" in the Admin console? does the next appropriate program run? Also as was recommended to me, I have changed all integer variables to be $iFront_Lights and state variables to be $sFront_Lights to make it easier for others to help. So more questions (I ask because if you read the Long Running Randomness post you will see I have done all of this wrong as some point). When you switch the 3C_4 Front Porch switch on, does the state variable change, even for a second? And does the program 3B-2 Front Lights On Hold V2 turn green in the left side bar indicating it is true? When you select off, does it turn red indicating false and does the state change again even for a second? Under Programs, Summary tab, select the order to be last run, and see if another program runs at the same time or within a minute, maybe there is a conflict? Have you done a search to see what other places the $Front_Lights state variable appears in programs. Is there a direct conflict or timing conflict possible? Programs Tab, Details, Select a program, right click and then "Find/Replace". Bedtime Trigger - [ID 001D][Parent 0001] If 'MB Window Keypad.On' Status is Off Or 'MB Door Keypad 70 9B C0All On' is switched Off Then $sBedtime = 1 Else - No Actions - (To add one, press 'Action') At Sunrise or one of several other events $sBedtime is set back to zero and the switches are both put in the on position to tell me that has happened. I like to know what my system is doing or has done. To do this I created scene called "Home Status" and made both of the switches responders. Here is the short version of one of the programs. At Sunrise - 1 minute, I set $sSunrise_Daytime to "1" and at Sunset, it is set back to "0". This is a huge clean up program to catch all the things missed the night before or manually turned on after the system has run its programs. I edited the big middle out for simplicity. Sunrise Clean Up - [ID 0026][Parent 0048] If $sSunrise_Daytime is 1 Then $sBedtime = 0 ... Wait 2 seconds Set 'MB Home Status' On Else - No Actions - (To add one, press 'Action') Quote
Guy Lavoie Posted Sunday at 10:39 PM Posted Sunday at 10:39 PM 2 hours ago, JJJ said: Both Control and Status are in my program. Insteon only triggers when the switch is done manually, Lutron will trigger the program whether manual or through UD Mobile, Lutron App or Alexa. I'm referring to scenes, created in IoX, not programs. Quote
JJJ Posted Monday at 05:51 AM Author Posted Monday at 05:51 AM @CoolToys, I am both pushing the switches with my finger and also using alexa and UD Mobile to turn the switches on. The Insteon switches appear to only trigger the programs if the switch it turned on manually with a finger. It doesn't seem to matter if I use control , status or both. The Lutron switches will trigger the programs anytime they are turned on be it manual with a finger or through Alexa or UD Mobile. I am using a variable to determine which time off program to run. If a motion sensor turns on the light then the variable is 1. If the switch is turned on with no motion then the variable is 2, if the light is off, the variable is 0. So when the switch turns on with motion, it triggers a program to turn lights off 2 minutes after the motion sensor doesnt sense motion. If the switch is manually turned on, then the time off program is for 30 minutes. It works perfectly with Lutron as the variable changes everytime the switch changes. I just cant figure out how to make it work with my Insteon switches since they appear to only change the variable when manually switched. Quote
oberkc Posted Monday at 12:19 PM Posted Monday at 12:19 PM 6 hours ago, JJJ said: The Insteon switches appear to only trigger the programs if the switch it turned on manually with a finger. It has been my experience that, with Insteon switches, a "control" condition will trigger a program when the expected condition (on, off, etc...) is received from (and only from) manual control of the Insteon device. "Status" conditions will trigger a program any time an Insteon device changes state, regardless of what initiates the state change. If you are seeing behavior different than this, you may be having other difficulties, such as communication between devices. 2 Quote
Geddy Posted Tuesday at 05:32 AM Posted Tuesday at 05:32 AM On 1/12/2025 at 2:26 AM, JJJ said: Or 'Devices / F3 / Foyer-C / 3C_4 Front Lights' Status is 0% For a line like this I prefer to use the “not off” for the status. Your program is looking for only when the status is 0%, but that’s “off”. For a dimmer switch I have more success using the “not off” rather than the status being 0%. Because usually when the status is 0% it’s “off”. Remember that “control” is a physical operation of a switch. Where as “status” is what’s reported to the ISY from the device. If it’s a dimmer it might report a status of “off” rather than “0%”. 1 Quote
CoolToys Posted Tuesday at 06:15 PM Posted Tuesday at 06:15 PM @JJJ, I will start with that I am not super clear on the difference of state and integer variables so for my pea brain, I only use "0" and "1" for any State Variable. That way each "state" variable only can have a binary state. (Yes I am that old I started with binary programming) I've read the ISY guide and just don't see a need to increase by "1" or "2" with integer variables with the exception of the "atomic_check" so I can see how many times a program runs or something. With your program my thinking is that two separate variables named for easier tracking might help, but that is just me. If I understand the ISY manual, what you are doing is just fine, just harder to see what is really happening because one "State" can be changing back and forth without you knowing because you are forcing the value instead of increasing like you would with an integer variable. So my first suggestion for easy tracking is to make two variables. $sLightSwich_On and $sMotionSensed. @Geddy is correct, you would need to set up two separate programs, however, it might be easier to just build a scene with the motion sensor as the "Controller" so as long as there is motion and set the timeout value to 120 seconds. (This is in the "Options" panel when you select the options button for the motion sensor in the Admin Console for Insteon Motion Sensors) Then 120 seconds after motion stops, the lights go off. When the switch is "Switched On", start the program that does the 30 minute test. Quick note, I tried the two minute motion thing and certain times of year the lights would go off when we were still in the room so WAF was zero and I had to reprogram. Another option might be to use the If "Room.Motion is On" on to start the program that only runs for 2 minutes and use IF "switch_name is Switched On" to start a different program. Even if you use the motion sensor or switch to fire the program directly, add the $sState_Variable to the program so you can see that the program ran quickly without going to the Summary page. This makes it easier to find comm issues, and you can use the $sState_Variable to run the countering program. One glance at my variables list I know exactly the overall state of my system and can quickly pinpoint where something is or isn't running when it should. For the garage, if I switch the light on I want it to stay on but here is the auto on/off sequence if I just arrive home or need a tool or soda from the fridge. The Variable change is first in the Then line so I don't get conflicting programs. With my ISY it was so slow it wasn't a problem but the eisy can run two or three large programs and if the variables aren't placed right one will cancel the other somehow. That might be why I went to two variables some time ago, the speed of the newer IoX controllers can change a state so fast you spend hours looking at logs to find it. I'm lazy. Auto Garage Lights - [ID 0012][Parent 0001] If 'Garage Lights' Status is Off And ( 'Garage.1 Motion' Status is On Or 'ELK Alarm / Garage Courtyard' Logical Status is Violated Or 'ELK Alarm / Garage Big' Logical Status is Violated ) Then $sGarage = 1 Set 'Garage Lights' On Wait 2 seconds Set 'Garage Lights' Query Else - No Actions - (To add one, press 'Action') Then to turn off. Auto Garage Off - [ID 0029][Parent 0001] If $sGarage is 1 And 'Garage.1 Motion' Status is Off And 'ELK Alarm / Garage Big' Logical Status is Normal And 'ELK Alarm / Garage Courtyard' Logical Status is Normal Then Wait 15 minutes $sGarage = 0 Set 'Garage Lights' Off Else - No Actions - (To add one, press 'Action') Quote
JJJ Posted Tuesday at 07:40 PM Author Posted Tuesday at 07:40 PM @geddy, The program is supposed to change the variable to 0 when the lights are turned off, if I use "not off", this is the opposite of what I am trying to do. Also, this dimmer is a Lutron Dimmer using the plug in. The status options are only 0% to 100% in 1% increments. So for On I use "Is not 0%" and for Off I use "Is equal to 0%" The Lutron switches seem to work fine. I have identical programs with the Insteon switches that are giving me issues. From what I understand, control for Insteon is from a manual push of the switch and status is for any change in the switch regardless if it was manual or otherwise. So when the switch is turned on by motion, it runs a program for a 1 minute time off and if it was turned on manually, it runs a program for a 30 minute time off. This all works fine until I use Alexa to turn on a light. When this happens, the variables don't change and no programs are triggered. I want the Alexa command to be treated the same as manually turning on the switch. If I add Status of the switch call the 30 minute time off, it overides the 1 minute program I have for the motion. When the motion sensor senses motion, it sets a variable to 1. It appears my easiest solution is just to continue down the path of replacing the Insteon with Lutron. Quote
Guy Lavoie Posted Tuesday at 07:45 PM Posted Tuesday at 07:45 PM The only difference between state and integer variables is that a state variable's value can be used as a trigger for a program (so the program "state" is true or false). Both variable types can contain the same values. In theory, they could have made all variables state variables. This was probably done to lighten the cpu load, to avoid needlessly testing the value of a variable that is only used for math, totals, etc. You would define variables for that purpose as integer. Quote
Guy Lavoie Posted Tuesday at 08:01 PM Posted Tuesday at 08:01 PM (edited) 5 hours ago, JJJ said: This all works fine until I use Alexa to turn on a light. When this happens, the variables don't change and no programs are triggered. I want the Alexa command to be treated the same as manually turning on the switch. When I want multiple sources of triggers for actions, I have the triggers set a state variable, and the program controlling the device looks for that variable being set to the trigger value, turns the device on or off, and resets the variable for the next trigger. That way, you detach the trigger source from the activation of the device. Another benefit is that you can set the variable to different values for different actions of the same switch (ie: trigger two separate programs). For example you could have a slave switch or Alexa set the variable to 1 to just turn on the switch, and the motion sensor set the variable to 2 because you only want to turn on the switch for 30 seconds. - First your trigger programs: If slave switch Status is on and variable = 0 then variable = 1 If motion sensor control is on and variable = 0 then variable = 2 (For Alexa you would just directly set the variable to 1 in the portal) - Then your action programs: If variable = 1 then turn on switch then variable = 0 if variable = 2 then turn on switch then wait 20 seconds then turn off switch then variable = 0 Furthermore, you might want to override the motion sensor activation if the light is turned on by the switch or Alexa. so that the motion detection doesn't turn the light off on you when you actually want to be there for some time. So you might want to modify the action program to leave the variable set to 1 until the light is actually turned off by the switch or Alexa. This would be one or two additional programs looking for those triggers and setting the variable to 0. That way, the motion sensor trigger wouldn't happen because the condition to do so is by getting the motion sensor On command AND the variable being equal to 0. That's the difference between having just a hub vs a fully programmable controller. Edited Wednesday at 01:08 AM by Guy Lavoie Quote
CoolToys Posted Wednesday at 05:42 PM Posted Wednesday at 05:42 PM (edited) 22 hours ago, JJJ said: @geddy, ... I want the Alexa command to be treated the same as manually turning on the switch. If I add Status of the switch call the 30 minute time off, it overides the 1 minute program I have for the motion. When the motion sensor senses motion, it sets a variable to 1. It appears my easiest solution is just to continue down the path of replacing the Insteon with Lutron. @JJJ, I think you are looking at this correctly in that the Alexa command merely turns the switch on. In Insteon world the only way to get Insteon to act like you pushed a button is to push the button. Lutron doesn't know the difference because it was built around the "human factor" meaning that all actions are treated as if a human did it. While I am a HUGE Lutron fan, Insteon is at a better price point and has some flexibility not offered by Lutron. There is a way to do this without spending money and pulling switches out of the wall. While it may be frustrating, Insteon is giving you one more fork in the logic than Lutron. I agree with @Guy Lavoie that you can use the Alexa command to change a state variable which then triggers the appropriate program. The ISY world is based on "States" and as pointed out above only state variables are checked as part of the state of the system. Integer is not. "Switched On" (manually) and "Status On" (true whenever on) are different "States" in ISY world, so if you want a specific state to be achieved when "Switched On" or "Alexa On" happen, but not when "Status On" from another program happens, the best way to do that is with a program where you can check the status first, and then if other things are true change the variable. This way if the light is already On, Alexa commands don't change the state in the wrong way also. Keep in mind that one second after Switched On or Alexa On become the state, Status On is also a true state, so you will need to write your logic to block that possibility. Simply add $sGarage="0" to the "IF" statement so if the lights already on, you don't change the outcome. I added the query because this is turning on a scene, and I have some scene reliability issues going on. Auto Garage Lights - [ID 0012][Parent 0001] If 'Garage Lights' Status is Off And ( 'Garage.1 Motion' Status is On Or 'ELK Alarm / Garage Courtyard' Logical Status is Violated Or 'ELK Alarm / Garage Big' Logical Status is Violated ) Then $sGarage = 1 Set 'Garage Lights' On Wait 2 seconds Set 'Garage Lights' Query Else - No Actions - (To add one, press 'Action') Auto Garage Off - [ID 0029][Parent 0001] If $sGarage is 1 And 'Garage.1 Motion' Status is Off And 'ELK Alarm / Garage Big' Logical Status is Normal And 'ELK Alarm / Garage Courtyard' Logical Status is Normal Then Wait 15 minutes $sGarage = 0 Set 'Garage Lights' Off Else - No Actions - (To add one, press 'Action') Edited Wednesday at 05:47 PM by CoolToys 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.