But as you see, also stopping the speakers, the last media_player.media_stop service stops only one speaker and not what i choose to play at the beginning.
How to change the script to stop the speaker i choose? Maybe a template? But which one as i am at the beginning to understand how templates work.
In your last service, you are stopping the media_player.salotto_audio. So it will stop no matter what.
If you dont want to stop this player, then just remove it.
Also I think there is no reason having that delay at the end.
So your final script should be:
So in this way i will stop every speaker is playing regarding the last service?
The delay is for having a different switch in the frontend like this instead the default one for the scripts:
Let me explain what you have done here:
This template will read which media player is selected at input_select.radio_speakers and will stop that player.
and finally you are having a 0 second delay… There is no point for this…
But can you see what you did there? If the media_player.salotto_audio is playing and you select the Gruppo Casa and you run the script, then it will stop the Gruppo Casa AND the salotto_audio. That is why you have to remove it.