Piston only runs once after no motion is detected


#1

1) Give a description of the problem
Basically I have EventGhost on my main office PC and it can be put to sleep by simply visiting this url from any device http://192.168.1.172/?HTTP.ST.MainPC.switch.off
including SmartThings

2) What is the expected behaviour?
This piston needs to not wait for another motion in order to get executed because anything can wake computer ie. background programs, services, WOL etc.

3) What is happening/not happening?
Right now it only works once when I leave the office and after 15 seconds (just for testing, it will be increased) it puts computer to sleep. The problem is what I figured from testing is after I wake it up remotely to do something with the PC, the sensor I guess does not see any motion so it never runs the piston again.

So the only solution is have something like this https://community.smartthings.com/t/release-host-pinger-ip-based-online-state-presence/61435 where it would check status of the device that is still pingable and it would execute piston again? Is there easier solution available for this?
I’m really trying to avoid to another PC that has to be on :grinning:

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

5) Attach logs after turning logging level to Full
12/29/2019, 11:49:48 PM +142ms
+1ms ╔Received event [My home].time = 1577692189254 with a delay of -1112ms
+103ms ║RunTime Analysis CS > 21ms > PS > 46ms > PE > 35ms > CE
+105ms ║Runtime (38199 bytes) successfully initialized in 46ms (v0.3.110.20191009) (103ms)
+106ms ║╔Execution stage started
+107ms ║╚Execution stage complete. (1ms)
+108ms ╚Event processed successfully (108ms)
12/29/2019, 11:49:29 PM +786ms
+0ms ╔Received event [My home].wc_async_reply = httpRequest with a delay of 0ms
+94ms ║RunTime Analysis CS > 28ms > PS > 42ms > PE > 24ms > CE
+96ms ║Runtime (38202 bytes) successfully initialized in 42ms (v0.3.110.20191009) (95ms)
+98ms ║╔Execution stage started
+135ms ║╚Execution stage complete. (38ms)
+136ms ╚Event processed successfully (135ms)
12/29/2019, 11:49:29 PM +124ms
+0ms ╔Received event [My home].time = 1577692170193 with a delay of -1070ms
+91ms ║RunTime Analysis CS > 26ms > PS > 41ms > PE > 24ms > CE
+93ms ║Runtime (38203 bytes) successfully initialized in 41ms (v0.3.110.20191009) (92ms)
+94ms ║╔Execution stage started
+99ms ║║Cancelling condition #16’s schedules…
+100ms ║║Condition #16 evaluated true (2ms)
+110ms ║║Comparison (time) 85769225 is_between (time) 82800000 … (time) 25200000 = true (7ms)
+111ms ║║Time restriction check passed
+113ms ║║Condition #19 evaluated true (12ms)
+116ms ║║Cancelling condition #15’s schedules…
+117ms ║║Condition group #15 evaluated true (state changed) (18ms)
+119ms ║║Cancelling statement #17’s schedules…
+126ms ║║Sending internal web request to: 192.168.1.172/?HTTP.ST.MarinkoLaptop.switch.off
+129ms ║║Executed virtual command httpRequest (2ms)
+130ms ║║Requesting a wake up for Sun, Dec 29 2019 @ 11:49:49 PM PST (in 20.0s)
+134ms ║╚Execution stage complete. (41ms)
+135ms ║Setting up scheduled job for Sun, Dec 29 2019 @ 11:49:49 PM PST (in 19.995s)
+156ms ╚Event processed successfully (157ms)
12/29/2019, 11:49:10 PM +85ms
+2ms ╔Received event [Office Sensor].motion = inactive with a delay of 169ms
+94ms ║RunTime Analysis CS > 18ms > PS > 47ms > PE > 29ms > CE
+96ms ║Runtime (38202 bytes) successfully initialized in 47ms (v0.3.110.20191009) (94ms)
+97ms ║╔Execution stage started
+106ms ║║Comparison (enum) inactive stays (string) inactive = true (1ms)
+107ms ║║Adding a timed trigger schedule for condition 16
+109ms ║║Condition #16 evaluated false (8ms)
+110ms ║║Condition group #15 evaluated false (state did not change) (9ms)
+112ms ║╚Execution stage complete. (15ms)
+114ms ║Setting up scheduled job for Sun, Dec 29 2019 @ 11:49:30 PM PST (in 19.995s)
+121ms ╚Event processed successfully (121ms)
12/29/2019, 11:48:48 PM +687ms
+2ms ╔Received event [Office Sensor].motion = active with a delay of 125ms
+96ms ║RunTime Analysis CS > 17ms > PS > 46ms > PE > 32ms > CE
+98ms ║Runtime (38197 bytes) successfully initialized in 46ms (v0.3.110.20191009) (96ms)
+99ms ║╔Execution stage started
+107ms ║║Comparison (enum) active stays (string) inactive = false (2ms)
+109ms ║║Cancelling any timed trigger schedules for condition 16
+110ms ║║Cancelling statement #16’s schedules…
+111ms ║║Cancelling condition #16’s schedules…
+111ms ║║Condition #16 evaluated false (8ms)
+112ms ║║Cancelling condition #15’s schedules…
+113ms ║║Condition group #15 evaluated false (state changed) (11ms)
+116ms ║╚Execution stage complete. (16ms)
+117ms ╚Event processed successfully (116ms)
12/29/2019, 11:41:11 PM +136ms
+0ms ╔Starting piston… (v0.3.110.20191009)
+319ms ║╔Subscribing to devices…
+329ms ║║Subscribing to Office Sensor.motion…
+409ms ║╚Finished subscribing (109ms)
+446ms ║Comparison (enum) inactive stays (string) inactive = true (2ms)
+462ms ║Comparison (time) 85271584 is_between (time) 82800000 … (time) 25200000 = true (10ms)
+463ms ║Time restriction check passed
+471ms ╚Piston successfully started (470ms)

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


#2

As a “safety net”, EventGhost can look for when the screensaver kicks in, and can either directly put the PC to sleep, or it can trigger the piston’s URL, and let webCoRE take it from there…


I think the above approach would be much more efficient than:

Periodically pinging every X minutes…

(although both are possible)