In the Shortcuts app, when I search for "Wait," it shows up as an available command under the heading of "Scripting." It's referenced on this page, maybe will help?
An automation I set up early on, was one that senses when the TV is turned off (usually if I was using a different remote) and in turn, stops any playback happening on the AppleTV. Otherwise there were situation where the AppleTV was left with content still streaming, even though the TV itself was turned off. This automaton fixed that.
Via this HomeKit capability, I also set up some Siri shortcuts for the bedroom TV:
- Turn only the display off, while still playing the audio of whatever is on (sometimes helpful when I’m falling asleep, otherwise the TV screen can be too bright)
- TV speaker mute in 30 minutes
- TV sleep in 15 minutes or 30 minutes. Channels has its own sleep timer, so I use this version with other apps.
I’m sure others have more ideas to share…
Thanks for your time and patience Fofer, I don't mean to belabor the point, but the blind thing can be a challenge at times. I am certainly sticking with this as it seems to offer quite a bit of potential.
It's my pleasure to help. And I'm happy to explain anything else, as best I can at least. I'm also looking forward to your reports of more success. I'm inspired that you've come this far despite your challenges. I assume a screen reader is how you navigate but without the benefit of pictures and screenshots I think I'd feel lost and frustrated if I was trying to learn how to do something on a device like this. I'm impressed by your patience too. This stuff can be complicated even for sighted people! But the reward is oh-so great, when it all works together. And it sounds like you're really close. Channels is a uniquely premiere platform for such customizability and flexibility, in precisely this regard. I know I enjoyed learning how to make these voice commands work and it's great to be able share the excitement. The building blocks are fun to play with. Ah, when things work exactly the way they were programmed! So cool! Enjoy.
Ok, making some progress, thought I had it, but when trying to run the shortcut, it won't run. I created this shortcut on the living room ATV, not the bedroom ATV. Any thoughts?
The shortcut you've designed there will launch Channels, but on the iPhone itself. What you want to do instead, is have your shortcut send an API command to the Channels app that is running on the AppleTV. It may sound daunting but it's really easy to handle, once you get the right ingredients into place.
First you will need to know the IP address of your AppleTV. You can get that via the AppleTV, Settings → Network. Ideally, you can configure your network's router so that this device's IP address never changes, so these API commands you're sending can always reliably find their target. I use DHCP Reservations with my router but manually assigning a static IP on the device would work too. This is kind of a digression, but here's some reading about that which might help on that front, at least conceptually speaking, not knowing anything about your LAN. DHCP IP reservation or Set a Static IP address for a device - Google Nest Help
Once you know the IP address of the target AppleTV, here is the command you would have your shortcut send, as "Text" to have it tune into NBC on the Channels app that is running on that AppleTV:
(192.168.1.99 is my IP address, and my NBC channel is 4.1)
(so replace those with your own)
That's really all there is to it. Here's a screenshot of mine if it helps:
I'm using the Channels Beta (via TestFlight) but that shouldn't matter in this context.
By the way, I included those "1 second wait" commands because my TV's are relatively ancient and slow, lol. And my Channels DVR guide and library are large, sometimes needs a beat before I can control it via the API command. You may not need those, if your TV wakes up faster, or your Channels DVR launches faster from a cold boot.
Test it out, play around and see what works best for you and your own hardware, setup and flow. It's easy to experiment and customize and hopefully you find it fun, too.
Yup, yup...after changing the #1 shortcut to bedroom ATV, the shortcut ran, but on the phone as you described.
Today has been a mammoth leap as far as understanding just how Shortcuts works.
I understand the final action on my shortcut needds to be the text & LAN location of the bedroom ATV. I hope I don't have to reserve the same IP. My router doesn't have a web-client, just an app that is not VoiceOver friendly. TP-Link Deco XE75Pro.
Thanks so much...so close...I'm geeked.
Have you tried http://192.168.68.1/ for the router web ui?
That's a good idea, but I also wouldn't worry if that route doesn't get you there, or if the admin app (that isn't voiceover-friendly) isn't configurable enough either. You could also just set your AppleTV to a manual IP address via Settings → Network. My advice would be to test the API command first to make sure it all works, and then manually assign the current IP. so it won't change on the AppleTV without you knowing about it.
My AppleTV uses Ethernet, so in my case, under that setting I'd change "Configure IP" from "Automatic" to "Manual," which then just saves the current dynamically-assigned IP onto the device itself. Sure, using DHCP Reservations via the router would be preferable, but not being able to set that up shouldn't derail you from making these shortcuts work in any way. Just tossing out ideas for you to consider along the way...
Thanks! Seems pretty rudimentary. Really appreciate the help.
Ok, tried the revised Shortcut, went well except the TV came up to the guide, instead of tuning to channel 1041. A possible gotcha...I have the tvOS app set to open to the guide when selecting the Channels app from the home screen grid....not sure if that could effect things.
This is how the current shortcut is configured.
The final step is POSTing that command. You have to add an action that will “Get Contents” (of that text field, that has the API command) and tap the fold down arrow underneath to configure it so “method” says POST and “request body” says JSON. Here is another screenshot:
The first time you run this, you may get a pop-up on the iPhone, asking if you’re intentionally sending a command over your network to control another device. Approve it once, and the permission you grant, will be remembered. Shortcut achieved!
Now you can easily duplicate a working shortcut and just change the name and channel number so all of your favorites are covered.
Instead of doing text + custom post, can't you use the Channels shortcuts we built into the app a while ago to send commands to other clients?
Well I’ll be darned, yes, that works too and is certainly MUCH easier. Sheesh! I must have set up these API-based shortcuts long ago, and didn’t realize it’s way more approachable to set up now. I’ve just been duplicating and customizing the original working template when adding new shortcuts. Thanks for the news and clarification!
doublejskid, instead now you can just search for the “watch” action and choose the one that says “Watch Channel on Other Device.” Configure accordingly via the menus that pop up when you tap on “channel” and “other device.” Sorry for the distraction! I hope this gets you past the finish line!
Also, if you use our shortcut actions, you don’t really need the wait actions. It will continuously try until it times out.
Once you see our loader screen, it will be able to accept those shortcut requests, and queue them, and act on them once loading is done.
So it only has to wait for the app to boot which takes like 250ms.
Oh, that's also very good to know too! I set up these shortcuts quite a long while ago obviously and my TV's were (and still are) pretty old so at least the first wait command seemed necessary as I tested. I think without the wait commands, my success rate with these as Siri shortcuts was about 75%, whereas with them, the success rate was 100%. doublejskid is better off starting without them. Good to learn about all of these details, though. I've gone in and updated all of my shortcuts now too to experiment and learn more. Glad to be having this conversation!
No problem! Also, it stands to mention at this time... now with the new & improved method mentioned above, of sending the "Watch Channel on Other Device" action, you no longer need to worry about what your device’s IP address is and how it’s been assigned. Now, the Channels app and the shortcuts you've customize for it should handle all the tech details for you. So it's pretty much 10x easier than what I was initially instructing
There is a chance the ip could change out from under the shortcuts.
The devices are updated for the shortcuts everytime the Channels app is opened though.
It goes without saying, if you’re doing automation shenaningans with devices like this, always use the DHCP reservation feature of your router to make sure things are stable.
How's it going, @doublejskid? Was curious to hear if you got those shortcuts dialed in, in a way that's working great for you.
I saw this thread today and learned something new, so I figured I'd share it here too and pass along the favor!
Things are going great! It took a little bit to get how shortcuts work, and I'm certainly no wizard, but I definitely know enough to get in trouble. haha Aside from the ATV remote, which my wife hates, (I love not having a massive amount of buttons), the switch to Channels has been great. And thank you for sharing this as well!
Hope you and yours are doing well.