Hey there HA friends… just a stupid question here. Short Version: How do I find the content id from Hulu?
I’m trying to use HA to call a specific show to my chromecast. I can’t seem to figure out where to find the Hulu content id… can anyone point me in the right direction? I have been using the integration I am pretty sure came from using Nabu Casa subscription (been awhile since setup) and it doesn’t show the content id nor the TV show name on any frontend, nor in the developer tools. I have been trying desperately to login to the integration for casting from GitHub - leikoilja/ha-google-home: Home Assistant Google Home custom component, because I’ve read that it will expose this information, as well as unlock other abilities with the rest of my home products, but it won’t login, even though I’ve followed all the steps in the 2fa authentication issue. If anyone can shed light on any of this, it would be appreciated. I’m in the process of posting logs and whatnot in their issue. , but figured I’d ask yall for help in case you knew.
Try this using android tv integration through adb command
adb shell am start -n com.hulu.livingroomplus/.MainActivity" -a android.intent.action.VIEW -d https://www.hulu.com/watch/23ba33b5-4433-4649-9adb-5eec8068cdb2
If it doesn’t open using that code, try adding this just after the Hulu link -f 0x10808000
In any case it should call Chicago PD episode 1 ( since I’ve used that link ). Haven’t tested it since I don’t have Hulu subscription, but according to apk manifest, app should accept links with watch inside of them. Give it a go
Hmmm… thanks for reply. I tried both mentioned solutions. Unfortunately just sitting there at the home screen. Did you by any chance miss a quotation mark? I see a solitary mark in there, not sure if it’s supposed to be there alone or not?
My mistake, didn’t notice “ you can remove it and it should work then. I’ve accidentally put it there.
If it doesn’t work then, another thing to try is put “ around the link, at start and end of the link.
Also when putting command in, there’s no need for adb shell at the start cause it automatically puts that when executing the code
Hmmm. I feel like we are closer.
When you refer to apk manifest, you’re referring to the file required to make it run? If possible, can you show me what you see? I’d like to try to decipher it. I’m not too familiar with apks other than downloading and installing them. I’m fairly new to adb.
Screenshots of attempts. Maybe I’m just doing it wrong… forgive me if I’m coming off stupid, everything I know about code, I taught myself on Google. I’ve only recently started using the forums and posting.
I obsessively rename my ids lol. Tried it out, still nothing. Just the home screen still. I even tried manually opening hulu first to see if that would help.
Hmm then I’ve gotten a wrong activity for Hulu app launch.
Try this
adb shell am start -n com.hulu.plusx.activity.PlayerActivity -a
android.intent.action.VIEW -d
"https://www.hulu.com/watch/23ba33b5-4433-4649-9adb-5eec8068cdb2"
Or this
adb shell am start -n com.hulu.plusx.activity.PlayerActivity -d
"https://www.hulu.com/watch/23ba33b5-4433-4649-9adb-5eec8068cdb2"
Managed to find the manifest file here where I got the plusx activity. As for what manifest is, it’s basically an xml file inside android apps that has these activities inside them that we use in android tv integration to open an app or do whatever
This part is what you use hulu.intent.action.LAUNCH_VIDEO_ID Instead of the com.Hulu part. But I’m not sure that’s it. Can’t really play a guessing game since I don’t have Hulu nor I can install it.
It would be easier if you’ve install a terminal type app on your phone or have it on your laptop or desktop pc, install adb Shell, connect to home assistant instance through terminal then while in there,connect to your Android tv using adb shell connect command , then run this adb shell logcat > output.txt command, then launch Hulu, then stop the command in terminal by hitting ctrl c. In the output.txt there will be a log of what was happening on your tv behind the scenes and since you’ve launched Hulu it should give Hulu activity you need to launch Hulu through home assistant and hopefully launch a tv show using a link.
And only thing that crosses my mind is that entity there isn’t your android tv integration but chromecast integration and you can’t send adb commands to a chromecast integration, only to the android tv integration.
Firstly, thank you for trying so hard for an integration you don’t even have, this is the kinda thing I would do with the knowledge too. I bet this is like a puzzle to you.
I’m gonna try this out here in a bit.
I can put your mind to rest though, I’ve been sending it the right direction. - I had mentioned my obsessive naming of entities and devices, I even format them the same… “ROOM - DEVICE - PERSON(if applicable)”
“Chromecast” indicates the entity from the Android TV Python Integration.
“Cast” indicates the entity provided by the HA Cloud Google Integration.
I actually tried the commands via ADB Shell and everything I tried said I had a bad component. I can post results in the morning.
Oddly absolutely 0 logs in HA for me calling the service.
The ADB Shell produced these logs, so I’m thinking I need to figure out the command in here and then try it in HA.
C:\Users\Prono\Downloads\platform-tools_r33.0.2-windows\platform-tools> adb shell am start -n com.hulu.livingroomplus/.MainActivity -a
android.intent.action.VIEW -d
"https://www.hulu.com/watch/23ba33b5-4433-4649-9adb-5eec8068cdb2"
Exception occurred while executing:
java.lang.IllegalArgumentException: Argument expected after "-a"
at android.os.ShellCommand.getNextArgRequired(ShellCommand.java:327)
at android.content.Intent.parseCommandArgs(Intent.java:7058)
at com.android.server.am.ActivityManagerShellCommand.makeIntent(ActivityManagerShellCommand.java:316)
at com.android.server.am.ActivityManagerShellCommand.runStartActivity(ActivityManagerShellCommand.java:408)
at com.android.server.am.ActivityManagerShellCommand.onCommand(ActivityManagerShellCommand.java:171)
at android.os.ShellCommand.exec(ShellCommand.java:104)
at com.android.server.am.ActivityManagerService.onShellCommand(ActivityManagerService.java:9826)
at android.os.Binder.shellCommand(Binder.java:881)
at android.os.Binder.onTransact(Binder.java:765)
at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:4516)
at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:2741)
at android.os.Binder.execTransactInternal(Binder.java:1021)
at android.os.Binder.execTransact(Binder.java:994)
C:\Users\Prono\Downloads\platform-tools_r33.0.2-windows\platform-tools>adb shell am start -n com.hulu.livingroomplus/.MainActivity -a
android.intent.action.VIEW -d
"https://www.hulu.com/watch/23ba33b5-4433-4649-9adb-5eec8068cdb2"
Exception occurred while executing:
java.lang.IllegalArgumentException: Argument expected after "-a"
at android.os.ShellCommand.getNextArgRequired(ShellCommand.java:327)
at android.content.Intent.parseCommandArgs(Intent.java:7058)
at com.android.server.am.ActivityManagerShellCommand.makeIntent(ActivityManagerShellCommand.java:316)
at com.android.server.am.ActivityManagerShellCommand.runStartActivity(ActivityManagerShellCommand.java:408)
at com.android.server.am.ActivityManagerShellCommand.onCommand(ActivityManagerShellCommand.java:171)
at android.os.ShellCommand.exec(ShellCommand.java:104)
at com.android.server.am.ActivityManagerService.onShellCommand(ActivityManagerService.java:9826)
at android.os.Binder.shellCommand(Binder.java:881)
at android.os.Binder.onTransact(Binder.java:765)
at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:4516)
at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:2741)
at android.os.Binder.execTransactInternal(Binder.java:1021)
at android.os.Binder.execTransact(Binder.java:994)
Getting Closer to the root of the issue I think.
from the first one on your last post:
C:\Users\Prono\Downloads\platform-tools_r33.0.2-windows\platform-tools>adb shell am start -n com.hulu.livingroomplus/.MainActivity
Starting: Intent { cmp=com.hulu.livingroomplus/.MainActivity }
Error type 3
Error: Activity class {com.hulu.livingroomplus/com.hulu.livingroomplus.MainActivity} does not exist.
Then the second one:
---- SOAB! IT LAUNCHED! IT EVEN STARTED UP THE LAST THING I WAS WATCHING!
You’re awesome! Now, how to direct it from here?
Then if second one launched Hulu, you should try this command
adb shell am start -n com.hulu.livingroomplus/.WKFactivity -a android.intent.action.VIEW -d "https://www.hulu.com/watch/23ba33b5-4433-4649-9adb-5eec8068cdb2"
Or this
adb shell am start -n com.hulu.livingroomplus/.WKFactivity -d "https://www.hulu.com/watch/23ba33b5-4433-4649-9adb-5eec8068cdb2"
But huh buh buh buh buh! (Trumpet sounds) you are awesome. I’ve now launched Chicago PD ep 1. I guess now I need to try another url, but do you think it’s possible for me to have it continue the show from where it left off vs calling a specific ep?
Edit: I figured out how to pull the menu for How I Met Your Mother up, now I can follow it with a CENTER command and it should play. This should resolve my issue. The main issue was that when you voice command the Google Assistant to play a Hulu show, then it only pulls up the menu, you still have to press center, which to me kinda defeats the entire point in voice commands…
Now I need to figure out how to make it automatically press center after I’ve told it to play any show on Hulu without having to customize an automation for each. Is this possible with Templating? Not sure how I could go about creating a custom voice command with variables, but I was thinking more of a way to get it to automatically hit the button by recognizing that Hulu is on a menu?