[RELEASE] FireTV Driver for Hubitat using ADB (without other hardware)

Sharing a working driver to control 100% an Amazon FireTV Stick directly from Hubitat, without any other hardware.

Hope is useful for more users!

Cheers.

8 Likes

Interesting :face_with_monocle:

What can this be used for. Could it be possible to open a specific app - for instance an IPTV app for watching the football (asking for a friend :laughing::laughing:)

Edit: I had a peek at the code. It looks as though I should be able to add an app in there to the existing list :+1:t2:

Hi @johnwill1

Right now it has the basic Apps (netflix, amazon, disney +, hbo, youtube, apple tv) Ready to launch.

You can find out the codes for the others, and of course add to the list!
Hope it helps!

Should this work on a FireTV stick 4K? I tried it and it showed a 'connected' status, but none of the commands worked and I never got a pop-up for authorization on the FireTV.

Did you enable de Developer Mode and allowed Unknown apps in the Fire TV settings?

(instructions here: How to find/show/unhide/reveal Developer Options on an Amazon Fire TV Stick, Fire TV Cube, or Fire TV Smart TV | AFTVnews )

This driver will probably stop working once Amazon launches their devices with the New OS , but probably another API or method will come out at that time.
Until now, all devices with Android should work as they use ADB for comm.

Yes, I was able to connect and control my FireTV from Home Assistant, but can't get this to work from either of my hubs (a C7 and a C8-Pro).

It’s worked for me on my C8 Pro. I made sure ADB debugging was turned on. It didn’t work initially but then I clicked the ‘Generate new key’ command and tried a command again at which point I got the permission pop up on screen (not sure if that’s relevant or not)

Thanks

I've had a message around with the code:

  • I've found the app intent of my IPTV player app and added that and it's working great
  • I've gone through and translated the comments and logging to English

I've noticed that the states don't seem to update for 'Current App' (unknown) and 'Switch' (off) . If I click the 'Get Current app' there are no errors:

That's great!

I will try and work on the states with the CurrentApp
Any other ideas let me know!

I'm having a play with ChatGPT currently which is suggesting two changes. I'll post if successful (I'm clueless with code so rely on AI)

Edit: I have current activity updating from the command (need to test it when switching between activities) I need to amend it to show a friendly name, rather than ‘com.someapp’.

Of course my ChatGPT fixes might cause other bugs…

New version available, with current app as an attribute

  • Added functions and defs to use the same commands that Samsung Remote uses (arrowUp, arrowLeft, etc)
  • Added Function "appOpenByName", to receive the string(name of App, ex: Netflix, Amazon Prime, YouTube)
  • English logs
  • Added CurrentApp attribute parse with poll every 30 seconds (configure in preferences)
3 Likes

Nice work. Sounds like some XDA level stuff :o

I control my TV on/off from the Firestick remote. Do you know if that capability is available?

1 Like

@hhorigian,
Nice job, good to see that Android TV drivers with ADB support coming to Hubitat (I will soon retire another app(s) from Home Assistant - Android Debug Bridge / Android TV Remote!).

I have tested on a Google TV Streamer (Android) and the basic functions work.
Not sure if you are also getting the intermittent prompts to re-authorise allow USB debugging (even after selecting always allow) ?

Logs

As this is working on Android TV - probably best to change title to reflect this :grinning:

Showing my age :flushed:

I thought ADB was the “Apple Desktop Bus” :roll_eyes:

Hi @iEnam

Didn't have other Android device to test, good to know.

I did an update for the repeated authorizations.

Check hope it solves

1 Like

No, that TV control is stored locally in your FireTV remote control as it probably does it via IR/Bluetooth.

1 Like

I was already testing this version.
Unfortunately, the repeated prompts still persist.

Logs

Hi @iEnam - I did an update to try prevent the popups.
Code in github

Let me know.

2 Likes

Thanks for the update - this is working much better now, so far it has not failed, apart from the two exceptions below :slight_smile:

During this quick test, I've noticed a few issues relating to adb and other button functions:

  1. Saving preferences resets ADB authentication
  2. Reboot also resets ADB authentication - not sure if this can be fixed?
  3. Seems to be keeping authentication with Internet blocked, will need to test longer.
  4. English language text needs further improving
  5. Launch Prime Video and YouTube not opening for me (Google TV Streamer); Netflix and Disney Plus working.
Summary