Check for open/on sensors/lights


#1

1) Give a description of the problem
Between runs, device statuses do not update

2) What is the expected behaviour?
Trigger pulls lights on and sensors open

3) What is happening/not happening?
Variables only update after piston is saved. Variables do not update between runs if a sensor status is updated

**4) Post a Green Snapshot of the piston![image|45x37]![download%20(1)|690x456]


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

Lines 33 & 36 should be conditions… not triggers. (remove the pluses)
This is because a trigger inside of a trigger will never fire.

Once that is done, the piston will execute whenever Switch 9 changes to ON


#3

I will give that a shot tonight when I get home. Thanks!


#4

Same thing…it will run but does not pick up newly turned on lights or opened sensors. If I open the piston to edit, then save, it picks up everything that is on/opened.


#5

Please share a new green snapshot, and logs set to full showing an error


#6

Sorry, I was away for a couple days. I have figured it out and it now works perfectly.
I used a DO Block and put the first IF as a trigger and the next two IF’s as Conditions.


#7

I have never seen, tested or used DO as the top level before… so I cannot advise on that experiment…

… but just so you are aware, you did not make any of my suggested changes… You still have lines 30 & 33 with a forced subscription. (lightning bolts)

This means even though they look like conditions, they are actually treated as triggers until you remove the (+).

So essentially, you have a whopping 30 triggers in this piston!!
A change in any of the 15 devices will run thru the code from top to bottom.


#8

Sorry, I did remove and test your original suggestion earlier this week and it did not work. As I went to follow up with your request for another green snapshot and logs, I tried the DO Block and it worked the way it was supposed to.

That said, you are right, in the final version, I forgot to change away from the Always Subcribe on the 2nd and 3rd IF statements from your first recommendation.

Thank you for following up…I have updated and removed those two from always subscribing and it is working as desired. Appreciate the help!