Set Homepods (stereo-pair) as default audio at system-start and after wake

Hello,

i try to find a way for setting my homepod stereo pair as the default audio-device at system-start and after wake. I don't know, if this is something, that could be postet in 'Feature Requests', so i ask here, if anybody knows the way to do this.

Ok, this forums doesn't seem to be very helpful.

I don’t think this is possible in any good way, but please post if you find a solution I’d also be interested in it.

This could maybe be helpful when combined with the after wakeup/ after launch triggers in BTT: https://github.com/deweller/switchaudio-osx

I've already tried this, but it doesn't work with AirPlay devices.

Ok, i've found a solution. You can use the following applescript:

tell application "System Preferences"
	reveal anchor "output" of pane id "com.apple.preference.sound"
end tell

delay 1

tell application "System Events" to tell process "System Preferences"
	tell table 1 of scroll area 1 of tab group 1 of window 1
		select (row 1 where value of text field 1 is "Stereo HomePods")
	end tell
end tell
quit application "System Preferences"

Paste the code into the scripteditor and just replace "Stereo HomePods" with the name of your HomePod(s) / AirPlay device. After that, you have to save the script as app and add it to the login items (SystemPreferences / User&Groups) of your account.

or

Create two triggers with BTT:

1st trigger: 'After Launching BTT' with the following action assigned to this trigger: 'Run Apple Script (async in background) - then paste the content of the script into the small window on the right side and hit ‚Save‘.

2nd trigger: 'After Mac Wakes From Sleep' with the following action assigned to this trigger: 'Run Apple Script (async in background) - then paste the content of the script into the small window on the right side and hit ‚Save‘.

Maybe it is possible to integrate this into BTT so that you only have to enter the name of the AirPlay device.