Jump to content

using "is not" in a control program


apostolakisl

Recommended Posts

I have succesfully used "is not" lots of times in a "status" program but was just playing with it as a "control" program.

 

The goal was to have a program run anytime a switch was touched in any way. Two lines I figured would do it.

 

if switch xyz is switched on

or

if switch xyz is not switched on

 

I have discovered the the "not switched on" doesn't seem to do anything. I figured it would trigger the program if you did anything to the switch, except turn it on. I further experimented by writing the line

 

if switch xzy is not switched on

 

all by itself. Nothing I did to that switch caused the program to run.

 

So I don't quite understand what "is not switched" means to ISY in a control line.

Link to comment

Hello apostolakisl,

 

Control events are issued when something is done to the device physically. So, is NOT will be doing nothing if nothing has been done to the switch. If something is done to the switch, then is NOT basically checks to see if the event is equal to what you had in your condition and then evaluates to false if it's not equal.

 

Again, control events are not issues by themselves. They have to be triggered by a physical activity on a device.

 

With kind regards,

Michel

Link to comment

Not sure what happened here but this post showed up twice.

 

Anyway,

 

What you say, however, doesn't seem to be panning out.

 

The then statement does not run when I put

 

If switch xyz is not switched on

 

 

and then physically push it "off" (or "on" or anything).

 

My expectation for that "if" clause would be that physically taking any action at that switch would run the "then" clause except for switching it on.

Link to comment

The IF statement:

 

If
       Control 'Device' is switched On
   Or  Control 'Device' is not switched On
Then
       -- Statements --

in my experience does exactly what you are saying it should do: any command received from the device activates the program and executes the statements in the THEN branch. I will look through my programs tonight, but I am almost positive I rely on this behavior somewhere. Otherwise, there may be something awry in your communication setup. Check the logs and see if you are indeed receiving the non-'ON' command at the ISY but the program is not executing.

Link to comment

Here are some sample programs and what happens.

 

If
       Control 'Kitchen / Kitchen Intercom/Puck L' is switched On
    Or Control 'Kitchen / Kitchen Intercom/Puck L' is not switched On

Then
       Send Notification to 'dr-apo' content 'then'

Else
       Send Notification to 'dr-apo' content 'else'


 

The above executes the "then" clause when you turn the switch "on". It does nothing when you switch the light "off"

 

If
       Control 'Kitchen / Kitchen Intercom/Puck L' is not switched On

Then
       Send Notification to 'dr-apo' content 'then'

Else
       Send Notification to 'dr-apo' content 'else'


 

the above executes the "else" statement when you switch it "on"

Does nothing when you switch it "off.

 

This follows with the logic as described by IndyMike.

 

Not to be confused with

 

If
       Status  'Kitchen / Kitchen Intercom/Puck L' is not On
    Or Status  'Kitchen / Kitchen Intercom/Puck L' is On

Then
       Send Notification to 'dr-apo' content 'then'

Else
       Send Notification to 'dr-apo' content 'else'


Which executes the "then" no matter what you do to the switch. Of course it also executes the "then" if anything changes the status of the switch, not just physically pushing it.

 

The following executes the "then" no matter what you do to the switch.

 

If
       Control 'Kitchen / Kitchen Intercom/Puck L' is switched Off
    Or Control 'Kitchen / Kitchen Intercom/Puck L' is switched On
    Or Control 'Kitchen / Kitchen Intercom/Puck L' is switched Fade Down
    Or Control 'Kitchen / Kitchen Intercom/Puck L' is switched Fade Up
    Or Control 'Kitchen / Kitchen Intercom/Puck L' is switched Fast On
    Or Control 'Kitchen / Kitchen Intercom/Puck L' is switched Fast Off

Then
       Send Notification to 'dr-apo' content 'then'

Else
       Send Notification to 'dr-apo' content 'else'


 

And this also executes the "then" no matter what

 

If
       Control 'Kitchen / Kitchen Intercom/Puck L' is not switched Off
    Or Control 'Kitchen / Kitchen Intercom/Puck L' is not switched On
    Or Control 'Kitchen / Kitchen Intercom/Puck L' is not switched Fade Down
    Or Control 'Kitchen / Kitchen Intercom/Puck L' is not switched Fade Up
    Or Control 'Kitchen / Kitchen Intercom/Puck L' is not switched Fast On
    Or Control 'Kitchen / Kitchen Intercom/Puck L' is not switched Fast Off

Then
       Send Notification to 'dr-apo' content 'then'

Else
       Send Notification to 'dr-apo' content 'else'


Link to comment

Thanks, apostolakisl, that is excellent information.

 

In my opinion, this is a BUG, and a big one!

 

"If Control 'Device' is not switched On" should evaluate TRUE if a command is received from Device for anything other than On. Having it run the ELSE branch only when the device is switched On makes no logical sense whatsoever, short of being the closest thing to the grammatical syntax of the statement. But I don't care about grammar, I care about event driven programming.

 

Control statements should cause the program to trigger whenver a command is received from the Device. Then the IF statement should be evaluated accordingly. Maybe the grammatical display of the Control statement could be changed to "If Control 'Device' is switched not On".

 

Again (and again, and again), being able to seperate trigger events from IF conditions would make this a WHOLE LOT clearer, but in light of the current ISY model, a program with the statement "If Control 'Device' is switched On" should run the THEN branch of the program whenever a command of On is received from Device (and not trigger the program at all if another command is recevied), and the statement "If Control 'Device' is not switched On" should run the THEN branch of the program whenever a command other than On is received from Device.

 

Michel, please comment on this being a bug or the intended design.

Link to comment
Thanks, apostolakisl, that is excellent information.

 

In my opinion, this is a BUG, and a big one! ...

 

Its not a bug, but the syntax could be clearer.

 

"Or Control 'Kitchen / Kitchen Intercom/Puck L' is not switched On"

 

Could be rewritten as this:

 

"Or Not (Control 'Kitchen / Kitchen Intercom/Puck L' is switched On)"

 

Control statements should cause the program to trigger whenver a command is received from the Device.

 

Thats not how it works, Control statements only trigger the program if the control value (i.e. 'On') matches.

 

Again (and again, and again), being able to seperate trigger events from IF conditions would make this a WHOLE LOT clearer,

 

You can do this now by using two programs. The first program is enabled and contains the trigger conditions, and whose only action is to 'Run If' the 2nd program. The 2nd program is not enabled, and therefore the If conditions are only used to determine whether the Then or Else path is taken, not whether the program is triggered or not.

 

For more complex Logic, the 2nd program could instead be a set of programs all 'Run If' by the first program. The 1st program could also be a set of programs, each of which 'Run If' all of some of the other programs.

Link to comment
Could be rewritten as this:

 

"Or Not (Control 'Kitchen / Kitchen Intercom/Puck L' is switched On)"

So, is this statement always evaluated as "true" except at the instance when "On" is received. Is the implication also that the trigger for evaluation of this statement is still just an "On" command from the device (off, dim, bright, xx% will NOT necesarily trigger an evaluation)?

Link to comment
Could be rewritten as this:

 

"Or Not (Control 'Kitchen / Kitchen Intercom/Puck L' is switched On)"

So, is this statement always evaluated as "true" except at the instance when "On" is received. Is the implication also that the trigger for evaluation of this statement is still just an "On" command from the device (off, dim, bright, xx% will NOT necesarily trigger an evaluation)?

 

Yes, that is correct.

Link to comment

This statement may make more sense if we look at the actual programming screen:

 

Not_switched.jpg

 

1) In the highlighted condition above, the trigger is "ON".

2) The choice "IS" will cause the "Then" statement to execute.

3) The choice "IS not" will cause the "else" statement to execute.

 

The "IS" and "IS not" are essentially vectors to the "Then" and Else" branches. I'll agree that it's difficult to separate these when looking at the program. However, when looking at the "condition selections" it appears clear.

Link to comment
Its not a bug, but the syntax could be clearer.

 

"Or Control 'Kitchen / Kitchen Intercom/Puck L' is not switched On"

 

Could be rewritten as this:

 

"Or Not (Control 'Kitchen / Kitchen Intercom/Puck L' is switched On)"

Well, it may not be a bug, but it is not very useful. Again, I have to jump through a lot of hoops to make the simple trigger event "Any command received from 'Device'" take effect.

 

You can do this now by using two programs.

I understand this. I think it is clear from my posts in this topic that I understand this. My point is that I shouldn't have to. UD's response to every post I have submitted on this subject has shown a clear lack of understanding of the point I am trying to convey (from lack of reading, not lack of intelligence, I imagine). I guess I just need to shut up and use the product as is until I find something better.

Link to comment

I understand this. I think it is clear from my posts in this topic that I understand this. My point is that I shouldn't have to. UD's response to every post I have submitted on this subject has shown a clear lack of understanding of the point I am trying to convey (from lack of reading, not lack of intelligence, I imagine). I guess I just need to shut up and use the product as is until I find something better.

 

I hope you didn't take offense, certainly none was intended, and we do appreciate your contributions to the Forum. I added my responses simply because some of your posts seemed to imply separating triggers and If couldn't be done at all.

Link to comment

I hope no one minds if I (a new person to the forum) jumps into this issue when I clearly do not yet fully understand ISY programming.

 

I refer back to a question asked by oberkc and answered by Chris.

So, is this statement always evaluated as "true" except at the instance when "On" is received. Is the implication also that the trigger for evaluation of this statement is still just an "On" command from the device (off, dim, bright, xx% will NOT necesarily trigger an evaluation)?

Chris said this was correct.

 

Not according to tests I have done. The expression never evaluates as True. I wrote an IF-THEN-ELSE with this single condition and have not been able to find anything that causes the THEN clause to execute. An 'ON' command will of course trigger the ELSE clause.

 

Is this the way it is supposed to work? If so, did anyone have any thoughts how this conditional test might be used?

 

EDIT: I mean to ask, did the designers of the "Is Not" logic for this particular condition have any thoughts about how this conditional test might be used that is superior (or more easily understood) than using "Is"?

Link to comment
The expression never evaluates as True.

The response from Chris made me think differently. The expression WOULD evaluate as "true" IF it were evaluated. However, in this case, the only trigger that would force an evaluation (apart from additional conditions in the "if" statement) would be receipt of an "on" command, at which point it would evaluate as false. I think this is the case of differentiating between what causes an evaluation versus the results of an evaluation.

 

Statements such as this are probably most useful in conjunction with other conditions, or if you want an "on" command to trigger an "else" statement. For example, I would expect the following statement to trigger an evaluation at 0900 and the evaluation to yield a "true" result:

 

if
time is 0900 am
and 
control "XXX" is not switched on

 

Consider the opposite....

 

if control "XXX" is switched on

 

By the same thought process, this one never evaluates as "false".

Link to comment
EDIT: I mean to ask, did the designers of the "Is Not" logic for this particular condition have any thoughts about how this conditional test might be used that is superior (or more easily understood) than using "Is"?

 

I think dnl is right on the money here. In effect, this syntax creates a situation where using "is not" or "is" simply changes whether you put the desired action in the "then" or the "else".

 

Except during the actual button press, "control" commands are always false whether you use "is" or "is not". This means that having the "is not" language does not affect a program differently than "is" language in the event that something else triggers it. So I am having a hard time figuring out when using "is not" would ever provide a function that can't also be done using "is".

 

"is not" would be useful in the event that any action taken on the switch allowed for evaluation of the statement and a "true" response in the event that it were anything but the stated parameter (on, off, whatever).

Link to comment

Hi oberkc,

 

If I understand the results of my tests correctly, then the two ANDed conditions ...

 

if
time is 0900 am
and
control "XXX" is not switched on

always evaluate to False because the "control ... is not switched on' never evaluates to True. Please let me know if you find anything that causes this condition to evaluate to True.

 

On the other hand ...

if control "XXX" is switched on

will evaluate either to True or to False depending on what control is sent.

 

Chris indicated there is no bug but there sure seems to be. Write down the Boolean truth tables for both "Is" and "Is Not". The "Is Not" condition does not seem to be a true Boolean converse to "Is", which is what I would expect. What is the intended purpose of a condition that can only evaluate to False?

Link to comment

dnl,

 

"What is the intended purpose of a condition that can only evaluate to False?" The only possible purpose would be as a trigger of that program.

 

In the event that you use an "or" statement with an "is not" control and something else, it will allow a "true" result if the other statement is true and a false outcome if the other statement is false.

 

So, if you had some situation where you wanted the true/false status of the other statement to drive the result after controlling a switch to a particular state, this would do it.

 

I can't think of when I would need that, but it is the only situation I can think of that the "is not" would be helpful. But, you could still get that same result by having two programs where the first program contains "if xyz is switched on" "then run the other program" were used.

 

In short, I totally agree with you in that "control . . .is not" is poorly conceived.

 

Edit: I just realized you can use "control . . is" combined with another statement using "and" to allow controlling of the switch to a particular state to trigger a program where the other parameter is in charge of the "true/false" outcome.

 

So I now believe that there is no use for the "is not" in a control program at all.

Link to comment

Hi dnl,

 

I just created a sample program:

 

If
       Control 'Basement/Garage / SW GRS Garage Exterior Sconse' is not switched On
   And Time is  7:44:00PM

Then
  - No Actions - (To add one, press 'Action')

Else
  - No Actions - (To add one, press 'Action')

 

When the ISY clock went to 7:44, the program status changed from false to true. I expect it to remain true indefinitely, unless the switch is turned on manually, at which point it will stay false until 7:44:00pm the next day. BTW: this is consistent with my single test point....I turned the switch on and the program reverted to false. If I remember to check tomorrow, I will see if the program turns true at 7:44p.

Link to comment
Hi dnl,

 

I just created a sample program:

 

If
       Control 'Basement/Garage / SW GRS Garage Exterior Sconse' is not switched On
   And Time is  7:44:00PM

Then
  - No Actions - (To add one, press 'Action')

Else
  - No Actions - (To add one, press 'Action')

 

When the ISY clock went to 7:44, the program status changed from false to true. I expect it to remain true indefinitely, unless the switch is turned on manually, at which point it will stay false until 7:400pm the next day. BTW: this is consistent with my single test point....I turned the switch on and the program reverted to false. If I remember to check tomorrow, I will see if the program turns true at 7:44p.

 

OK, now I don't get it. By my understanding this program should be false always. My new understanding is the "is not" terminology allows a "true" outcome if no action is taken at the switch and a second statement is "true".

 

Would this program run differently if you used "or" instead of "and"?

Link to comment
OK, now I don't get it.

 

I may not get it, either, but here is how I see it regarding the sample program. Firstly, I believe that this program will be evaluated ONLY as a result of two triggers. One trigger is time=7:44pm. The other trigger is any receipt of an "on" signal from the switch "exterior sconse".

 

Secondly, one must look at the results of the evaluation, once they are triggered. An "on" command from the switch would yield a "false" condition, but given the nature of "controls", that condition would be only momentary (at the time of command receipt). If the control condition were evaluated at a time other than upon receipt of the "on" command, the condition would be evaluated as "true". The time condition would yield a true result only if evaluated at exactly 7:44.

 

So....at 7:44pm an evaluation was triggered. Time condition was true. Control condition was also true (because there was NO simultaneous receipt of an on command from the switch). Both conditions were true: program was true.

 

Would this program run differently if you used "or" instead of "and"?

The triggers forcing evaluation would be unchanged. However, the results of the evaluation would require only one of the two conditions to be true for the program to be true, rather than both.

 

So I now believe that there is no use for the "is not" in a control program at all.

I originally believed the same thing about an IPad, but once available, I came up with some uses. I continue to be amazed at the creativity of the folks around here. While I don't currently use it and cannot immediately think of a use, I am not ready to conclude that there is absolutely no use for it.

Link to comment

oberkc, thank you for the program example. It shows very clearly why I would never want to use this particular condition in a program.

 

I did some testing with the code you posted and, unless I made a mistake, the code behaves the same regardless whether you use AND or OR between the two conditions. I do not understand why this particular condition would be designed to work this way.

 

apostolakisl, I agree the "Is Not" condition could be very useful if it evaluated to True when any command other than the specified one was used.

 

Thanks so much for starting this thread. It might have taken days to debug a program that used such as statement.

 

EDIT: Ah, I see you asked the same question while I was doing my testing. No difference between AND and OR.

 

SECOND EDIT: Yes, I think oberkc is correct -- there would be a difference in the situation where the ON command is received at the specified time. There may be a use for this but I believe code should be readily understandable if at all possible. This particular condition does not seem readily understandable -- at least not to me.

Link to comment

I think theoretically at exactly 7:44 it would behave differently. If you used "or" and managed to turn the light "on" at the exact same instant as the clock hit 7:44 it would evaluate to "true" instead of "false". But I think that is only theoretical because I am not sure that ISY can process 2 things as happening exactly at the same time.

Link to comment
I continue to be amazed at the creativity of the folks around here. While I don't currently use it and cannot immediately think of a use, I am not ready to conclude that there is absolutely no use for it.

Someone finding a use for it doesn't make it "useful." I agree with the assesments of others that this completely counterintuitive and I see very little use for it. But they can leave it in there, it doesn't hurt anything.

 

However, I think someone may want to request a new condition for control: 'If Control 'Device' is switched Any." I would request it, but it seems my requests/suggestions are always answered by "here is how you can accomplish it using five different programs in the current ISY model."

Link to comment

Archived

This topic is now archived and is closed to further replies.


×
×
  • Create New...