Home Assistant Community

New FireTV component wont work

#1

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?

0 Likes

#2

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

0 Likes

#3

Running in docker btw

0 Likes

#4

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

0 Likes

#5

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…

0 Likes

#6

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

0 Likes

#7

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.

0 Likes

#8

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

#9

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

#10

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

0 Likes

#11

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 (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

0 Likes

#12

I just posted this here: Community Hass.io 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.

0 Likes