New FireTV component wont work

Hi there,

i tried to use the new FireTV component but had no luck.

Config:

- platform: firetv
  name: Fire TV
  host: 192.168.178.20
  adbkey: "/config/devices/adbkey"

Error:

Error while setting up platform firetv
Traceback (most recent call last):
File “/usr/src/app/homeassistant/helpers/entity_platform.py”, line 128, in _async_setup_platform
SLOW_SETUP_MAX_WAIT, loop=hass.loop)
File “/usr/local/lib/python3.6/asyncio/tasks.py”, line 358, in wait_for
return fut.result()
File “/usr/local/lib/python3.6/concurrent/futures/thread.py”, line 56, in run
result = self.fn(*self.args, **self.kwargs)
File “/usr/src/app/homeassistant/components/media_player/firetv.py”, line 68, in setup_platform
ftv = FireTV(host, config[CONF_ADBKEY])
File “/usr/local/lib/python3.6/site-packages/firetv/init.py”, line 106, in init
self.connect()
File “/usr/local/lib/python3.6/site-packages/firetv/init.py”, line 119, in connect
self._adb = adb_commands.AdbCommands().ConnectDevice(**kwargs)
File “/usr/local/lib/python3.6/site-packages/adb/adb_commands.py”, line 142, in ConnectDevice
self._Connect(**kwargs)
File “/usr/local/lib/python3.6/site-packages/adb/adb_commands.py”, line 173, in _Connect
conn_str = self.protocol_handler.Connect(self._handle, banner=banner, **kwargs)
File “/usr/local/lib/python3.6/site-packages/adb/adb_protocol.py”, line 336, in Connect
data=rsa_keys[0].GetPublicKey() + b’\0’)
TypeError: must be str, not bytes

Any idea what I´m doing wrong?

I’m getting the exact same error after a clean new install from this morning.
pi3b+, ha 0.83.2 hassio 1.13 supervisor 140

Running in docker btw

Your key is not pre-authenticated. Please see the warning box and the “ADB Authentication” section in the documentation.

So I go back into my media_players.yaml file and remove the quotes around the IP address (that have always been there) and voila! Now everything is working again.

Go figure…

Did this already. Also checked the Box to “always trust this Computer”. :thinking:

Your key didn’t work, for one reason or another. It will only reach line 336 in adb_protocol.py if this is the case.

See the “ADB Troubleshooting” section on the Fire TV documentation page. If the key files are correct and pre-authenticated, it could be that another ADB connection was active and you need to restart the Fire TV and HA.

I am also unable to connect to firetv. Would really appreciate your help. Thanks.
Not connected via adb from main computer (used to generate adbkey)
was able to connect to firetv adb using main computer

Error while setting up platform firetv
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py", line 128, in _async_setup_platform
    SLOW_SETUP_MAX_WAIT, loop=hass.loop)
  File "/usr/local/lib/python3.6/asyncio/tasks.py", line 358, in wait_for
    return fut.result()
  File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/media_player/firetv.py", line 68, in setup_platform
    ftv = FireTV(host, config[CONF_ADBKEY])
  File "/usr/local/lib/python3.6/site-packages/firetv/__init__.py", line 106, in __init__
    self.connect()
  File "/usr/local/lib/python3.6/site-packages/firetv/__init__.py", line 119, in connect
    self._adb = adb_commands.AdbCommands().ConnectDevice(**kwargs)
  File "/usr/local/lib/python3.6/site-packages/adb/adb_commands.py", line 142, in ConnectDevice
    self._Connect(**kwargs)
  File "/usr/local/lib/python3.6/site-packages/adb/adb_commands.py", line 173, in _Connect
    conn_str = self.protocol_handler.Connect(self._handle, banner=banner, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/adb/adb_protocol.py", line 336, in Connect
    data=rsa_keys[0].GetPublicKey() + b'\0')
TypeError: must be str, not bytes
1 Like

Same error message, same issue: there’s a problem with your keys. Aside from the troubleshooting suggestions in the documentation, all I can think of is to make sure that your line endings are correct (especially if one or both of your computers is Windows).

1 Like

Had a bit time and tried again using linux. Works on first try…

Was able to connect and display FireTV on HA however it remained Unavailable/Unknown throughout the day with a few state changes in b/w

I am using the androidtv custom_component with official adb addon by Frenck (Home Assistant Community 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

I just posted this here: Home Assistant Community Add-on: ADB - Android Debug Bridge

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.

I cant open or close any app on firetv