Only part of piston firing


#1

1) Give a description of the problem
Piston only firing one of my WITH clauses

2) What is the expected behaviour?
When my toddler’s contact sensor opens (her door), 5 of my sonos speakers will pause, adjust volume, and speak to me that her door will open. 1 of my sonos speakers will simply speak text and resume.

3) What is happening/not happening?
The 5 speakers pausing/adjusting/speaking work fine. The 1 speaker that is supposed to just speak & resume does nothing. Music Player 1 at line 41 is what is not firing**

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

5) Attach logs after turning logging level to Full
I only have minimal logging set, and that says it’s firing. I just switched it to full logging, but can’t produce a log until I get home tongiht. I will edit this once I have that log.


#2

Within that first then, it is impossible to execute the first ‘with’ without executing the second unless an error occurs to stop the piston execution. Have you done a simple test to make sure the speak text works with that speaker? Create a simple piston that just does speaks through that one speaker and make sure it works.


#3

It works with that speaker for sure. It was working formerly. I used to have all of the speakers do the same thing – but the one I split off is my sonos playbar - and it was blasting the TV and not re-setting the volume after it spoke, so I split that into it’s own “then” so the volume doesn’t adjust. Now, the playbar does nothing. The others all perform as expected. I was wondering if maybe that it’s trying to use TTS twice in the same “WITH” with the same text, that may be the problem, so I slightly changed the text on the second one – that didn’t fix it.


#4

Hmmm, I am at work so can’t confirm, but the thing just fired and it looks like it worked, I’ve changed nothing. “Living Room Sonos” is the one of concern …

9/26/2019, 2:32:28 PM +368ms
+1ms ╔Received event [Savannah Door].contact = closed with a delay of 86ms
+100ms ║RunTime Analysis CS > 21ms > PS > 51ms > PE > 28ms > CE
+102ms ║Runtime (41716 bytes) successfully initialized in 51ms (v0.3.10c.20190522) (100ms)
+103ms ║╔Execution stage started
+110ms ║║Comparison (enum) closed changes_to (string) open = false (1ms)
+112ms ║║Cancelling condition #2’s schedules…
+112ms ║║Condition #2 evaluated false (5ms)
+113ms ║║Cancelling condition #1’s schedules…
+114ms ║║Condition group #1 evaluated false (state changed) (7ms)
+116ms ║╚Execution stage complete. (13ms)
+117ms ╚Event processed successfully (117ms)
9/26/2019, 2:31:16 PM +792ms
+2ms ╔Received event [Savannah Door].contact = open with a delay of 111ms
+109ms ║RunTime Analysis CS > 22ms > PS > 62ms > PE > 25ms > CE
+112ms ║Runtime (41725 bytes) successfully initialized in 62ms (v0.3.10c.20190522) (109ms)
+112ms ║╔Execution stage started
+120ms ║║Comparison (enum) open changes_to (string) open = true (0ms)
+121ms ║║Cancelling condition #2’s schedules…
+122ms ║║Condition #2 evaluated true (5ms)
+123ms ║║Cancelling condition #1’s schedules…
+124ms ║║Condition group #1 evaluated true (state changed) (7ms)
+136ms ║║Comparison (time) 52276919 is_between (time) 21600000 … (time) 27900000 = false (8ms)
+138ms ║║Condition #5 evaluated false (12ms)
+149ms ║║Comparison (time) 52276931 is_between (time) 48600000 … (time) 54000000 = true (8ms)
+150ms ║║Time restriction check passed
+152ms ║║Cancelling condition #6’s schedules…
+153ms ║║Condition #6 evaluated true (13ms)
+154ms ║║Cancelling condition #4’s schedules…
+155ms ║║Condition group #4 evaluated true (state changed) (28ms)
+156ms ║║Cancelling condition #3’s schedules…
+157ms ║║Condition group #3 evaluated true (state changed) (31ms)
+159ms ║║Cancelling statement #8’s schedules…
+194ms ║║Executed physical command [Basement Sonos].pause() (29ms)
+195ms ║║Executed [Basement Sonos].pause (31ms)
+222ms ║║Executed physical command [Garage Sonos].pause() (24ms)
+223ms ║║Executed [Garage Sonos].pause (26ms)
+261ms ║║Executed physical command [MasterBath Sonos].pause() (34ms)
+261ms ║║Executed [MasterBath Sonos].pause (36ms)
+308ms ║║Executed physical command [Office Sonos].pause() (43ms)
+309ms ║║Executed [Office Sonos].pause (45ms)
+690ms ║║Executed physical command [Yard Rear Sonos].pause() (377ms)
+691ms ║║Executed [Yard Rear Sonos].pause (379ms)
+729ms ║║Executed physical command [Basement Sonos].setLevel([40]) (33ms)
+730ms ║║Executed [Basement Sonos].setLevel (35ms)
+756ms ║║Executed physical command [Garage Sonos].setLevel([40]) (25ms)
+757ms ║║Executed [Garage Sonos].setLevel (26ms)
+787ms ║║Executed physical command [MasterBath Sonos].setLevel([40]) (27ms)
+788ms ║║Executed [MasterBath Sonos].setLevel (29ms)
+815ms ║║Executed physical command [Office Sonos].setLevel([40]) (26ms)
+816ms ║║Executed [Office Sonos].setLevel (28ms)
+951ms ║║Executed physical command [Yard Rear Sonos].setLevel([40]) (134ms)
+952ms ║║Executed [Yard Rear Sonos].setLevel (135ms)
+1220ms ║║Executed physical command [Basement Sonos].playText([Savannah’s door just opened]) (264ms)
+1221ms ║║Executed [Basement Sonos].playText (266ms)
+1513ms ║║Executed physical command [Garage Sonos].playText([Savannah’s door just opened]) (290ms)
+1514ms ║║Executed [Garage Sonos].playText (292ms)
+1664ms ║║Executed physical command [MasterBath Sonos].playText([Savannah’s door just opened]) (147ms)
+1664ms ║║Executed [MasterBath Sonos].playText (149ms)
+1841ms ║║Executed physical command [Office Sonos].playText([Savannah’s door just opened]) (175ms)
+1842ms ║║Executed [Office Sonos].playText (177ms)
+2027ms ║║Executed physical command [Yard Rear Sonos].playText([Savannah’s door just opened]) (183ms)
+2028ms ║║Executed [Yard Rear Sonos].playText (185ms)
+2031ms ║║Cancelling statement #10’s schedules…
+2243ms ║║Executed physical command [LivingRoom Sonos].playTextAndResume([Savannah’s door opened]) (205ms)
+2244ms ║║Executed [LivingRoom Sonos].playTextAndResume (207ms)
+2257ms ║║Comparison (time) 52279039 is_between (time) 82860000 … (time) 21540000 = false (8ms)
+2259ms ║║Condition #15 evaluated false (12ms)
+2260ms ║║Condition group #14 evaluated false (state did not change) (13ms)
+2263ms ║╚Execution stage complete. (2150ms)
+2264ms ╚Event processed successfully (2264ms)


#5

Can you try changing the broken “Speak text” command on line 44 to match the working “Speak text” on line 39?? (IE: remove the “and resume” portion)


#6

I’ll give that a try. I’ve never understood what the difference is between “resume” and “restore”. My whole point of doing this is because I hate that it turns the volume way up on my TV to blast this message, so I modified it. If I’m not listening to a sonos, I want it to play at X defined volume. If I AM listening to the TV, however, I want it to play at the volume I’m listening at currently, and then go back to the TV show I’m watching.


#7

Side Note:
I just noticed that you have an ASYNC IF here. I would change that back to a normal IF.
(logic flows very differently with ASYNC, and it is not needed here)


#8

Will do, note that I added async just to troubleshoot this, so have confirmed it doesn’t work without it. But no need to have it in there, I agree.