Channel Navigation

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?

1 Like

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:

http://192.168.1.99:57000/api/play/channel/4.1

(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.

1 Like

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?

1 Like

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...

1 Like

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.

1 Like

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?

2 Likes

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!

2 Likes

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.

2 Likes

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!

3 Likes

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 :slight_smile:

2 Likes

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!

2 Likes

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.
Jeff

1 Like