Sonos Syntax

Hi,

I’m new to all this, but trying to get my head around the coding. I am trying to automate sonos to play a favourite playlist, shuffle it and put a sleep timer on along with turning on some wemo switches. I assume I do this within automation rather than a script? Can anyone advise me on the syntax and whether these things are even possible please?

I see there is something called SoCo for python, but not sure if I can even integrate that in to HA?

Thanks for your patience and any guidance you can offer.