Musings from Mars Banner Image
Building Smart Automations With Apple Home, Siri Shortcuts Icon
Building Smart Automations With Apple Home, Siri Shortcuts

Tags
Rejected Apr 02, 2021Home Page

Over the past few months, I've had a blast building out my smart home, using Apple's Home app as the foundation. Who knew how much fun it would be making things happen in the house without having to move a finger? I'm still at the beginning stages, but I thought it would be useful to document what I've done and learned so far.

Automating your smart home and life makes use of two apps that come with your iPhone: Home and Shortcuts. (The links to each in the following text take you to Apple's User Guide for for each app, which I would recommend perusing if you get lost.)

The Home app is where you add your smart devices, which must be HomeKit-certified. When you add your first device, you assign it a room, and as you build out your home, you add devices and rooms as you go. Each room can have its own image and settings, and you can easily navigate to each room in the Home app to see the status of your devices. The Home app's home page also displays all your "favorite" devices in one place.

To add a device, you plug it in or otherwise power it and then click the "+" in the Home app and select "Add Accessory." From there, you scan a HomeKit code (with your iPhone camera) that's printed on the device itself as well as on instructions in the box. Once Home establishes a connection to the device, you select a room and, depending on what kind of accessory it is, you might be offered the option to set automations for it.

Note that adding a HomePod to your home is a different process... again, very simple, and more like setting up an Apple watch. But the HomePods still end up in your rooms in the Home app and can be used for automations.

So, what devices have I added to my home so far? Lights, outlets, switches, a camera, and motion sensors. Except for a Wemo 3-way light switch (I'm still trying to get Belkin, which owns Wemo, to fix my problem), all of the devices have been easy to add to the home. Many of the devices have iPhone apps specific for their products, and some of these are useful. For example, Eve (a German company, the successor of Elgato) has an app that lets you customize its devices in ways you can't do in the Home app. The Wemo app is the only way you can update a device's firmware... an approach that has caused me problems, unfortunately. Some of these apps also offer ways to automate their products, but thus far I have stuck to using the Home app and the Shortcuts app for such automations.

A quick word about the devices I've selected... Some HomeKit devices want you to buy a separate "hub" for them to work. An example is the Philips Hue series of light bulbs. I've avoided all such devices, since with Apple Home and an iPhone or HomePod, you don't need a "hub". The HomeKit accessories I've bought and used all work without a dedicated "hub," and I think that's a good approach.

The automations I've set up fall in the following categories:

  • Setting schedules for lights going on and off.
  • Automatically turning lights on and off using motion sensors.
  • Setting music to play to a HomePod at certain times
  • Designing Siri Shortcuts to automate activities

Setting schedules for lights going on and off

In the lights category, I have several devices... Smart lights themselves, smart light sockets that take "dumb" bulbs, smart outlets and smart light switches. I started with Home simply by adding some smart bulbs to rooms where I wanted light at certain times of the day. For example, I have a bulb in our "Great Room" that I have coming on at Sunset and going off at 12:30 AM. In my "Music Room," I have a smart outlet that powers my desk lamp, and a bright smart bulb in a different fixture across the room. I have automations set up that turn these lights on at a certain time in the morning (prior to my starting work) and turn them off when my workday is done. To make things even more interesting, I have set up Shortcuts that turn the lamps off when I start a break and back on when the break is over.

Automatically turning lights on and off using motion sensors.

One of my favorite automations is in my Music Room, where I added an Eve motion sensor to a part of the room that would detect motion if I approached my boxes of factory sleeves or my shelves of records. I have an Eve smart switch installed that controls a bank of track lights, as well as a Koogeek bulb that's in an old wall lamp. Now, whenever I approach that part of the room, the lights go on, and I have the timer set (in the Eve app) to turn the lights off after 2 minutes.

I've used motion sensors in other locations with good results. I have one in the kitchen that turns a smart bulb on and off as it detects motion (or the lack thereof). I have one on the patio that turns on a bank of "party" bulbs, made smart by using a Wemo outdoor smart outlet. In this case, I have set the automation to only detect motion starting 30 minutes before Sunset, and I have set the motion sensor to wait 30 minutes before turning off if no motion is detected. Finally, I have one going down to the basement that's supposed to turn on the main lights using a smart Wemo 3-way switch, as well as, at certain times of the day, a bulb installed in a smart socket in another part of the basement. (Unfortunately, I haven't been able to get the Wemo switch to work, and am working with Belkin to resolve the problem. In a nutshell, the problem is that the device wants a firmware upgrade, but the Wemo app can't keep the device "registered" long enough to install the firmware.)

After our recent sojourn in Hilton Head, SC, I realized it would be helpful to have a camera in the kitchen, since no motion should be detected there when we're away. So I added a camera (made by Eufy) that let's me spy on the kitchen remotely.

Setting music to play to a HomePod at certain times

Another of my favorite automations was very simple to set up and brings my wife great joy. You can trigger an action based on when a person arrives or leaves home, so I set one up for Jackie when she gets home: Each time she walks in the door, the kitchen HomePod is playing one of her favorite artists — namely, Bruce Springsteen! I have the HomePod play Bruce's greatest hits, starting with "Born To Run." I can set the volume so it's not overwhelming, too. (Of course, this automation assumes she's carrying her iPhone with her, which is a pretty safe bet.)

We have a HomePod Mini in the bedroom, and I have it set to play music at two different times of the day. At 8:45, the HomePod starts to play "Forest Sounds," some ambient music available through my Apple Music subscription. Then, at 8:05, when my alarm goes off, I have a personal automation that uses a Shortcut to my "Folk/Folk Rock" playlist to start playing it in random order... all set to a reasonably low "going to sleep" and "waking up" volume ambiance.

Finally, I decided I'd like the HomePod Mini pair in my Music Room to be playing music when I start work in the morning, so I set up an automation to have them do just that.

One of the few problems I've had with these automations is that those that control a HomePod sometimes turn "Disabled" for no apparent reason. (You can enable and disable your automations manually in the Home app, but in this case the app disables the automation itself.) Fortunately, it's simple to set them up again, but it's still a nuisance that I hope Apple fixes.

Designing Siri Shortcuts to automate activities

Shortcuts App Icon

The Shortcuts app presents another opportunity for iPhone users to automate their day. Shortcuts are essentially custom Siri commands that do various things with the apps and data on your iPhone. They can also control devices in your smart Home, since Home is one of the apps on your iPhone. In addition to using voice commands, you can click on the shortcuts in the Shortcuts app to launch them, or you can save them as clickable "apps" on your home screen.

The app comes with a whole "Gallery" of example shortcuts in many different categories, and I encourage you to look at these and try adding a few to see what they do and how shortcuts work. I used a number of example shortcuts as the building blocks for the shortcuts I've set up, though it's quite easy to start from scratch. Essentially, shortcuts string together actions and data to automate commonly performed tasks with your phone.

I've divided my shortcuts into two main groups: Breaks and TV, and Music and Audio.

In the "Breaks and TV" group, I have a shortcut called "Morning Break" that lets me browse my music library for something to play, changes my audio output to the kitchen HomePod, and starts playing the music. The shortcut also turns off the lights in my music room. When my break is over, I have a shortcut called "Break Over," which stops the music and turns the lights on in my music room.

A more complicated shortcut is used for "Afternoon Break," and I've discovered a problem in Apple's implementation at this time that requires me to click the shortcut in the app to get it to work. A voice command to Siri won't cut it, unfortunately. So, I set an automation that launches the Shortcuts app at 3:30 (when my break usually starts), so it'll be there when I'm ready to start my break. The afternoon shortcut does the following things: It turns off the music room lights, turns on the Great Room lamp, runs a shortcut called "Indie Radio" that plays a playlist from Apple Music to my kitchen HomePod, waits 3 seconds and then launches the Stocks app showing the Apple stock price. Again, when I'm ready to go back to work, i say "Break Over," and that sets the lights appropriately and stops the music.

I also have shortcuts to wake and sleep my Apple TVs, which, when they work, will wake the Apple TV, turn on the TV and show the remote for the Apple TV on my iPhone. For some reason, these automations aren't as reliable as the others. I often have to say "Wake Basement TV" more than once to get Siri to do her thing.

In "Music and Audio," I have shortcuts to "Indie Radio," based on an Apple-provided shortcut, one that searches my library for "Beach Boys" and plays what it finds to my bedroom HomePod, one that finds my "Folk/Folk Rock" playlist and plays it, two that play different podcasts, and one that lets me add whatever song is playing to a given playlist.

One of the tabs in the Shortcuts app is for setting up automations with your shortcuts. At the top of the screen are Personal automations that are just for you and your iPhone. At the bottom are Home automations, which are the same as those you set up in the Home app.

In addition to the Shortcuts app, you can also create custom Siri commands in the Home app, where they are called "Scenes." For my home, I have several "Scenes," which essentially are commands that control one or more devices at once. For example, I have "I'm Home," which turns on several lights in the house, and "Good Night," which turns lights off. Just for fun, I set up "Reading The Paper," which turns on the floor lamp in the great room, and "Paper Done," which turns it off. Such scenes merely save a few words off saying, for example, "Turn on the floor lamp."

To sum up, my foray into the smart home has been a lot of fun so far. I keep thinking of new ways to save energy and time, and Apple has provided a secure and private platform to use, so I can feel confident that the devices I add to my home maintain the same standards that Apple does. Since all of these devices are WiFi enabled in some way, they present potential targets for hacking by outsiders. It's important to make sure your privacy and security aren't being compromised as you built out your smart home and life. Other HomeKit devices I'd like to set up eventually include a smart thermostat, a smart doorbell with camera, a smart water faucet for auto-sprinkling, and perhaps a smart deadbolt lock.

Just Say No To Flash