First ever Piston - not quite working


#1

1) Give a description of the problem
Sonos should annouce my drive gates have been opened and then resume playback but it doesnt resume!

2) What is the expected behavior?
Sonos resumes doing what it was after announcing drive gates opened

3) What is happening/not happening?
Sonos announces the drives gates are opened but doesnt resume doing what it was doing before hand I have tried both resume and restore - just FYI it was playing a radio station on tunein kicked off with Alexa.

4) Post a Green Snapshot of the pistonimage

5) Attach any logs (From ST IDE and by turning logging level to Full)
(PASTE YOUR LOGS HERE BETWEEN THE MARKS)


#2

Have you tried ‘Speak text and Resume’?


#3

HI yup I have tried both Resume and Restore… :frowning:


#4

After a short period, your piston will become false as changes to will be become false and will not remain true.
Try setting TCP (Task Cancellation Policy) to Never.
Setting TCP to never will stop the tasks from cancelling. Do this on your WITH statement.


#5

Speak and Resume will work … sometimes. A Sonos owner, I have experienced widely varying success with the resume statement depending on a variety of factors, including the source of the audio that is playing prior to the “speak” statement. My recollection is that Amazon Music will resume – albeit at the start of the next track – while others, like Google Play Music, never resume. Because of the inconsistency, I suspect the issue lies outside WebCoRE, but It’s simply and annoyingly unreliable regardless.

It may be easier to do experiment with this by eliminating the ‘if’ statement trigger altogether and using only the ‘with’ statement and the Test button to execute the piston.


Resume Sonos Play
Sonos announcement and start music
Sonos - Play Track & Resume Play
#6

I have been trying this out myself without any success and even with amazon music the track doesn’t resume it seems. Quite annoying to say the least.


Getting "Speak Text and Resume" to Properly Work (possibly Google Home specific)
#7

I’ve noticed a few things, I can’t seem to get the next and play to work either. I tried next because I can see that in the sonos controller an MP3 is dynamically generated which is I assume loaded from a URL so i get “my_text_with_underscores.mp3” which is then played. I think this somehow messes with the internal queue that sonos has so I almost need to select the previous queue and then get that to play again.

so next track and play don’t work because, there is nothing next to play.


#8

Looking at https://github.com/obycode/smartthings-smartapps/blob/master/Sonos.groovy it does suggest that webcore is doing the same as the smarthings ‘native’ code for sonos control.

It does look like there is some track handling code and furthermore the custom commands are exposed in the piston. But also don’t work :slight_smile:

If this is a bug I think it’s with the underlying sonos library handling and not webcore :frowning:


#9

Can you please provide a code example? I can’t figure out how to get that to go into a WITH.

I’m having trouble getting a Sonos to return to a volume lower than set for an announcement.

Thx.


#10

Task Cancellation Policy can be found by:

  • Edit the piston in question
  • Click on the appropriate WITH
  • Click on the gear icon at the bottom
  • Set “Task Cancellation Policy” to Never
  • Click Save and then Save again

#11

Perfect. Solved my issue. Thx!!


#12

Did you use “speak and restore” or “speak and resume”


#13

I used restore. Like others, I’m experiencing mixed results with the resume part. If the TV is playing, it works just fine. But if I’m streaming music through Pandora, for example, it doesn’t resume. The music stops, the announcement is played, and then . . . . silence . .