Crushing1523 is using the underlying announce endpoint of AmpliPis API. Here’s the docs for it: API - Announcement. Make sure to check out the schema for the different fields available.
It looks like they added several audio files to their units folder /home/pi/Music
and are using those for the media to play.
As for announcing to individual zones they are using the zones field to specify a list of zones to announce to by their zone id. You can find the zone’s ids by looking at the zones portion of status or directly with API - Zones. It will look something like this:
{
"zones": [
{
"disabled": false,
"id": 0,
"mute": true,
"name": "Upstairs Main Bath",
"source_id": 2,
"vol": -56,
"vol_f": 0.28,
"vol_max": -20,
"vol_min": -70
},
{
"disabled": false,
"id": 1,
"mute": true,
"name": "Upstairs Living Room",
"source_id": 3,
"vol": -49,
"vol_f": 0.42,
"vol_max": -20,
"vol_min": -70
},
{
"disabled": false,
"id": 2,
"mute": true,
"name": "Upstairs Dining",
"source_id": 0,
"vol": -66,
"vol_f": 0.08,
"vol_max": -20,
"vol_min": -70
},
{
"disabled": false,
"id": 3,
"mute": true,
"name": "Upstairs Laundry",
"source_id": 0,
"vol": -66,
"vol_f": 0.08,
"vol_max": -20,
"vol_min": -70
},
{
"disabled": false,
"id": 4,
"mute": true,
"name": "Upstairs Kitchen High",
"source_id": 0,
"vol": -45,
"vol_f": 0.5,
"vol_max": -20,
"vol_min": -70
},
{
"disabled": false,
"id": 5,
"mute": true,
"name": "Upstairs Kitchen Low",
"source_id": 0,
"vol": -23,
"vol_f": 0.94,
"vol_max": -20,
"vol_min": -70
}
]
}
Say we wanted to make a doorbell chime using an announcement with 60% volume to the dining room and both portions of the kitchen. You would make a POST call to http://amplipi.local/api/announce with the following data payload:
{
"media": "https://cdn.freesound.org/previews/275/275068_4486188-lq.mp3",
"vol_f":0.6,
"zones":[2,4,5]
}
Crushing1523 is using a rest_command
action
that defines the announcement api call and has volume and type parameters. This is the plumbing that they use to connect a doorbell event to an announcement.
I hope this helps!