Location Mode piston issue


#1

1) Give a description of the problem
Sometimes the piston will run even though locationmode is Home, I have tried using the locationmode variable as well as the virtual. Sometimes the piston seems to evaluate the restriction as true and I can understand why.

2) What is the expected behavior?
Piston should only be running then the locationmode = night

3) What is happening/not happening?
as above

**4) Post a Green Snapshot of the piston

5) Attach any logs (From ST IDE and by turning logging level to Full)
+1ms ╔Received event [Home].test = 1512222564411 with a delay of 14ms +233ms ║RunTime Analysis CS > 23ms > PS > 47ms > PE > 162ms > CE +245ms ║Runtime (45586 bytes) successfully initialized in 47ms (v0.2.0ff.20171129) (243ms) +246ms ║╔Execution stage started +254ms ║║Comparison (string) Home is (string) Night = false (2ms) +256ms ║║Condition #65 evaluated false (5ms) +257ms ║║Condition group #null evaluated false (state did not change) (6ms) +257ms ║║Piston execution aborted due to restrictions in effect +263ms ║║Comparison (string) Home is (string) Night = false (1ms) +272ms ║║Comparison (enum) off is (string) off = true (1ms) +273ms ║║Cancelling condition #1's schedules... +384ms ║║Comparison (decimal) 92.8 is_greater_than_or_equal_to (integer) 2 = true (2ms) +392ms ║║Cancelling condition #1's schedules... +402ms ║║Comparison (enum) on is (string) off = false (2ms) +415ms ║║Comparison (enum) on is (string) off = false (2ms) +425ms ║╚Execution stage complete. (179ms) +441ms ╚Event processed successfully (440ms)


#2

The first thing I would try is change the variable out for location mode under virtual devices.
That’s just me though. Why use a system variable when an option is there for you.


#3

Yeah that is what I was using but was experiencing the same issue so tried the $locationmode variable instead. Can you see anything else wrong with it or any reason why it might be happening?


#4

Have you tried deleting the very top 2 only whens.
Then move the next 2 only whens into the initial IF.
IF
Location mode is night
AND
Switch 5 is off
AND
… POWER is greater…
… OR
… Motion is active.
THEN

Note. The power is and motion is, is a group.
EDIT. The logs are saying that location mode = night is false. Are you sure you are in night mode?

Condition #65 evaluated false (5ms) +257ms ║║Condition group #null evaluated false (state did not change) (6ms) +257ms ║║Piston execution aborted due to restrictions in effect +263ms


#5

Would that just cause it to run my else wait 3 minutes repeatedly though? I only want the else to run when no motion or livi g room tv is off


#6

I suppose i could wrap the whole thing in another if statement thatchecks location but it doesnt really explain why the execute only parts are failing.


#7

I’m not sure what you are actually getting at.
Could you run through what you actually want to happen. Thanks.


#8

I just want the piston to execute when mode is night and override is off.


#9

Hmm. With your restrictions, then I agree nothing should run unless location mode is night.


#10

With the logs you posted then I assume the piston worked as it should.
Do you have logs of when it didn’t run as expected.


#11

Yeah agreed but in the logs its showing other conditions running even after it states that piston execution aborted due to restrictions in effect.


#12

Its fine I have just changed the whole piston to add an If statement at the top of the piston doing the work of the exectue only that wasnt working


#13

I agree it does carry on and evaluate the other conditions but it does not execute anything.


#14

Yeah i think it those logs as the conditions werent met it didnt then execute the turning on of the lights but if i was to turn them so they fired it would turn the lights on. I was under the impression the abort should stop the execution of any further conditions. Thanks for your help anyway I have fixed it with another if statement