-
Notifications
You must be signed in to change notification settings - Fork 5
Control HTWebRemote on iOS Devices Including Apple Watch and HomePod
This page will explain how to conveniently send HTWebRemote commands from your iOS device, Apple Watch, Mac, HomePod, and even trigger commands with Siri.
To do this we will use the official Apple Shortcuts app which you can get from the App Store here: https://apps.apple.com/us/app/shortcuts/id915249334
The Apple Shortcuts app may at first seem a little complicated, but in this page I will explain how to easily use it with HTWebRemote.
Apple Shortcuts is simply an app that lets you create "scripts" that can run on your Apple device. These scripts are constructed from a series of steps (blocks) and it's almost like a basic programming language. The main block that we can use to send a message to HTWebRemote is the "Get contents or URL" block. This will be used in conjunction with the URL Command API mode of operation for HTWebRemote.
We can create a basic Shortcut to send a single command to HTWebRemote like this:
Here we are using 3 blocks:
- Dictionary (to store a few values like the IP, devname, cmd and param)
- URL (to build the URL link from some entered text + Dictionary values)
- Get contents of URL (to actually contact the URL)
Shortcuts automatically link the steps together in most simple cases like this and you can see the lines indicating the steps flow from one to the next.
You can download a copy of this Shortcut Template from here: HTWR - Command Template
All you need to do to start using it is to fill in the values in the Dictionary.
There are a few ways we can do this, but the most simple way I think is to create a Shortcut that simply runs multiple Shortcuts. You can even put a Wait time in between each Shortcut if you like. So simply copy the Basic Command Shortcut a few times, enter in all the information into the Dictionary for each device / command, and then in a new Shortcut call all your other single command Shortcuts.
Example:
You can download a copy of this Shortcut Template from here: HTWR - Macro Template
You can build an interactive Shortcut that opens up a menu, letting you choose from a list of commands. This can be useful if you have a lot of different commands you want to organize under a single Shortcut. For example, choosing which Input you want switch to on your HT device, or choosing from a list of volume levels.
An example Shortcut would look like this:
You can download a copy of this Shortcut Template from here: HTWR - Menu Template
You can get super creative with these menus, even building cascading menus multiple levels deep.
This can be useful if you already have a nice macro button created in HTWebRemote and you want the Shortcut to automatically be updated if you change the button commands in HTWebRemote for that button.
To do this we can use a Shortcut like this:
remoteID should be self-explanatory, it is the Remote ID where the button is located in HTWebRemote.
btnIndex can be found here:
Simply click the Url-cmd link, and you will get a popup window that contains the remoteID and btnIndex for that button which you can put into the Shortcut.
Keep in mind that the btnIndex will change if you modify the remote in HTWebRemote (particularly if you add/remove any items on the remote that come before your button). So you will need to check for the new btnIndex and update your Shortcut.
You can download a copy of this Shortcut Template from here: HTWR - Remote Button Trigger
Using Siri to trigger a command is as simple as saying "Hey Siri, shortcut name" So if you create a shortcut that runs a macro that turns on all your HT devices, and name the Shortcut "Start Theater", you can just say "Hey Siri, start theater" and that's it.
These Shortcuts should also automatically sync to your Apple Watch and HomePod via your iCloud account, so triggering a Shortcut by saying it's name should work even if only your Apple Watch or HomePod hears you.
Another convenient way to run Shortcuts is via Widgets. Widgets can be placed on your iOS home screens or in the menu when you swipe right, as well as on an Apple Watch and even on macOS. To do this, create a folder within the Shortcuts app and move all the Shortcuts that you want to be available from a Widget into this folder. Then on iOS, add a Shortcuts Widget to the Widgets and drag it either to the home screen or leave it over in the Widgets menu, and configure the widget to link to the folder you created.
It can look like this:
You can also just add Shortcuts to the home screen as simple app icons.
You can control some of these settings by long pressing on a Shortcut from within the Shortcuts app and choosing "Details" to get to this screen:
Apple Shortcuts is an incredibly powerful Apple app with so much flexibility. I can't possibly list all the things you can do with it here and Apple adds new functionality to it usually each major iOS update. There are even third party apps that add more function blocks into the Shortcuts app like: https://apps.apple.com/us/app/actions/id1586435171
But just to get an idea, you can do things like have the Shortcut prompt you for text input which you can then enter in a few letters or numbers which can then feed into the Shortcut to perform a different task like set a custom volume level on your AVR. Or you could program in a back-and-forth with Siri prompts that lets you control things and make choices all completely hands-free.