Auto selecting a specific channel in my cable provider’s app (HELIX) on Fire TV using Home Assistant - The deep rabbit hole! #552
Vincent9993-git
started this conversation in
General
Replies: 1 comment 1 reply
-
I completely understand! It's not an easy task! Too bad you didn't see these handy resources I created before you started your journey:
Hopefully I can save you some time on the Power on/off step with this:
Who knows, maybe we can figure something out on the deep linking front while I work through your issue #550. -Doug |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Auto selecting a specific channel in my cable provider’s app (HELIX) on Fire TV using Home Assistant
Deep rabbit hole!
1st thing was to get FireTV to talk to HA
Simple enough I though, just look for that device in HA detected devices and click configure. Nope! You need the Android Debug Bridge. Ok, let’s look for that. Thankfully there’s a complete guide to integrate androidtv to HA on the Home-Assistant website. https://www.home-assistant.io/integrations/androidtv/
Debug mode what?! I have to turn on some sort of debug mode on my Fire TV. Ok, My Fire TV -> Developer Options -> … Wait, I don’t have that option… Grrr What gives?! Back to the web for looking on how to enable Developer Options. Of course, it’s the 1st search result and how did I not know the process… Settings, My Fire TV, About and smash the device name a bunch of times until system complains that the option is already available… Ok, where was I? Yes, add the Fire TV to HA. Back to the guide.
Great now I have my Fire TV accessible by HA. Ok, so how do I tell HA to launch a specific application I wondered… Can it be as simple as looking for an Entity of the ADB/FireTV device I wondered? Nope! Turns out you need to call specific ADB commands to launch it. What’s the command I wondered. More searching was in order…
As I crawls the web for clues on how to control the Fire Stick, I come across a git repository to install a plugin called HA-Firemote. Great, that should give me a good start in understanding how to send commands to my FireTV. Let’s get that installed. Wait! There’s no “Open ADD-ON Store of MY…” link what gives? Ah, I need to install HACS to have access to that app. Makes sense, sure. Lets look for HACS… Again no “Open ADD-ON Store of MY…” for HACS but the installation instructions are straight forward enough: https://www.hacs.xyz/docs/use/configuration/basic/
Ok, what am I trying to do again I wonder?! Ah yes, trying to get my TV to launch my cable provider’s app and auto select a channel. Got it. What’s next? Install Firemote from HACS. Ok, so the git project has good enough instructions to get it loaded. Wow, look at that I have a remote that looks exactly like my FireTV physical remote. Let’s add it to the dashboard and edit the YAML code to see how they’re launching applications. Wait what?! This thing only has 8 lines of code?! Seriously?! Grrrr… Ok, it allows for adding an app launcher button. Let’s see here, where’s my cable provider’s app… Nope not on the list of course.
Back to some web surfing and land right back on the Firemote git page with a form to submit an application launcher request. Ok, let’s send it in and hope someone is still monitoring this project. Perhaps they can share the code on how to send the launch command natively. Let’s fill this in… App Name: Helix, Device platform: Amazon Fire, App store link: No idea but not mandatory, ok let’s skip that question. Required information box… Ok what goes in here? Oh there’s a link to guide me through that. Let’s go! Providing Details for App Launcher requests. Dev tools, Actions, Yes, Ok, Got that, Ok, adb shell command…, got that. States, ok great got the info. Let’s complete the form, Optional comments? None. Submit.
While I wait for “maybe” a response, let’s continue to search the web. Maybe I can use the info I just sent to try to figure out how to submit my own app launcher command… Breakthrough, the git code has the launcher commands… Let’s try one that already exists in the Dev tools Actions. Sure enough, it starts the app. Ok, I should just have to enter one of the lines I just extracted and sent on the form earlier right?! Right!?
Ok but which line? Let’s try a few, nope not that one, not this other one either. Ok that’s not working. Let’s extract the data for one that’s working and compare what line was used. Start up Amazon TV, extract the data and compare to the launcher and, yup, it’s the 1st line. Ok, what am I doing wrong? Back to searching. Ah!!! There’s a post on the git project describing that the data extracted works 90% of the time but when it does not, to use another command: “adb shell pm dump [name]”. But what’s the stupid name again? Let’s try one we got from the 1st command. Would you look at that, I have more info in the STATES page. Let’s try some of those with the launcher command. BINGO: One of these launches the app! PROGRESS.
Out of guilt, I thought I’d post an update to my ticket for the app launcher request detailing my findings. No more than 30 seconds later, I get a response asking me how I figure it out? I reply with my search journey so far and push my luck in asking about how to get the app to tune to a specific channel and the admin, PRProd is very responsive but tells me that he’s not gotten that far but to look into something called “deep linking”. Great that’s a new vector to search. At least I won’t be getting the same pages I’ve been re-visiting over and over!
Deep Linking he said right? Ok, no not this page, wait what’s this? Ok, yes, maybe, no, Ah! Ok found something, no that does not apply to Fire TV. Not getting anywhere on this one. I’m off to bed… As I put my phone on the charger, I think to myself, “What would ChatGPT say”. Let’s ask… Wow, that seems like a good try. Let me sleep on that.
Back at it… What did ChatGPT say again? I roll up my sleeves armed with newfound information. Ok 1st command: “adb shell pm list packages | grep helix” : nothing. How about: adb shell dumpsys package domain-preferred-apps? Ok, that gives me something… But that’s similar to what I already have. How about: adb shell dumpsys package com.videotron.helix.tenfoot? Response: Private flag somethigs. Let’s feed this back to ChatGPT. It comes bask telling me that this indicates that the app is set to private and I won’t be able to extract that info using this method. I need to pull the AndroidManifest.xml file. Easy enough right? How wrong am I?!
So ChatGPT, how do I get that xml file? You need to export the base.apk, decompile it and edit the AndroidManifest.xml. Ok how? I install adblink and get it connected to the Fire TV. TV complains about granting authirization and allows me to connect. Ok how do I use this thing? There’s a file manager… Ok ChatGPT, where’s this base.apk file? Ah I need to run an adb command to find it’s path. Of course! Back to the Developer page and run “adb shell path com.videotron.helix.tenfoot” and it spits out the file path! Woohoo, progress! Back on the adblink File Manager, “Data”, yes got that… Wait, it’s empty! Ah probably hidden folder or something. How do I see hidden files and folders on this thing. Back to searching…
Unhiding files, simple enough, sure! Let’s try the Console and run some commands… Some command with a +r argument, not working… Think… Oh use the sudo thing, that should do the trick?! Command not found. How about “su”? Command not found. Grrrr… Let’s try that File Manager again. There’s a “Directory” box at the top, let try to navigate directly to the path I got earlier… Wait, what? That worked! Cool. Now I need to “pull” the file. Hit Pull, confirm, done. Ok but where’s the file? Back to command prompt for a “dir base.apk /s” to locate the damn file. Here it is in my users’ folder. Ok, now what was next? Yes, decompile the file…
I need APKTool, let’s look for that. Ok make sure java 8 is installed… I’ll worry about that later. Download the .bat file, download the .jar file and rename it. Done. What did ChatGPT say the command was for decompiling the file again, ok got it. Folder not specified… Fine here’s a folder name. Bam! A bunch of files get decompiled and the elusive AndroidManifest.xml file is right there. Let’s see what’s in there… Wow that’s a lot of info but what am I looking for, I have no idea. I’m like the clueless person on the side of the road with the hood open looking at the broken engine of his car hoping to see a big reset button to get going again.
Ok, it’s now Friday afternoon and I’m overdue for a beer and I’m parking this for now. I’m not sure if I got any closer to my goal. This seemed like such a simple task, it’s frustrating. I still need to learn on how to send the turn on/off command and I’m not getting anywhere on auto selecting a channel inside the app. Maybe beer will help!
I decided to post this here as therapy for me and others that have found themselves in the deep rabbit hole before me. Thanks for having gotten this far!
Beta Was this translation helpful? Give feedback.
All reactions