Home Assistant and AmpliPro: Automations

Home Assistant and AmpliPro: Automations

March 25, 2025

Imagine this: It’s 7am. You wake up to your favorite song playing softly in the bedroom, the lights slowly brighten, and your coffee brews. Later after work, when your phone’s GPS shows you’re 10 minutes from home, your thermostat adjusts to your preferred temp, your lights turn on, and Chill Vibes Radio plays throughout your house. Welcome to the world of Home Assistant automations, where your home doesn’t just respond to you; it anticipates you.

This blog post will describe in detail how to set up some useful** automations. This guide will involve automations for a specific whole home audio device, the AmpliPro. However this post can still be used as a guide for different devices and automations. Once you have the basics and know how to do one or two automations, then you know how to do most automations. It’s a lot like legos, once you know how the pieces fit together, you can build just about anything.
       **In this reddit post and this Home Assistant Community post, users share their favorite and most useful automations. These posts are full of a bunch of real world automation examples

This post will give step by step instructions for a very simple automation. Then I’ll detail more complex automations with multiple actions. Then for fun I’m going to tell you how I pranked my boss with his own entrance music.
    —First automation: Play an audio file from your Home assistant Hub
    —Second automation: Play a specific stream on your AmpliPro
    —Third automation: Turn up the volume… Slowly
    —Fourth Automation: Scenes! A Quick How To
    —Fifth Automation: Pranking My Boss

Prerequisites

  1. Home Assistant: Home Assistant is an open source home automation platform that acts as a central hub for controlling and automating smart home devices like lights, thermostats, cameras, sensors, home audio systems like the AmpliPro and more.
  2. AmpliPro’s integration: We wrote this blog post detailing how to set it up.
  3. AmpliPro dashboard cards: This blog post is about different ways you can control your AmpliPro using Home Assistant Automations. They’re great because they work quietly in the background without requiring any manual interaction. But if you still want your click button controls on neatly organized dashboard cards. This blog post details how to set those up.
  4. Defining terms: Home Assistant has a page defining terms and concepts. But with automations there are two terms vital to how automations work that they should be highlighted:

   Devices are a logical grouping for one or more entities. A device may represent a physical device, which can have one or more sensors. The sensors appear as entities associated with the device. For example, a motion sensor is represented as a device. It may provide motion detection, temperature, and light levels as entities.

   Entities are the basic building blocks to hold data in Home Assistant. An entity represents a sensor, actor, or function in Home Assistant. Entities are used to monitor physical properties or to control other entities. An entity is usually part of a device or a service. Entities have states such as “detected” for motion, “67%” for battery level or “clear” for no motion.

The AmpliPro creates both entities and devices for Sources, Zones and Groups. You can use either when setting up your automations.

Automation One: A Simple Alarm or Announcement

This is a very simple automation. It will simply play audio after a trigger becomes ’true’. The trigger could be a motion sensor senses movement, a smart washer finishes its cycle, or the time is 3pm. This automation is going to play an audio file from you Home Assistant Hub itself to the AmpliPro. If you don’t have any audio uploaded to your smart home hub, follow these next steps from your Home Assistant dashboard:

How to:

Media > My Media > Manage > Add Media Add Media

Now we have some audio to play, let’s set up the automation.
Select: Settings > Automations and Scenes > Create Automation > Create new automation Create an automation

Next up:
When:
Add trigger > Time and Location > Time > Select your desired time 3pm

Then Do:
Add Action > Media Player > Play media > Select media player > group or zone to play the audio* > Pick media > My Media > Select audio file*
Two medias Note: There are two “play media” actions to choose from, select the one that says:
“Play media on media player”

It should look something like the picture below. Then save and name the automation. Play media set up

Pro Tip
An easy way to test the automation: From the automations menu > Click the 3 dots next to the automation > Run actions.

Note on Announcements: The AmpliPi Announcement device/entity plays audio on all speakers temporarily. Perfect for one time alerts like “Laundry’s done!”

Automation Two: Playing Streams on the AmpliPro

Want to play “Morning Jazz Internet Radio” in the kitchen every weekday at 7am? We can do that. The AmpliPro can be configured to play all sorts of streams: Spotify, Pandora, a variety of internet radio stations, AirPlay Devices. (Don’t know how to configure streams? Check out our UI guide ) Any of those streams can be activated with an Automation. First I have to talk about the term ’Source’

This automation uses the same function “Select Source” twice. Confusingly there are two different types of sources that this action is calling up.

“Active Sources:” The AmpliPro is only capable of playing 4 active sources at one time. These active sources appear under devices as Source 1 - 4. And Under Entities as AmpliPi 0 - 3. Where AmpliPi 0 = Source 1, AmpliPi 1 = Source 2 and so on.

Device Name Entity Name
Source 1 AmpliPi 0
Source 2 AmpliPi 1
Source 3 AmpliPi 2
Source 4 AmpliPi 3

“Streaming Sources” These refer to streams, like spotify, pandora, internet radio. These streams play “on” Sources 1, 2, 3 or 4.

To recap: Think of “active sources” (Source 1-4) as empty radio stations. “Streaming sources” (Spotify, Pandora…etc) are the DJs that play music on those stations. To hear the DJ, you first tune your radio to the station (Source 1), then select the DJ (Spotify).

Here’s how to do it:

When:
Add any trigger you wish

Then Do:
Add Action > Media Player > Select source > Choose Entity > AmpliPi 0 > Type the Stream’s name (cAsE sEnsitiVe)
In the ‘source’ field, type the name of the stream you want The stream name (e.g., “Morning Jazz Radio”, “Spotify”, “Pandora”…) must match exactly what’s configured in AmpliPro’s UI, including spaces and capitalization.

Then add another action:
Add Action > Media Player > Select source > Choose Entity > (Select the Zone or Group you want the stream to play on) > In the ‘source’ field type: “Source 1” (What you type here is case sensitive. The options are: Source 1, Source 2, Source 3, Source 4)

Select Source set up

Source 2, 3, and 4 can also be selected, And will need to be, if playing multiple streams simultaneously.

A note on Mute/Unmute: If the zone or group is already muted before this automation activates, it will remain muted. The stream will still switch, but the audio won’t change. To fix that add another action:

Add Action > Media Player > Mute/unmute Volume > Choose Entity > Leave the “muted” toggle in the off position

If the stream is muted it will unmute it. If it isn’t, nothing will change. If the switch is activated, it will mute your streams instead.

Pro Tip: To avoid accidental muting, test the automation using the “Run Actions” function.

With that second automation we’re stacking actions, making the automation do just a little more. Let’s continue down that path with the next Automation.

Automation Three: Turn up the volume… slowly

This next automation will make use of some key features within the automation tool box. We are going to have the AmpliPro play a stream at a specific time and have the volume tic up 30% over the course of 15 minutes.

Let’s use the same setup as automation two, but as an easy shortcut let’s copy it.

How to:

Go to the automations menu: Settings > Automations

Automation two’s three dots > Duplicate

From here we can add some more actions
Add Action > Media Player > Set volume > Let’s set the volume to 60% ( This is a decent volume on my speakers, yours may be different)

Set volume set up

Now for the slow rise:
Add Building Block > Repeat > Count > type in 30

  1. > Add action > Media Player > Turn up volume > Choose entity
  2. > Add Building block > Wait for time to pass (delay) > pick a duration

Repeating action set up

To test it let’s choose 1 second as the duration. To make this automation a gradual wake up alarm change it to 30 seconds for 15 minutes, or more for a longer ramp up.

Test it, go to the Automations menu > click the three dots > Run Actions

Automation Four: Scenes! A Quick How To

Now the we’ve covered making combo actions, let’s add ‘Scenes’ to our toolbox. They can really help simplify multi device adjustments. Scenes: allow you to create predefined settings for your devices. Similar to a driving mode on phones, or driver profiles in cars, it can change an environment to suit you. For example, your watching films scene may dim the lighting, switch on the TV and increase its volume. This can be saved as a scene and used without having to set individual devices every time.

How to:

First adjust your lights, select and play your music streams, adjust the volumes, change any other Home Assistant devices or entities you would like to be a part of the scene.

Settings > Automations & Scenes > (top of the page) Scenes > Create Scene Select scenes

I’ll name the scene “Evening Chill”

Then use the dropdown menus to find the devices and entities you want as a part of this scene.

Last thing is to click save. That’s it.

Evening Chill scene set up

To activate the scene, you can add a button to your dashboard that will switch the scene on or off. Also an automation can activate a scene.

Automation Five: Pranking my boss

I want to create an automation that plays entrance music specifically for when my boss walks in the door. I’m thinking of John William’s: The Imperial March, from Star Wars. My boss isn’t an overbearing Darth Vader type, which means he’ll be a good sport and laugh about it.

How will it be triggered?

First: Home Assistant needs to know when my boss is present. Our office MikroTik wifi router has an integration with home assistant. Any device that has ever connected to it has an entity associated with it, appearing as either ‘Home’ or ‘Away’.

Second: It needs to wait until he walks in the door. He may not walk in right away and his phone would be connected in the parking lot. So I’ve hidden a motion sensor near the door.

Third: I need to stop the automation from triggering throughout the day. Turning it off should work.

Fourth: Then the last thing will be a second automation to turn the first one back on at 3 am, resetting it for the next day

Boss Vader Prank

  1. Trigger The motion sensor I discretely placed near the office entrance detects motion AND if Jason’s phone is connected to the wifi
  2. Select Source 1 for the group Everywhere
  3. Set the volume to 50% for the group Everywhere
  4. If muted Everywhere will be unmuted
  5. Play the music to Everywhere
  6. Repeat action 20 times: Turn up volume by 1% every 1 second. Note: While each step is set to 1 second, real-world execution may take closer to 3 seconds due to processing delays.
  7. Set the volume to 50% for the group Everywhere (This is during a quiet spot in the music, for subtlety)
  8. Selects the office’s default internet radio station
  9. Disables the automation. ( I named the automation Motion Ocean because I was playing with the motion sensor and that’s the first thing that popped into my head)
  10. Then in a completely separate automation, at 3am it turns Motion Ocean back on.

The Pay Off

With the automations live I’m now motivated to arrive to work early, actually the whole office is. I’ve asked everyone to play dumb and not point anything out. I wonder how long it will take him to notice.

Thursday – He came in oblivious and sort of hummed along towards the end.

Friday – There wasn’t much of a reaction from him, yet I’m smiling quietly in my cubical. Initially had the music kind of quiet, and that caused the initial volume adjustment to be quite noticeable, so I added one more automation to turn the volume up as soon as his phone connects that it should happen before he walks in the building.

Saturday and Sunday – He may randomly show up. If he does I won’t be here to see his reaction. But I also feel like that will be a dead give away that he has such dark and grand entrance music.

Monday – He didn’t show up over the weekend. Today he came in still quite oblivious to his entrance music.

Wednesday – He still didn’t notice. I tweaked the volume to be 5% louder.

Thursday – Still No reaction. The rest of us employees are joking about starting a betting pool on when he’ll notice.

Friday – Finally, he figured it out! It was a slow burn taking a week before he suspected us. He immediately suspected one of the engineers. (who was involved) When asked why “Star Wars” was playing, they played dumb: “I don’t know why it’s playing that song.” He wasn’t buying it and searched around the front door for the motion sensor. After not finding it, we couldn’t keep straight faces and confessed our involvement. I honestly think he was charmed that the whole office conspired against him. Ultimately, it became a team-building exercise: one engineer isolated the boss’s phone, I built the automation, and the rest helped test it and stayed quiet. As far as pranks go, this was pretty mild, but it gave all of us in the office a good chuckle. A good laugh

Conclusion

Automations can turn your smart home from a collection of gadgets into a real assistant that anticipates your needs, whether it’s waking you up with gentle jazz, setting the perfect movie night ambiance, or politely reminding your boss who’s really in charge.

This guide teaches you the basics to start building, but the real magic happens when you experiment. Tweak these automations, break them, and rebuild them into something that works for your specific needs.

Got a killer automation you’re proud of? Share it with our discourse community

Extra info and resources

I find it easy to become overwhelmed with everything Home Assistant can do, and when you add in all the preparation some of those things can take it’s even more so. For that reason I tried to keep the scope of this post limited to just Automations. That being said, I feel there are somethings that need to be mentioned before closing this post.

  • Blueprints are reusable automations and scripts that can easily be shared. The Home Assistant community shares the blueprints they’ve written on the blueprints exchange.
  • The Home Assistant Cookbook A collection of posts on how to perform common tasks and deal with common problems. This Guide is intended for those new to Home Assistant, those that are struggling for answers on some subjects, and those in troubleshooting mode. All of the Home Assistant Posts are made by Community Members and most are posted in Community Guides for your convenience.
  • This reddit post and this Home Assistant Community post, users share their favorite and most useful automations. These posts are full of a bunch of real world automation examples
  • Wanna peek under AmpliPi’s hood? Check out our GitHub Repo
  • Interested in buying and AmpliPro? Check out our Store.
  • Last thing, any questions? Email us at Support@micro-nova.com