Most Sonos speaker products don't have IR control. If you have a Connect or Port connected to a receiver, you could program your CCP macro to do a receiver input switch and volume punch-through to the receiver's volume control, assuming the Sonos unit is in fixed volume output mode. But you won't be able to control the Sonos speaker directly.
Discrete codes for a Playbar are
here on this very site (these codes may also work with Arc, Amp & Beam). Those Sonos soundbar products are also capable of learning IR codes of your choosing for some of their functions.