I want to have my doorbells on my Sonos speakers, which in itself works fine (Automation just triggers once). However after playing the doorbells the speakers should return to the previous state. So e.g.:
Speakers are playing something from Spotify (works fine)
Doorbell get’s triggered (works fine)
Speakers should stop Spotify and play the doorbell sound (works fine)
After the doorbell the Speakers should resume the Spotify playback just where they stopped
Since I’m new to Home Assistant I honestly have no clue how to save the old state and restore it. Right now they are just quiet after playing the doorbell sound.
Thanks to both of you. It’s working perfectly fine for local music now. However as @123 already indicated it doesn’t work at all with Spotify. Is there any workaround to get it somehow working?
A workaround would be to store all of the information about what’s currently playing on Spotify (including the time elapsed in the song), stopping it, playing the doorbell sound, then using the stored information to specify what Spotify should play. Even this won’t work if you can’t tell Spotify to play a song starting at a specific time within the song.
I’ve take a look at the documentation and a quick one at the source code of the Sonos integration and it doesn’t seem like there would be a way to do that. On top of that it’s impossible to use the Spotify integration or take a look at the official Spotify API since Sonos devices are not supported by the official API: Spotify - Home Assistant
Seems like there would be no solution to the problem