Need help figuring out why piston won’t run


#1

1) Give a description of the problem
Piston won’t run

2) What is the expected behaviour?
If two presence sensors are not present for at least an hour and one returns then run piston

3) What is happening/not happening?
Piston not firing)

4) Post a Green Snapshot of the piston


(UPLOAD YOUR IMAGE HERE)

5) Attach logs after turning logging level to Full
(PASTE YOUR LOGS HERE THEN HIGHLIGHT ALL OF THE LOGS AND CLICK ON THE </> ICON TO FORMAT THEM CORRECTLY)

REMOVE BELOW AFTER READING
If a solution is found for your question then please mark the post as the solution.


#2

Try swapping the order of your if conditions.


#3

@Rizlah’s suggestion might work. If not, please post a Trace and a log to help us. Thanks.


#4

I believe your condition and trigger is cancelling each other out.
I might be wrong but,
IF presence sensor changes to PRESENT then it will no longer be NOT PRESENT in the LAST one HOUR…

I believe the reason you have this condition (1 hour) because you don’t want repetition right?

I suggest just use a trigger (changes to present) and add a variable that remains FALSE and changes to true in 60 minutes.

IF Presence sensor changes to PRESENT
and
IF sensor variable = TRUE
Then 
Set sensor variable to FALSE
Do this do that.

WAIT 60 minutes
Set sensor variable to TRUE

#5

I think it depends on what ‘were not present for at least one hour’ actually means and how it is implemented. Even after reading the code, trying it, and and reading the logs, I don’t feel particularly enlightened. I think it returns true if the current state is ‘present’ and prior to that the ‘not present’ state had lasted at least one hour, but it wouldn’t surprise me if there were a few more subtleties to consider.

It also depends on whether ‘the piston not firing’ means it isn’t working as expected, or it simply isn’t triggering as expected. If the piston image is a green snapshot, where is the ‘lightning’ icon for the subscriptions?


#6

It isn’t triggering as expected.


#7

I’m going to try one more thing then go ahead and try using Boolean, what about using a restriction to only run if both my presence sensors aren’t present for an hour then if one of those presence sensors changes to present? I’m trying to restrict it from running if one presence sensor is home


#8

i’m confused how both can be present and then one of those change to present.

surely if they are both present then its not possible for one of them to then change to present


#9

What is puzzling me is that you’d get a warning message when viewing your piston if it isn’t subscribing to any events, and yet the image of your piston isn’t showing the usual ‘lightning’ icons to indicate any subscriptions. I’d expect one by line number 27.

If you switch logging to ‘full’ and pause and resume the piston, does the logging indicate it has subscribed successfully to the presence sensors?


#10

It does I’m just on mobile phone right now and wasn’t able to save the image properly, I’m at work I’ll have to send a better photo when I get home to my desktop.


#11

They’re not both present one of the ifs is if they are both NOT present for an hour


#12

Your piston will trigger when someone arrives home then it will check to see if at that time either are not present for 1 hour. So at the time of triggering the conduction can’t be true as someone is home from that point back 1 hour. Your statement can never be true so your piston will never execute.


#13

Ok any suggestions, maybe use a Boolean to set to true if something happens then back to false?


#14

Here is what Im going to try now and see if it will work for me, let me know what you think about this one, or maybe if using a restriction in the beginning would help me out.


#15

what do you think about this?


#16

Normally i test a piston and then share or ask etc. but im traveling.
One thing for sure is to switch line 31 and 33 because 33 is a trigger 31 is a condition… and in webcore almost always Triggers First conditions Later…

Edit: i see you have WAIT in the piston… did you set up TCP to NEVER? If not your piston wont wait and run all the way to buttom…


#17

@Trenton.labiche, can you give us a green shot of the piston trace and appropriate logs? Those things will greatly help us to help you. Thanks.


#18

Might try using a restriction instead of a If statement, like this

Make sure the show restrictions option is turned on it’s the 3rd icon from the left.

show%20restructions