Very simple piston not working


#1

1) Give a description of the problem
My music isn’t changing to my preset playlist

2) What is the expected behavior?
When I arrive home and my daughter isn’t home, the music will change to my playlist

3) What is happening/not happening?
nothing

**4) Post a Green Snapshot of the piston![image|45x37]

5) Attach any logs (From ST IDE and by turning logging level to Full)
1/4/2018, 6:36:16 PM +826ms
+1ms ╔Received event [Jane].presence = present with a delay of 808ms
+171ms ║RunTime Analysis CS > 30ms > PS > 67ms > PE > 75ms > CE
+174ms ║Runtime (38285 bytes) successfully initialized in 67ms (v0.2.101.20171227) (171ms)
+175ms ║╔Execution stage started
+190ms ║║Comparison (time) 66977007 is_between (time) 43200000 … (time) 68400000 = true (8ms)
+191ms ║║Time restriction check passed
+193ms ║║Cancelling condition #4’s schedules…
+193ms ║║Condition #4 evaluated true (13ms)
+198ms ║║Comparison (enum) present changes_to (string) present = false (1ms)
+199ms ║║Condition #5 evaluated false (5ms)
+200ms ║║Condition group #1 evaluated false (state did not change) (20ms)
+203ms ║╚Execution stage complete. (28ms)
+204ms ╚Event processed successfully (204ms)

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


Location mode else if returns false?
#2

I think what you’re seeing here is based on the way “changes to present” works as a trigger and not as a condition…

What I mean is that when “changes to present” happens, it causes the piston to execute from the top. But by the time it gets down to the line where it checks to see if presence “changes to present” it hasn’t because it’s already “changed” to present. I hope that makes sense…it’s a rather wordy explanation of how I think this is working based on the log files attached.

So to resolve this…I’d suggest either flipping the order so that the Presence check happens first, or rewriting the piston to something like this (my IDE is not loading right now so I can’t paste anything in)

IF Presence 1 changes to present
THEN
If Time is between (your time check)
AND
Presence 2 is not present (this will still work as this is a condition not a trigger)
THEN
Play your music

Basically just nesting an IF with your Presence still being the Trigger which starts the piston.

Give that a go and let me know how it works… I’m curious myself.


#3

I get what you are saying. I will try it and report back. I had this working in CoRE but webCoRE is a bit different in some ways.


#4

So like this…


#5

Yep. Give that a go.


#6

Presence sensors (and smartthings in general) were having loads of issues yesterday. I wouldn’t take any action based on results from 1/4.

https://status.smartthings.com/


#7

OK, but this hasn’t worked since I created it and I just haven’t had the time to fix it until now.


#8

This piston worked today! Thanks for the help!