I want to reset the audio sources of my Sonos devices each night, so no matter what played during the day, radio station xy will be set for the next morning.
I tried it with media_player.select_source, but this will automaticall play the selected source. Is there any way to load a source without playing it? I don’t like messing around with mute, load, pause, unmute.
If that works, just use that script in your nightly automation
- alias: "Reset Media Devices"
trigger:
platform: time
at: "00:04:00"
action:
- service: script.reset_sonos_source
data:
entity_id: media_player.sonos_1
source: "radio station 1"
# Only one instance of script can run at a time....
- wait_template: "{{ is_state('script.reset_sonos_source', 'off') }}"
- service: script.reset_sonos_source
data:
entity_id: media_player.sonos_2
source: "radio station 1"
But no, there is no way to select_source and not have it play that source.
I haven’t tried this because I don’t trust my Sonos at all and don’t want them to start playing at night. I guess the only way really is to mute them, start playing the sorce, then stop and unmute.
Update: Combining the two actions doesn’t work. To select a media source without hearing it play, you have to do this, which is not a clean solution in my opinion:
This may be an older topic and I used to have this problem, I used to do it by muting and selecting source etc. and every now and then it would fail and radio would start blaring at 5am.
My solution:
Create a scene with all concerned speakers with the source selected, your wanted volume, and all speakers paused and then call that scene from a script at your desired time using an automation.
My setup script is: Unjoin all speakers, Set scene, Join the speakers I want joined. (the scene does not seem to recall the grouping of speakers).
Now every morning I have my wished speakers grouped and qued to play my favourite radiostation
without there being a risk of othem playing during the setup.