Fire Stick connection problem using ADB

Hi there,

I have been trying to get Home Assistant to control my Amazon Fire Stick with no success. Whatever I do I get the following errors in the log:

Logger: homeassistant.components.androidtv.media_player
Source: components/androidtv/media_player.py:227
Integration: androidtv ([documentation](https://www.home-assistant.io/integrations/androidtv), [issues](https://github.com/home-assistant/home-assistant/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+androidtv%22))
First occurred: 1:10:01 (5 occurrences)
Last logged: 1:15:02

Could not connect to Fire Stick Salotto at 192.168.1.7:5555 using ADB server at 127.0.0.1:5037

and

Logger: androidtv.adb_manager.adb_manager_async
Source: /usr/local/lib/python3.8/site-packages/androidtv/adb_manager/adb_manager_async.py:400
First occurred: 1:10:01 (5 occurrences)
Last logged: 1:15:02

Couldn't connect to 192.168.1.7:5555 via ADB server 127.0.0.1:5037 because the server is not connected to the device

The ADB has the following configuration:

devices:
  - 192.168.1.7
reconnect_timeout: 90
log_level: info

the Network is set to
5037/tcp 5037 ADB Server

the config.yaml file has the following entry:

#Amazon Fire TV Stick - Android TV
media_player:
  - platform: androidtv
    name: Fire Stick Salotto
    host: 192.168.1.7
    adb_server_ip: 127.0.0.1
    adb_server_port: 5037
    get_sources: true

I am running Home Assistant OS 64-bit on a Raspberry PI4 8Gb.

What am I doing wrong? the IP address of the Fire Stick is correct.

Thanks!

I have 3 and this is how my config looks one entry for each TV

  • platform: androidtv
    name: BedRoom Fire TV
    host: 192.168.2.xx
    device_class: firetv
    adbkey: “/home/hass/.homeassistant/.storage/androidtv_adbkeybr”

Hi ghvader,

I have changed my config in

#Amazon Fire TV Stick - Android TV
media_player:
  - platform: androidtv
    name: Fire Stick Salotto
    device_class: firetv
    host: 192.168.1.7
    adbkey: “/home/hass/.homeassistant/.storage/androidtv_adbkeybr”

restarted the whole system and I get the same error in the log and

Logger: homeassistant.components.hassio
Source: components/hassio/__init__.py:420
Integration: Home Assistant Supervisor ([documentation](https://www.home-assistant.io/hassio), [issues](https://github.com/home-assistant/home-assistant/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+hassio%22))
First occurred: 1:47:51 (2 occurrences)
Last logged: 1:48:15

Invalid config for [media_player.androidtv]: not a file for dictionary value @ data['adbkey']. Got '“/home/hass/.homeassistant/.storage/androidtv_adbkeybr”'. (See ?, line ?).

well your ADB key has to be unique, you first have to acquire it and then put in the correct path and name. mine was just an example of how my config looks. it will be different than yours. I have unique keys for each room… hence the “br” at the end for bedroom. my living room looks the same but has “lr” at the end, it is it’s own unique key. you’ll need to read the docs for how to get your key.

Hi there,

actually solved the problem, I was trying to generate the media player keeping the fire stick off. With the fire stick on, I got my ADB key on screen and clicked on the flag that allowed HA to always access the fire stick.

Now the media player has been generated and I could add it to lovelace.

For everybody’s understanding, the following is valid if you have just one Amazon Fire Stick in the house:

Configuration of the ADB Add-On:

devices:
  - 192.168.xxx.yyy
reconnect_timeout: 90
log_level: info

Your Network should be configured as follows:

5037/tcp 5037 ADB Server

Entry in the configuration.yaml file

#Amazon Fire TV Stick - Android TV
media_player:
  - platform: androidtv
    name: <type the name you want to assign to the Fire Stick>
    device_class: firetv
    host: 192.168.xxx.yyy
    adb_server_ip: 127.0.0.1
    adb_server_port: 5037

I will update this post as soon as I get more code and more controls on the fire stick.