Wait function causing piston to not run


#1

1) Give a description of the problem
The following piston does not run when I have the “wait until” nested inside (line 41). I have turned on FULL logging. Nothing happens. There is just nothing in the log, its like the piston doesn’t fire at all. When I delete the ‘wait until’ statement the piston functions as expected. I tried putting it elsewhere in the piston, and it still breaks. I also tried setting it to wait until a specific time, or wait for x seconds to troubleshoot but to no avail. I can’t even insert a “wait” statement in the top block where it sets the ‘url’ variable. For some reason, the Wait 4 hours in line 55 does not seem to affect the piston.

2) What is the expected behaviour?
Piston runs, waits until the expected time, then continues.

3) What is happening/not happening?
With the wait statement in… nothing. I turned on full logging and nothing shows up. When I delete the wait statement the piston functions as intended.

**4) Post a Green Snapshot of the piston!

5) Attach logs after turning logging level to Full
No logs, piston does not execute. For reference. I have included the logs
generated without the “wait” statement.

12/21/2019, 11:35:44 AM +755ms
+0ms ╔Received event [xxxx].execute = with a delay of 80ms
+74ms ║RunTime Analysis CS > 19ms > PS > 29ms > PE > 27ms > CE
+77ms ║Runtime (51114 bytes) successfully initialized in 29ms (v0.3.110.20191009) (76ms)
+78ms ║╔Execution stage started
+82ms ║║Cancelling statement #1’s schedules…
+94ms ║║Calculating (string) blocking me from posting links due to new user…
+99ms ║║Calculating (string) blocking me from posting links due to new user…
+102ms ║║Calculating (string) blocking me from posting links due to new user…
+106ms ║║Executed virtual command setVariable (3ms)
+113ms ║║Sending external web request to: blocking me from posting link due to new user…
+162ms ║║Executed virtual command httpRequest (49ms)
+167ms ║║https://statsapi.web.nhl.com/api/v1/schedule?teamId=7&startDate=2019-12-21&endDate=2019-12-21&expand=schedule.game.content.media.epg
+168ms ║║Executed virtual command log (1ms)
+174ms ║║Comparison (dynamic) 1 is_greater_than_or_equal_to (integer) 1 = true (1ms)
+175ms ║║Cancelling condition #37’s schedules…
+176ms ║║Condition #37 evaluated true (5ms)
+177ms ║║Cancelling condition #36’s schedules…
+178ms ║║Condition group #36 evaluated true (state changed) (8ms)
+180ms ║║Cancelling statement #40’s schedules…
+186ms ║║Executed virtual command setVariable (3ms)
+189ms ║║Executed virtual command setVariable (1ms)
+201ms ║║Executed virtual command setVariable (1ms)
+207ms ║║Executed virtual command setVariable (3ms)
+221ms ║║Calculating (date) 1576908000000 + (time) 64800000 >> (datetime) 1576972800000
+227ms ║║Executed virtual command setVariable (3ms)
+238ms ║║Calculating (string) CST == (string) CST >> (boolean) true
+242ms ║║Calculating (decimal) 0.0 - (decimal) 6.0 >> (decimal) -6.0
+247ms ║║Executed virtual command setVariable (3ms)
+254ms ║║Calculating (string) Sabres have + (string) 1 >> (string) Sabres have 1
+256ms ║║Calculating (string) Sabres have 1 + (string) game(s) today >> (string) Sabres have 1 game(s) today
+260ms ║║Sabres have 1 game(s) today
+261ms ║║Executed virtual command log (2ms)
+267ms ║║Calculating (string) game time in CST is + (string) Sat, Dec 21 2019 @ 12:00:00 PM CST >> (string) game time in CST is Sat, Dec 21 2019 @ 12:00:00 PM CST
+271ms ║║game time in CST is Sat, Dec 21 2019 @ 12:00:00 PM CST
+272ms ║║Executed virtual command log (1ms)
+277ms ║║{“jsonrpc”:“2.0”,“method”:“GUI.ActivateWindow”,“params”:{“window”:“videos”,“parameters”:[“plugin://video.lazyman.nhl.tv?action=feeds&game=2019020552&date=2019-12-21&provider=NHL.tv”]},“id”:1}
+278ms ║║Executed virtual command log (1ms)
+285ms ║║Comparison (dynamic) 7 is (integer) 7 = true (2ms)
+287ms ║║Cancelling condition #69’s schedules…
+288ms ║║Condition #69 evaluated true (7ms)
+289ms ║║Cancelling condition #68’s schedules…
+290ms ║║Condition group #68 evaluated true (state changed) (9ms)
+292ms ║║Cancelling statement #72’s schedules…
+297ms ║║Executed virtual command setVariable (3ms)
+309ms ║║Comparison (string) Home is (string) Home = true (1ms)
+311ms ║║Condition #50 evaluated true (11ms)
+312ms ║║Condition group #49 evaluated true (state did not change) (12ms)
+315ms ║╚Execution stage complete. (237ms)
+316ms ╚Event processed successfully (316ms)


#2

This piston currently only has one condition (line 51) which is acting as a trigger.

The only times this piston executes, is when your “currentPlace” changes to “Home”.


#3

I execute it manually with the external URL and/or another piston calling it. It does not run when I use the link or call it from another piston. But when I remove the wait until line, it runs correctly.

I did unsubscribe from the location trigger as that should not trigger the piston, the point of this piston is to find out if there is a game, wait until the game start time, then turn on my TV if there is a game on AND I am home at the time.


#4

Well, I was able to come up with a solution for anyone wondering… I created 3 pistons.

Piston#1 calculated the time, and set it as a global variable. This piston triggered Piston#2, which simply waited waited until the set time. Then triggered Piston#3, which executed as expected.