Control volume on HomePod Mini via script on mac?

I would like to control the volume on a HomePod mini. Preferably using AppleScript.

Hi, I have been trying to do a similar thing… never got a working update for what I was trying to do…

If you find out - please let me know…

Answering my own question here.

I have previously been able to set the “selected” state of my HomePod minis in Apple Music using AppleScript.

So today I tried various incarnations of setting volume, to no avail. Then I did a get properties on my LivingRoom HomePod
get properties of AirPlay device "Living Room HomePod"
and that gave me a few things to work with, Including “sound volume”.

Then I tried this:
set sound volume of AirPlay device "Living Room HomePod" to 65

Lo and behold it worked!!!

I am pumped because I have been searching for a long time for a script to control the individual volume levels on my HomePod minis, and now I have it.

1 Like

Following @larsof54 I put together a complete script for changing the volume of a HomePod with AppleScript. There are two scripts, each increments or decrements the volume by 10 percent. I use this paired with a Streamdeck and BetterTouchTool to execute the scripts.

There are some limitations because of how HomePods are controlled. It only changes the volume if the music app is the one playing sound through the HomePods. These scripts do not affect other devices playing or even apps other than Music. However, I think it could be modified if the target app works with AppleScript.

Volume Up Script:

tell application "Music"
	get sound volume of AirPlay device "Office"
	set currentVolume to get sound volume of AirPlay device "Office"
	if currentVolume is less than or equal to 91 then
		set desiredVolume to currentVolume + 10
		set sound volume of AirPlay device "Office" to desiredVolume
	else
		set sound volume of AirPlay device "Office" to 100
	end if
end tell

Volume Down Script

tell application "Music"
	get sound volume of AirPlay device "Office"
	set currentVolume to get sound volume of AirPlay device "Office"
	if currentVolume is greater than or equal to 9 then
		set desiredVolume to currentVolume - 10
		set sound volume of AirPlay device "Office" to desiredVolume
	else
		set sound volume of AirPlay device "Office" to 0
	end if
end tell
1 Like