[Deprecated] Native support for Fire TV

Is it possible to add HDMI switching? Running it with the adb shell command wont work.

I have latest version of Fire TV stick and did not get pop-up “always allow connections from this device.”

And I also do not have it as Media control entity in my HA

Is it possible to integrate this with the new official adb hassio addon by @frenck

I am using the androidtv custom_component with official adb addon by Frenck (Community Hass.io Add-on: ADB - Android Debug Bridge)
Stability of connection is amazing.

The official FireTV component didn’t work for me. Always showed Unavailable (with one or two state changes in b/w)

AndroidTV custom_component doesn’t seem to be recognizing play/pause/idle or the current track playing on FireTV cube.

Would be amazing if stability of adb addon can be combined with firetv specific code?

Thanks

1 Like

@JeffLIrion Is there any functional difference between the firetv and the androidtv custom component?

1 Like

I just posted this in two other threads, but here it is again.

Regarding the Fire TV component, this is already implemented in my custom component. I’m working on getting it integrated into the official component.

Configuration example:

media_player:
  - platform: firetv
    name: Fire TV
    host: 192.168.0.111
    adb_server_ip: 127.0.0.1

Comparing the Fire TV and Android TV components, I haven’t tried the Android TV component, but there are some device-specific tweaks and so I expect that each component will work better for its intended devices.

2 Likes

Reposting here for others. Original comment: Home Assistant Community Add-on: ADB - Android Debug Bridge

Awesome. Working well with new addon.

Will keep testing and report back.

recognizes Home as Standby so that’s good. On opening Netflix recognized app as Netflix, and showed Paused. However on playing, state remained Paused.

Will try out with other apps as well. Thanks a lot for the amazing work.

@JeffLIrion
I’m getting the same as @forums2012 above.
Remains in paused state when app is open and playing, though it doesn’t seem to recognise Plex, nor does it pull a list of apps.

1 Like

State detection has its limitations. It can’t always determine playback status accurately.

As for the list of running apps, please delete any firetv and firetv* folders in the deps folder in your configuration directory and then restart Home Assistant. This will cause it to install the latest version of the package from GitHub. Please let me know if that fixes the running apps!

Ahhh cheers.
Well, after doing that it picked up the Plex app, so that’s progress.
Can select Plex, play, pause, forward, back.
Can’t power on though. Ah well. May require a little more figuring out on my end.

I just updated my firetv fork, so if you repeat the same steps from earlier the turn_on function should work.

I may be looking at the wrong repo but this one is showing last push was 2 months ago?

  1. You’re looking at the wrong branch. This is more current: firetv.py
  2. I didn’t update the component, I updated my forked firetv repo.

Gotcha. That worked. Can now turn on via the component.

Looks like it’s just picking up whatever app it first detects.
Eg
if the firetv is off when I restart hass, when it turns it on it detects the home.
If the firetv is on with an app open when I restart hass, it just detects that app in sources.

Deps were cleared after updating the component

Edit: sorry for using the forum for issues

It should get a list of whatever apps are running, which it will show as sources. Does it not do that?

Afraid not.
tested with no apps running, restarted hass, and it just saw the launcher.
Tried with multiple apples running, restarted hass, and it only had plex in the list (though multiple were running but i was at the launcher)

I am running using an adb server rather than built in if that helps

I think I fixed it. Please remove those folders again, restart HA, and let me know if it works.

Yep that worked.
Showed running apps in source though if app hasn’t been started then didn’t appear until it had been started on the fire.

Would it not make more sense for source to list installed apps instead? Allowing HA to open apps that aren’t already running in background?

"pm list packages -3"|cut -f 2 -d ":"

^ would list user installed apps, then adding known pkgs such as com.amazon.tv.launcher and other preinstalled apps would be a more useful sources list would it not?

I guess pushing aapt to a temporary directory on the device to be able to get an array of these app id’s and their friendly names would be a step too far though… :joy:

You can launch an app from the component, just use the media_player.select_source service.

Showing the installed apps is an interesting idea. The list might be a bit long, though. Either way, I think adding an installed_apps property would be a good contribution to the firetv package.

1 Like

Apologies yes, I misworded my comment. My line of thought was that as it picks that up from the running_apps property that on a freshly turned on firetv it wouldn’t appear on sources list until you’d manually launched it, so you’d either need a way to set apps you know you’ve got installed in either an automation or add a feature to the component to add them in the config.

Just tried the lastest master firtv.py and get the following error.

Error loading custom_components.media_player.firetv. Make sure all dependencies are installed

Traceback (most recent call last): File "/usr/local/lib/python3.6/site-packages/homeassistant/loader.py", line 117, in _load_file module = importlib.import_module(path) File "/usr/local/lib/python3.6/importlib/__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 994, in _gcd_import File "<frozen importlib._bootstrap>", line 971, in _find_and_load File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 665, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 678, in exec_module File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed File "/config/custom_components/media_player/firetv.py", line 162, in <module> class FireTVDevice(MediaPlayerDevice): File "/config/custom_components/media_player/firetv.py", line 165, in FireTVDevice from firetv import KEYS ImportError: cannot import name 'KEYS'