Jump to content

if statement not being triggered. Is this program correct or did I screw up?


stevehoyt

Recommended Posts

Posted (edited)

for @glarsen

I have written a program that I hope to have trigger when a certain circuit comes on. In this test zone 8. For some reason, it will not start when the node status switches to run.

I have multiple screen caps below. The program is first. I manually ran the if statement at 3:32 to verify status is false and node says idle

 I waited a few minutes and then manually started circuit 8 on my rain machine. Within 15 seconds or so the node showed the circuit as running, but the if statement did not trigger true. I then ran the if statement manually and also did not get a true status.

Am I  am doing something wrong or am  I a victim of not understanding isy  if statements. 

Is this the right way to do what I want?

Thanks

Steve

Screen Shot 2022-01-24 at 3.37.51 PM.png

Screen Shot 2022-01-24 at 3.34.44 PM.png

Screen Shot 2022-01-24 at 3.36.11 PM.png

 

Edited by stevehoyt
Posted (edited)

There is an update posted, though I don't think I made any changes that will affect this.  But, I think you should use 'Status' instead of 'Control' for testing the state in your IF statement.

The flowrate units have been changed back to cfm or m3/hour, with selectable units.  Again, as soon as UDI advises that GPM has been added I will change that again.

Edited by glarsen
Posted (edited)

I would try gLarsen suggestion.  I am not sure what your rain device is. Is it insteon? Something else? In my experience, not all devices trigger a switched-on condition. Some only respond to status conditions.  If that works, be aware that a change of status could halt your program right in the middle of a weight or repeat action. You may have to adjust your program to account for that possibility.

Edited by oberkc
Posted

Using the "control" requires that the event was initiate at/by the device.  I'm not sure exactly about the rain machine nor do I know how the rain machine is turning on in your situation.  For example, if it is turning on in response to an ISY program or another Insteon device, then there will be no "control" message issued from the device, only a "status" message.

Examples that I know for sure to illustrate.

1) A light switch only issues a "control" message when you press the light switch button.  Turning on/off any other way only issues a "status" message.

2) A motion sensor will issue a "control" message whenever you trigger the motion.

Posted

Thanks to all of you above  @apostolakisland @oberkcfor the thoughts. I will do more testing to see if I can get it to work.

To answer your questions above. I am running the PG3 version of the rain machine node server. 

The node was created by it. I have no way of "knowing" how ISY is treating it...i.e. whether I will get a "control" or "status message" that I am aware of. With the proliferation of node servers coming I could see being an issue if I somehow I need this info.

What is am trying to accomplish is, whenever a zone turns on, to monitor the flow and compare it to an expected value to see if I have excessive water usage.

What happens that I am testing above, is that the Rainmachine timer turned on circuit at a given time according to that days schedule. I want that event to run the program for that circuit. I have to have, at least a 3 minute delay, for the circuit to reach full flow.

It appears "control" is not triggered. I will try "status" today. If status does work and I have to deal with my program halting midstream what is the best solution? Should I have the event initiate another program that does what I need to do. I assume by initiating another program it could not be stopped by the first one.

I really appreciate all your help. 

Steve

 

Posted
2 hours ago, stevehoyt said:

Thanks to all of you above  @apostolakisland @oberkcfor the thoughts. I will do more testing to see if I can get it to work.

To answer your questions above. I am running the PG3 version of the rain machine node server. 

The node was created by it. I have no way of "knowing" how ISY is treating it...i.e. whether I will get a "control" or "status message" that I am aware of. With the proliferation of node servers coming I could see being an issue if I somehow I need this info.

What is am trying to accomplish is, whenever a zone turns on, to monitor the flow and compare it to an expected value to see if I have excessive water usage.

What happens that I am testing above, is that the Rainmachine timer turned on circuit at a given time according to that days schedule. I want that event to run the program for that circuit. I have to have, at least a 3 minute delay, for the circuit to reach full flow.

It appears "control" is not triggered. I will try "status" today. If status does work and I have to deal with my program halting midstream what is the best solution? Should I have the event initiate another program that does what I need to do. I assume by initiating another program it could not be stopped by the first one.

I really appreciate all your help. 

Steve

 

If your ISY console shows the value change to "run", then status will definitely pick that up.  If there are only 2 status', and you only want the program to run when it changes from not running to running, then there isn't really any way for things to get messed up.  "control" is useful when you want a program to trigger even if the status doesn't change.  For example, hitting the "on" paddle when the light is already on will run using control, but it won't run on status.

Posted
3 hours ago, stevehoyt said:

It appears "control" is not triggered.

I have a (perhaps several) zwave switch that does not trigger a "control" condition. The only way that I know that this is true is because I created a program that had the zwave control condition, and it did not trigger, despite the fact that the status changed in the ISY (pretty clear that the ISY and zwave switch were communicating.). It sure sounds as if your node created here is the same, and that "status" is your most likely option.

The problem, of course, is that "status" conditions, unlike "control" conditions, trigger a program upon any change in status, including off>>>on and on>>>off.  Given this, if your status changes to off, then your program would trigger and it would evaluate false, and it would run the ELSE path.  If it were to do so during a wait or at a repeat, it would effectively halt the remaining commands.

To get around this you have a couple of obvious choices.  One choice would be to include some command in the ELSE path to execute any time the program triggers FALSE.  Unfortunately, it would be difficult to exactly duplicate what you have in your THEN path, and you would also run those commands even if it were triggered after the current THEN path had concluded.

Perhaps a better way to deal with this problem is to break your current program into two programs, such as:

if

status rainmachine node is ON

then

run second program (THEN path)

Second program:

if

nothing

then

do everything that was in original program

 

The first program would only call the second program when status changes from OFF>>>ON and the second program is not triggered by anything (other than the first program) so it would likely run to completion.  Of course, if  the status changes from off>>>on while the second program is waiting or repeating, then it would get interrupted and start again from the beginning, but this is no different than your current program and is, I assume, acceptable to you.

Posted

The change to checking status did work. I can now get the programs to run. 

I need to give this some more thought but the solution suggested by @oberkc looks to be the way to go. 

i.e just have the first event trigger a second program that would always run to completion

off and running it seems just have to write 21 programs....one for each circuit unless I can figure out a way to index a matrix of variables.

 

Thanks again to all of you for the help

Posted
1 hour ago, stevehoyt said:

The change to checking status did work. I can now get the programs to run. 

I need to give this some more thought but the solution suggested by @oberkc looks to be the way to go. 

i.e just have the first event trigger a second program that would always run to completion

off and running it seems just have to write 21 programs....one for each circuit unless I can figure out a way to index a matrix of variables.

 

Thanks again to all of you for the help

ISY does have a "copy program" function where it will duplicate.  So you can make a template and duplicate 21 times and then just edit the details.  

Guest
This topic is now closed to further replies.

×
×
  • Create New...