Trigger Question


#1

I am using a door contact while testing. I will later change it back to the leak sensor after I get this working. I was also having trigger issues with the leak sensor.

I set the trigger to be when the switch changes to open, however, the trigger of the piston occurs on the open to close transition and as such the THEN part does not execute. Your help would be appreciated.

In the log the evaluation of the IF branch shows false because the trigger occurred on the open to close transition.

Thanks,
Ray


#2

This is working exactly as it should. The piston is subscribed to ALL contact events coming from that device.


#3

Please bear with me I’m new to this.

I find that:

The piston is triggered by the open to close transition, it then finds the comparison false and the ELSE clause is executed.

The piston is NOT triggered by the closed to open transition and therefore the THEN can never be executed.

Please help me with this.


#4

Can you please enable full logging and then open the contact a couple of times then paste the logs here?


#5

before turning on full logging please change your piston so it only has these statements:

image


#6

I’m new to this environment so my skills are lacking. Guilty as charged!

By setting up a very simple app
with only one nearly empty If Then, Else statement,
with the same trigger as before,
I confirmed that the triggering did occur on both the open=>close and close=>open transitions.
Then building the code slowly up from there I am making progress.

What I infer from this is:
that if there is a coding/construct error in one of the clauses the compiler may not configure the trigger code as expected? Is this a reasonable conclusion?


#7

Not exactly like traditional coding where everything gets compiled at the end. Most errors are alerted before being able to continue. But you could still potentially input some overwhelming logic that prevents expected outcome


#8

It’s a complex but interesting environment.

Cheers,
Ray