Playing a Welcome-Jingle on SONOS Player

Hi,
I’m trying to let my SONOS speaker play a Welcome-Jingle when a WLAN-device is newly connected.
The music played when the device is detected should be stopped to play the jingle and resumed afterwards.

Using the code posted below, it works only sometimes.
The jingle starts playing, however to music played before(a favorite radio station) isn’t restored all the time. I’m unable to determine any logic when it does run as expected and when not.

rule "CheckAnwesenheitJuergen" when Item Juergen_WLAN changed to ON then sendCommand(PlayKue_Save, "On") Thread::sleep(1000) 'give SONOS a break to react on comands sendCommand(PlayKue_Favorite, "TinaKommt") Thread::sleep(25000) /* the single MP3-File in the playlist runs for 20 secs, 5 secs added for savety */ sendCommand(PlayKue_Restore, "On") end