Call outside piston to control conserve code


#1

1) Give a description of the problem
(I’d like to Call this piston only if device is playing. I have a main piston conditioned and sending announcements to several devices. I know I can test each device to see if it is playing, but rather than write code for each device, I’d like one piston to control it. )

2) What is the expected behaviour?
(Main piston sends announcements to each device. If device STATUS is playing, CALL PISTON to lower volume and resume playing. Otherwise just make announcement to device)

3) What is happening/not happening?
(MAIN piston is fine, but trying to conserve code and not put new conditions based on status. Want separate PISTON to handle condition)

4) Post a Green Snapshot of the pistonimage
(

)

5) Attach logs after turning logging level to Full
( |+2ms|╔Received event [Dawnelle Park DDS HUB].time = 1569698807933 with a delay of -675ms|
| — | — |
|+1759ms|║RunTime Analysis CS > 1537ms > PS > 167ms > PE > 56ms > CE|
|+1761ms|║Runtime (40267 bytes) successfully initialized in 167ms (v0.3.10f.20190822) (1753ms)|
|+1763ms|║╔Execution stage started|
|+1842ms|║║Restoring attribute ‘level’ to value ‘50’ using command setLevel(50)|
|+1942ms|║║Executed physical command [Echo - Echo test device].setLevel([50]) (98ms)|
|+1955ms|║║Could not find a command to set attribute ‘status’ to value ‘playing’|
|+1957ms|║║Executed virtual command [Echo - Echo test device].loadStateGlobally (126ms)|
|+2027ms|║║Executed physical command [Echo - Echo test device].play() (66ms)|
|+2028ms|║║Executed [Echo - Echo test device].play (69ms)|
|+2083ms|║╚Execution stage complete. (321ms)|
|+2106ms|║Setting up scheduled job for Sun, Sep 29 2019 @ 12:00:00 AM PDT (in 41590.638s)|
|+2115ms|╚Event processed successfully (2114ms)|
|9/28/2019, 12:26:39 PM +489ms|
|+0ms|╔Received event [Dawnelle Park DDS HUB].test = 1569698799489 with a delay of 1ms|
|+129ms|║RunTime Analysis CS > 18ms > PS > 77ms > PE > 34ms > CE|
|+132ms|║Runtime (40259 bytes) successfully initialized in 77ms (v0.3.10f.20190822) (131ms)|
|+133ms|║╔Execution stage started|
|+145ms|║║Comparison (time) 44799627 is_after (time) 43200000 = true (6ms)|
|+147ms|║║Time restriction check passed|
|+148ms|║║Condition #2 evaluated true (10ms)|
|+152ms|║║Cancelling statement #2’s schedules…|
|+156ms|║║Requesting time schedule wake up at Sun, Sep 29 2019 @ 12:00:00 AM PDT|
|+160ms|║║Condition group #1 evaluated true (state did not change) (23ms)|
|+163ms|║║Cancelling statement #3’s schedules…|
|+177ms|║║Executed virtual command [Echo - Echo test device].setVariable (4ms)|
|+180ms|║║Executed virtual command [Echo - Echo test device].wait (0ms)|
|+181ms|║║Waiting for 2000ms|
|+2192ms|║║Executed virtual command [Echo - Echo test device].saveStateGlobally (6ms)|
|+3288ms|║║Executed physical command [Echo - Echo test device].pause() (1094ms)|
|+3290ms|║║Executed [Echo - Echo test device].pause (1096ms)|
|+3299ms|║║Calculating (integer) 50 + (integer) 30 >> (integer) 80|
|+3312ms|║║Calculating (integer) 50 + (integer) 30 >> (integer) 80|
|+3318ms|║║Calculating (string) This is an announcement. Volume is currently + (string) 80 >> (string) This is an announcement. Volume is currently 80|
|+3437ms|║║Executed physical command [Echo - Echo test device].setVolumeSpeakAndRestore([80, This is an announcement. Volume is currently 80, 50]) (112ms)|
|+3438ms|║║Executed [Echo - Echo test device].setVolumeSpeakAndRestore (115ms)|
|+3442ms|║║Executed virtual command [Echo - Echo test device].wait (0ms)|
|+3443ms|║║Requesting a wake up for Sat, Sep 28 2019 @ 12:26:47 PM PDT (in 5.0s)|
|+3464ms|║╚Execution stage complete. (3330ms)|
|+3467ms|║Setting up scheduled job for Sat, Sep 28 2019 @ 12:26:47 PM PDT (in 4.978s), with 1 more job pending|
|+3479ms|╚Event processed successfully (3479ms)|

Preformatted text)