Please help me solve this


#1

1) Give a description of the problem
Unable to get the second half of the piston to work.

2) What is the expected behaviour?
If status is away and button gets pressed, set status to home via routine i’m back.

3) What is happening/not happening?
Piston halts for some reason.

**4)

**5)
23-10-2019 16:17:22 +809ms
+2ms ╔Received event [Doorbell].button = pushed with a delay of 1224ms
+968ms ║RunTime Analysis CS > 873ms > PS > 51ms > PE > 46ms > CE
+977ms ║Runtime (37211 bytes) successfully initialized in 51ms (v0.2.0e1.20170728) (973ms)
+978ms ║╔Execution stage started
+991ms ║║Comparison (enum) pushed gets (string) pushed = true (2ms)
+993ms ║║Cancelling condition #2’s schedules…
+994ms ║║Condition #2 evaluated true (8ms)
+998ms ║║Comparison (string) :0abe4062165063112ed0eb9c4152c08d: is (string) :4f5e4b0863b29651195c2e43df1878cb: = false (2ms)
+1000ms ║║Condition #3 evaluated false (5ms)
+1001ms ║║Condition group #1 evaluated false (state did not change) (16ms)
+1015ms ║╚Execution stage complete. (38ms)
+1023ms ╚Event processed successfully (1023ms)


#2

your piston may be getting confused as you have an if statement with no condition attached to it.


#3

I believe you would want to remove the condition at line 20 and place that same condition 'Location mode is Home' with the if statement at line 22. Not sure having the 'async if' condition at line 31 is required, so would revert that back to the default if type.


#4

It doesn’t seem to work. I redesigned it but this piston won’t work either. Anybody suggestions?


#5

This last version looks much better…
but I would move the second IF down below the first. (totally outside of it)

IF W
    Then do X
END IF

IF Y
    Then do Z
END IF

#6

agree with @WCmore - I have found that the if/else commands do not quite work in webcore the way you would expect them to. I tend to stay away from them as much as I can. If I have multiple conditions then I tend to use a switch statement. But in your case as there is only two then 2 separate if statements will work fine.