WebCore Piston Help for Motion Sensor and Lights

When you are editing the piston, going into the Options (top right on a desktop browser) and enable ‘Show Restrictions’ and the ‘only when’ will appear.

Thanks for the info. It was my understanding that this was the appropriate forum to ask this question about webcore - which is why I asked it here based on the title but then I realized afterwards that I wasn’t logged in to webcore community. I tried “exactly” as you described and still had to specify the the ‘Date and Time’ to make the light turn on . Specifying a “Time” only range just doesn’t make the light turn on. The consolidation completely makes sense provided that “motion changes to active” is valid for on/off. I will escalate my question to their forum to ensure I get to the bottom of way this simple action for this piston is not working. Thank you again.

The original piston you posted here should fire when the motion sensor changes state and at the start and end times of the time range. So the switch should turn on whenever the motion sensor detects motion between the given times, or if the motion is already active at the start time. It should also turn on if you hit the Test button when motion is active between those times. It the motion was already active when the piston started the switch wouldn’t turn on until it had gone inactive then active again.

What exactly wasn’t happening?

I reverted back to my original code which had the When Motion is “Active” and the switch does turn on but only if I specify the Date and Time…not just the Time. For the past 3 hours I’ve been playing with the settings and it seems to turn on with Time if I specify “2pm - 7pm - only on Saturdays”. It’s 6:58p here now and I’m not sure why it doesn’t turn on unless I make a large “time” range. It absolutely did not work when I was doing Time between 6:30 to 7:00p unless I put the Date 3/7/2020 6:30pm to 3/7/2020 7:00p time frame. Very weird!

Even after 7pm, it still responds to motion and I’m not sure why. Even with DST, that’s just an hour. There shouldn’t be a reason why it would need to have a 5 hour swing range to trigger.

turn on full logging for the piston and post those logs. also enable trace

To answer your question…when I press “Test” it displays logs. My apologies for the verbose. I will post this into the webcore forum in case.

+0ms ╔Received event [My home].time = 1583626252287 with a delay of -1129ms
+60ms ║RunTime Analysis CS > 39ms > PS > 5ms > PE > 17ms > CE
+63ms ║Runtime (38146 bytes) successfully initialized in 5ms (v0.3.110.20191009) (61ms)
+64ms ║╔Execution stage started
+268ms ║║Skipped execution of physical command [SYLVANIA SMART+ Smart Plug].off() because it would make no change to the device. (190ms)
+270ms ║║Executed [SYLVANIA SMART+ Smart Plug].off (193ms)
+273ms ║╚Execution stage complete. (210ms)
+275ms ╚Event processed successfully (275ms)

I’m not sure where you enable the Trace…here is a more details set of Full logs. I cleared them before I modified the Time restriction in the piston to be 7pm to 8pm.

3/7/2020, 7:24:33 PM +176ms
+0ms ╔Received event [My home].time = 1583627074623 with a delay of -1447ms
+63ms ║RunTime Analysis CS > 33ms > PS > 5ms > PE > 25ms > CE
+66ms ║Runtime (38150 bytes) successfully initialized in 5ms (v0.3.110.20191009) (64ms)
+67ms ║╔Execution stage started
+82ms ║║Skipped execution of physical command [SYLVANIA SMART+ Smart Plug].off() because it would make no change to the device. (1ms)
+83ms ║║Executed [SYLVANIA SMART+ Smart Plug].off (3ms)
+85ms ║╚Execution stage complete. (19ms)
+86ms ╚Event processed successfully (86ms)
3/7/2020, 7:24:04 PM +558ms
+1ms ╔Received event [Motion Sensor 1].motion = inactive with a delay of 2237ms
+41ms ║RunTime Analysis CS > 14ms > PS > 4ms > PE > 23ms > CE
+44ms ║Runtime (38147 bytes) successfully initialized in 4ms (v0.3.110.20191009) (42ms)
+45ms ║╔Execution stage started
+53ms ║║Comparison (enum) inactive is (string) active = false (2ms)
+54ms ║║Cancelling condition #2’s schedules…
+55ms ║║Condition #2 evaluated false (6ms)
+56ms ║║Cancelling condition #1’s schedules…
+57ms ║║Condition group #1 evaluated false (state changed) (8ms)
+59ms ║║Cancelling statement #13’s schedules…
+63ms ║║Executed virtual command [SYLVANIA SMART+ Smart Plug].wait (1ms)
+64ms ║║Requesting a wake up for Sat, Mar 7 2020 @ 4:24:34 PM PST (in 30.0s)
+68ms ║╚Execution stage complete. (24ms)
+70ms ║Setting up scheduled job for Sat, Mar 7 2020 @ 4:24:34 PM PST (in 29.996s)
+78ms ╚Event processed successfully (78ms)
3/7/2020, 7:23:46 PM +402ms
+1ms ╔Received event [Motion Sensor 1].motion = active with a delay of 150ms
+60ms ║RunTime Analysis CS > 21ms > PS > 6ms > PE > 33ms > CE
+62ms ║Runtime (38151 bytes) successfully initialized in 6ms (v0.3.110.20191009) (60ms)
+63ms ║╔Execution stage started
+71ms ║║Comparison (enum) active is (string) active = true (1ms)
+73ms ║║Cancelling condition #2’s schedules…
+74ms ║║Condition #2 evaluated true (6ms)
+75ms ║║Cancelling condition #1’s schedules…
+76ms ║║Condition group #1 evaluated true (state changed) (8ms)
+88ms ║║Comparison (time) 59026480 is_between (time) 68400000 … (time) 72000000 = false (8ms)
+90ms ║║Condition #15 evaluated false (11ms)
+91ms ║║Condition group #7 evaluated false (state did not change) (13ms)
+93ms ║╚Execution stage complete. (30ms)
+94ms ╚Event processed successfully (94ms)
3/7/2020, 7:23:28 PM +636ms
+1ms ╔Starting piston… (v0.3.110.20191009)
+97ms ║╔Subscribing to devices…
+109ms ║║Subscribing to Motion Sensor 1.motion…
+137ms ║║Subscribing to SYLVANIA SMART+ Smart Plug…
+139ms ║╚Finished subscribing (49ms)
+162ms ║Comparison (enum) inactive is (string) active = false (1ms)
+179ms ║Comparison (time) 59008802 is_between (time) 68400000 … (time) 72000000 = false (9ms)
+181ms ║Cancelling condition #15’s schedules…
+182ms ║Cancelling condition #7’s schedules…
+191ms ╚Piston successfully started (191ms)

above or below the piston in the same place where the test button is located. when you enable Trace, you will notice a change on the piston…more details show

There is something odd going on with timezones. You can see that the logs are timestamped for about 7:23 PM (EST?) but when there is a 30 second wait scheduled it is listed as 4:24 PM PST. The time comparison is using 4:23 PM for the current time, and understandably returning false when comparing it to 7:00 PM - 8:00PM.

Let’s start with the obvious one. As webCoRE uses your SmartThings location timezone, is your SmartThings location set correctly?

I say ‘start’, but I don’t know what I’d check next …

That’s it! My location was incorrectly set in the SmartThings Connect app and when I tried to set location correctly in Classic SmartThings app it would try but would default back to what SmartThings Connect was set. However, when I signed up for WebCore it was manually set to the correct time. This is now fixed and Piston now works. Thank you so much…this was driving me crazy! :grinning: