Want to add more functionality to existing piston


#1

1) Give a description of the problem
I have this piston running just fine. Trying to add some more functionality, ie.: if lux level raises back above the treshold, turn lights off, reset the variabale and wait for the lux level to drop below the treshold.

2) What is the expected behaviour?
I want the lights to come one when it gets darker, turn off if the sun comes out again et rerun when it drops again.
3) What is happening/not happening?
I have no idea on how to accomplish that, not sure if it should build a separate piston or add more conditions/action blocks in the existing piston.
**4) Post a Green Snapshot of the piston![image|45x37]

5) Attach logs after turning logging level to Full
log is inexistant due to me screwing up the original piston and activating a copy of said piston.


#2

one of the ways would be creating a seperate piston
or
using variables with nested IFs


#3

So this doesn’t work. The lights came on as per normal. I moved the sensor under a light to make it register above 13 Lux. The lights wont turn off.

8/20/2020, 7:27:15 PM +413ms
+1ms ╔Received event [Love Shack].test = 1597966035413 with a delay of 0ms
+55ms ║RunTime Analysis CS > 18ms > PS > 7ms > PE > 29ms > CE
+57ms ║Runtime (42356 bytes) successfully initialized in 7ms (v0.3.110.20191009) (56ms)
+58ms ║╔Execution stage started
+81ms ║║Comparison (enum) present is (string) present = true (1ms)
+83ms ║║Condition #13 evaluated true (20ms)
+96ms ║║Comparison (integer) 50 is_less_than (integer) 13 = false (2ms)
+97ms ║║Condition #14 evaluated false (13ms)
+98ms ║║Condition group #1 evaluated false (state did not change) (36ms)
+101ms ║║Condition group #26 evaluated true (state did not change) (1ms)
+104ms ║╚Execution stage complete. (45ms)
+105ms ╚Event processed successfully (105ms)


#4

Try seperating that second IF block. (Line 46)

When I mentioned nested IFs I had some other ways in my mind.


#5

Thank you sir,
your suggestion works flawlessly. Took me some trial and error but got it dialed down.


#6

you are so welcome…

if you check the solution box, it will help people later on.