System setup: hassio on ubuntu 18.04
Try to add FireTV 4K:
Here are the steps I took:
- Enable ADB debugging on FireTv Stick
- Install ADB - Android Debug Bridge addon via hassio
config file content:
{
"devices": [
"192.168.x.xyz"
],
"reconnect_timeout": 90,
"log_level": "info",
"keys_path": "/share/android/adbkeys"
}
- Add the following in configuration.yaml:
media_player:
- platform: androidtv
name: "Fire TV"
device_class: firetv
host: 192.168.x.xyz
adbkey: "/share/android/adbkeys/adbkey"
adb_server_ip: 192.168.x.abc
adb_server_port: 5037
get_sources: false
- Restart the adb server and the log shows:
[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing...
Log level is set to INFO
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] adb.sh: executing...
[cont-init.d] adb.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[11:16:15] INFO: Starting the Android Debug Bridge server...
[11:16:15] INFO: Connecting to device: 192.168.x.xyz...
connected to 192.168.x.xyz:5555
However, I don’t see any FireTv entry in Home Assistant (integration or known_devices.yaml), even after restart the entire system. Did I miss something? Any help is appreciated.
Thanks.
It should be on the States page, probably as media_player.fire_tv
in your case. It won’t be on the Integrations page or in known_devices.yaml. What does the Home Assistant log say?
Here is the HA log… I did check the State page and it was not there.
2019-07-19 09:31:55 ERROR (MainThread) [homeassistant.components.media_player] Setup of platform androidtv is taking longer than 60 seconds. Startup will proceed without waiting any longer.
2019-07-19 09:31:59 ERROR (MainThread) [homeassistant.components.switch] Setup of platform tplink is taking longer than 60 seconds. Startup will proceed without waiting any longer.
2019-07-19 09:35:16 WARNING (SyncWorker_15) [homeassistant.components.androidtv.media_player] Could not connect to Fire TV at 192.168.x.xyz:5555 using ADB server at 192.168.x.abc:5037
2019-07-19 09:35:16 ERROR (MainThread) [homeassistant.core] Error doing job: Future exception was never retrieved
Traceback (most recent call last):
File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/homeassistant/homeassistant/components/androidtv/media_player.py", line 123, in setup_platform
raise PlatformNotReady
homeassistant.exceptions.PlatformNotReady
If you’re using the ADB add-on for Hass.io, then use 127.0.0.1 for adb_server_ip
. Also, you don’t need the adbkey
config entry.
- platform: androidtv
name: "Fire TV"
device_class: firetv
host: 192.168.x.xyz
adb_server_ip: 127.0.0.1
adb_server_port: 5037
get_sources: false
I tried what you recommended first. Then I tried playing with different settings (to make it more explicit, like using actual ip for adb_server_ip instead of 127.0.0.1, and putting keys_path in config to force it to be written there) but no luck.
That’s odd. All I can suggest is to carefully check your configuration and make 100% sure that you have the right IP address for your Fire TV. Make sure it matches what’s in the ADB server add-on config. And make sure that the ADB server add-on is running on port 5037.
Try without the key to see if a connection is possible. Mine was being a bit funny so changed port to 8037 and works ok now
I have reverted it to use 127.0.0.1, removed the key and also tried different port (8037), and the HA log spit out the same result:
{
"devices": [
"192.168.x.xyz"
],
"reconnect_timeout": 90,
"log_level": "info"
}
and configuration.yaml:
media_player:
- platform: androidtv
name: "Fire TV"
device_class: firetv
host: 192.168.x.xyz
port: 5555
adb_server_ip: 127.0.0.1
adb_server_port: 8037
get_sources: false
Any update? You should post your config for both the add-on and the media player with the IP addresses – it’s within your Wi-Fi network, so there’s no security risk. I believe there was a case where a user was having trouble connecting because his host was 192.168.0.x, but it should have been 192.168.1.x. It’s very strange that the ADB server can connect, yet HA doesn’t setup the platform.
Also, looking back at your HA log, the fact that your TP-link switch also timed out makes me wonder if there is something funky about your network setup.
I unplugged the tp-link and that’s why it caused the issue.
Here is the actual log and yaml:
{
"devices": [
"192.168.1.205"
],
"reconnect_timeout": 90,
"log_level": "info"
}
media_player:
- platform: androidtv
name: "Fire TV"
device_class: firetv
host: 192.168.1.205
port: 5555
adb_server_ip: 127.0.0.1
adb_server_port: 5037
get_sources: false
Thanks for following up.
Copied from here: Home Assistant Community Add-on: ADB - Android Debug Bridge - #267 by JeffLIrion
Try this as a custom component and post the HA log. It won’t fix the issue, but it will log a lot of info.
https://github.com/JeffLIrion/ha-androidtv
Will try it when I get home.
Out of curiosity, what does the lovelace interface for Fire TV look like if it works?
Thanks again.
Like any other media player that doesn’t support artwork.