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
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.
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
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).
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.