Google Assistant "Get Spooky" clone


#1

1) Give a description of the problem
With Google Assistant’s “Get Spooky” feature not controlling lights this year, I tried to simulate the functionality in WebCore. Turn lights on/off, dim/brighten, and change colors. I’ve got the piston “working” but its behavior is not what I’m expecting.

2) What is the expected behavior?
Lights to randomly dim, turn on/off, change color.

3) What is happening/not happening?
Every thing starts off seemingly fine, but after a while it just seems to stop, but then seems to start up again. The lights that turn on/off don’t do so as often as I expect. I’m wondering If I just have too much going on and am running into a memory issue.

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

5) Attach any logs (From ST IDE and by turning logging level to Full)
( 10/27/2018, 1:43:17 PM +682ms
+2ms ╔Received event [Get Spooky].switch = off with a delay of 780ms
+182ms ║Runtime (43368 bytes) successfully initialized in 133ms (v0.3.108.20180906) (179ms)
+184ms ║╔Execution stage started
+197ms ║╚Execution stage complete. (14ms)
+198ms ╚Event processed successfully (198ms)
10/27/2018, 1:41:27 PM +73ms
+1ms ╔Received event [MyHome].time/recovery = 1540662087073 with a delay of 0ms
+206ms ║Runtime (43379 bytes) successfully initialized in 118ms (v0.3.108.20180906) (204ms)
+208ms ║╔Execution stage started
+210ms ║╚Execution stage complete. (1ms)
+212ms ╚Event processed successfully (211ms)
10/27/2018, 1:40:55 PM +617ms
+1ms ╔Starting piston… (v0.3.108.20180906)
+556ms ║╔Subscribing to devices…
+603ms ║║Subscribing to Get Spooky.switch…
+831ms ║║Subscribing to Cabinet Lights…
+833ms ║║Subscribing to Front Door Lights…
+834ms ║║Subscribing to Pantry Light…
+836ms ║║Subscribing to TV Light…
+837ms ║║Subscribing to Fireplace Outlet…
+839ms ║║Subscribing to Table Light…
+841ms ║║Subscribing to Couch Lights…
+842ms ║║Subscribing to Kitchen Area…
+844ms ║║Subscribing to Morning Room Fan-Light…
+845ms ║╚Finished subscribing (303ms)
+963ms ╚Piston successfully started (961ms)
10/27/2018, 1:39:57 PM +93ms
+0ms ╔Received event [MyHome].time = 1540661997548 with a delay of -456ms
+161ms ║Runtime (43386 bytes) successfully initialized in 111ms (v0.3.108.20180906) (159ms)
+162ms ║╔Execution stage started
+163ms ║╚Execution stage complete. (2ms)
+165ms ╚Event processed successfully (164ms)
10/27/2018, 1:39:56 PM +415ms
+1ms ╔Received event [Get Spooky].switch = off with a delay of 673ms
+339ms ║Runtime (43375 bytes) successfully initialized in 115ms (v0.3.108.20180906) (336ms)
+341ms ║╔Execution stage started
+367ms ║╚Execution stage complete. (27ms)
+370ms ╚Event processed successfully (369ms)
10/27/2018, 1:39:46 PM +80ms
+0ms ╔Received event [MyHome].time = 1540661986795 with a delay of -716ms
+384ms ║Runtime (43375 bytes) successfully initialized in 334ms (v0.3.108.20180906) (383ms)
+385ms ║╔Execution stage started
+2294ms ║║Executed [Cabinet Lights].setColor (1856ms)
+2347ms ║║Executed [Front Door Lights].setColor (52ms)
+2394ms ║║Executed [Pantry Light].setColor (46ms)
+2444ms ║║Executed [TV Light].setColor (47ms)
+2460ms ║║Executed virtual command [Cabinet Lights, Front Door Lights, Pantry Light, TV Light].waitRandom (1ms)
+2461ms ║║Waiting for 3447ms
+5973ms ║║Executed [Cabinet Lights].setColor (42ms)
+6018ms ║║Executed [Front Door Lights].setColor (44ms)
+6057ms ║║Executed [Pantry Light].setColor (37ms)
+6098ms ║║Executed [TV Light].setColor (40ms)
+6117ms ║║Executed virtual command [Cabinet Lights, Front Door Lights, Pantry Light, TV Light].waitRandom (1ms)
+6119ms ║║Requesting a wake up for Sat, Oct 27 2018 @ 1:39:57 PM EDT (in 5.349s)
+6126ms ║╚Execution stage complete. (5740ms)
+6127ms ║Setting up scheduled job for Sat, Oct 27 2018 @ 1:39:57 PM EDT (in 5.341s)
+6136ms ╚Event processed successfully (6135ms)
10/27/2018, 1:39:35 PM +836ms
+2ms ╔Received event [Get Spooky].switch = on with a delay of 690ms
+177ms ║Runtime (43367 bytes) successfully initialized in 106ms (v0.3.108.20180906) (175ms)
+179ms ║╔Execution stage started
+538ms ║║Executed [Cabinet Lights].setColor (311ms)
+580ms ║║Executed [Front Door Lights].setColor (41ms)
+622ms ║║Executed [Pantry Light].setColor (40ms)
+666ms ║║Executed [TV Light].setColor (42ms)
+682ms ║║Executed virtual command [Cabinet Lights, Front Door Lights, Pantry Light, TV Light].waitRandom (1ms)
+684ms ║║Waiting for 3863ms
+4631ms ║║Executed [Cabinet Lights].setColor (53ms)
+4701ms ║║Executed [Front Door Lights].setColor (69ms)
+4763ms ║║Executed [Pantry Light].setColor (60ms)
+4822ms ║║Executed [TV Light].setColor (56ms)
+4838ms ║║Executed virtual command [Cabinet Lights, Front Door Lights, Pantry Light, TV Light].waitRandom (1ms)
+4840ms ║║Requesting a wake up for Sat, Oct 27 2018 @ 1:39:46 PM EDT (in 6.111s)
+4855ms ║╚Execution stage complete. (4677ms)
+4857ms ║Setting up scheduled job for Sat, Oct 27 2018 @ 1:39:46 PM EDT (in 6.103s)
+4866ms ╚Event processed successfully (4866ms)
10/27/2018, 1:39:29 PM +33ms
+1ms ╔Starting piston… (v0.3.108.20180906)
+444ms ║╔Subscribing to devices…
+493ms ║║Subscribing to Get Spooky.switch…
+665ms ║║Subscribing to Cabinet Lights…
+667ms ║║Subscribing to Front Door Lights…
+668ms ║║Subscribing to Pantry Light…
+670ms ║║Subscribing to TV Light…
+671ms ║║Subscribing to Fireplace Outlet…
+673ms ║║Subscribing to Table Light…
+675ms ║║Subscribing to Couch Lights…
+676ms ║║Subscribing to Kitchen Area…
+678ms ║║Subscribing to Morning Room Fan-Light…
+679ms ║╚Finished subscribing (245ms)
+786ms ╚Piston successfully started (784ms))

Thank you.


#2

What do you mean? The random are all going to be different each time. Why don’t you wrap them all in an async group and set the could with random to a variable at the beginning. That might help sync everything together.