The local UPnP-based API used in the built-in Sonos integration does not (seem to) have access to all features developed by Sonos. One example of this is their
audioClip API. This API allows you to play a short audio clip over the currently playing music without needing to go through the snapshot/restore dance. The music volume is lowered to allow the clip to be heard, and then automatically restored when the clip is finished. It’s a much simpler and nicer experience.
Unfortunately this is only available via their cloud-based API which requires registration of an app through their developer website, can only use publicly-accessible audio files, etc. It’s also likely not supported on every device, but all of mine on S2 currently work.
It’s still in the (very) early development stages, but I wanted to share some testable code since the feature has been so useful to me already.
Note: this is not intended to replace the built-in Sonos integration, but to work in tandem. As of now it creates duplicate
media_player entities which can accept
media_player.play_media service calls. That’s it. If I’m able to figure out how to call this using the local API then this project will be abandoned basically immediately.
If you’d like to try it out, here it is in
custom_component form: GitHub - jjlawren/sonos_cloud: Sonos cloud API integration for Home Assistant.