Home Assistant Community Add-on: ADB - Android Debug Bridge

Hi there all,
and sorry if I reopen this already long thread.

I have already set the ADB component and it’s work if I call it from Tools>Services
using POWER and SLEEP data.

Now, in order to use it with google home assistance, I need to make a switch (at last I believe)

I try a lot of combination but this yaml language I’ll never understand :frowning:

So the last think is to ask your help…
Here is what I want to correct if it’s possible to help me:

switch 6:
  - platform: template
    switches:
      tv:   ### TV PHILIPS (192.168.1.157)
        turn_on:
          service: androidtv.adb_command
          data:
            entity_id: 'media_player.philips_tv'
            command: 'POWER'
        turn_off:
          service: androidtv.adb_command
          data:
            entity_id: 'media_player.philips_tv'
            command: 'SLEEP'

I need to name the switch: tv
This in order to ask “hey google… turn on the tv”
Please help me to finish thes script.

Thasks a lot all
Denis

Dear all,
I finally find how to make a switch in order to use it with google home mini
Here is my actual config:

switch 6:
  - platform: template
    switches:
      tv:
        value_template: 'off'
        turn_on:
          - service: androidtv.adb_command
            data:
              entity_id: 'media_player.philips_tv'
              command: 'POWER'
          - service: androidtv.adb_command
            data:
              entity_id: 'media_player.philips_tv'
              command: 'HDMI1'
        turn_off:
          - service: androidtv.adb_command
            data:
              entity_id: 'media_player.philips_tv'
              command: 'SLEEP'

The problem now is that I can’t understand how to make the HDMI1
always activate when I power on the TV.
I put 2 times the service and activate HDMI1, but is not work.

Anybody can help me please ?
Thanks in advance
Denis

Hi,

I am trying to control my NVIDIA TV Shield with HA, but I am a little bit lost with the configuration. I would like to control the play / pause, volume and previous next button in order to change music on my shield for example.

Is there is a tutorial avalaible to to that, and the code that should be paste in the configuration.yaml file ?

Which is the easiest way to use ADB, python or ADB server ? I have HACS installed.

Thanks for your help!

I’m using HA to control a 2017 and 2019 Pro Shield TV without any issues, so it is possible :wink:

If you’re using Hassio, you’ll need to install the “ADB - Android Debug Bridge” add-on. In the config of that add-in, enter the IP address of your Shield TV and start it up.

You’ll also need to enable the Developer options on the Shield TV to support this. Here are some generic Android instructions, but you should be able to follow this for your Shield TV (the menu options are the same name).

:tada: Release v0.5.4

Full Changelog

This is a general maintenance release.

:hammer: Changes

  • :books: Component > Integration (#18)
  • :arrow_up: Upgrades add-on base image to v4.0.2
  • :books: Update add-on installation instructions
  • :shirt: Fixes Markdownlint warnings

Questions? Join our Discord server! https://discord.me/hassioaddons
Enjoying my add-ons? Consider supporting my work: https://patreon.com/frenck

I think you should take a look here

hi guys,
I noticed when using the plex app on my shield home assistant sees anything i play as “Paused”, i can see a few people have had this issue, but I couldn’t see a fix.

could someone please help

Hi,

Is it possible to controle volume through ADB for my TV Shield ? I haven’t found the commande for volume UP or volume DOWN anyware.

Thanks

Anyone got the command to open Disney+ app?

I use a harmony remote to control my Shield TV. Harmony integrates well with hassio and you would be able to send a harmony command to control the volume.

So Disney+: com.disney.disneyplus/com.bamtechmedia.dominguez.main.MainActivity

Not seeing Android debug in the HA services drop down? I searched for ABD and Android. Any ideas? I made sure it was running and config right.Capture

I had the ADB server and AndroidTV working fine, but after upgrading to the latest versions of HassOS and Home Assistant, it no longer is working and the ADB service calls don’t exist in Developer Tools. Does anyone have any ideas? Details below:

Device: Raspberry Pi 3B+
Hass.io Supervisor: v193
OS: HassOS 3.7
HA Version: 0.103.4
ADB Server: 0.5.4

Devices: All are Amazon Fire TV STICK 4K

Core Configuration

media_player:
  - platform: androidtv
    name: Master Bedroom Fire TV 4K
    device_class: firetv
    host: 192.168.1.158
    adb_server_ip: 127.0.0.1
    adb_server_port: 5087

  - platform: androidtv
    name: Great Room Fire TV 4K
    device_class: firetv    
    host: 192.168.1.157
    adb_server_ip: 127.0.0.1
    adb_server_port: 5087
  
  - platform: androidtv
    name: Dining Room Fire TV 4K
    device_class: firetv    
    host: 192.168.1.156
    adb_server_ip: 127.0.0.1
    adb_server_port: 5087  

ADB Config

{
  "devices": [
    "192.168.1.156",
    "192.168.1.157",
    "192.168.1.158"
  ],
  "reconnect_timeout": 90
}

Portion of ADB Log

[10:54:33] INFO: Connecting to device: 192.168.1.158...
connected to 192.168.1.158:5555
[10:56:04] INFO: Connecting to device: 192.168.1.156...
connected to 192.168.1.156:5555
[10:56:04] INFO: Connecting to device: 192.168.1.157...
connected to 192.168.1.157:5555
[10:56:04] INFO: Connecting to device: 192.168.1.158...
connected to 192.168.1.158:5555
[10:57:34] INFO: Connecting to device: 192.168.1.156...
connected to 192.168.1.156:5555
[10:57:34] INFO: Connecting to device: 192.168.1.157...
connected to 192.168.1.157:5555
[10:57:34] INFO: Connecting to device: 192.168.1.158...
connected to 192.168.1.158:5555
[10:59:05] INFO: Connecting to device: 192.168.1.156...
connected to 192.168.1.156:5555
[10:59:05] INFO: Connecting to device: 192.168.1.157...
connected to 192.168.1.157:5555
[10:59:05] INFO: Connecting to device: 192.168.1.158...
connected to 192.168.1.158:5555

Portion of Home Assistant Log

2019-12-27 11:00:01 WARNING (SyncWorker_3) [androidtv.adb_manager] Couldn't connect to host 192.168.1.158:5555 via ADB server 127.0.0.1:5087, error: ERROR: connecting to 127.0.0.1:5087 [Errno 111] Connection refused.
Is adb running on your computer?
2019-12-27 11:00:01 WARNING (SyncWorker_13) [androidtv.adb_manager] Couldn't connect to host 192.168.1.157:5555 via ADB server 127.0.0.1:5087, error: ERROR: connecting to 127.0.0.1:5087 [Errno 111] Connection refused.
Is adb running on your computer?
2019-12-27 11:00:01 WARNING (SyncWorker_15) [androidtv.adb_manager] Couldn't connect to host 192.168.1.156:5555 via ADB server 127.0.0.1:5087, error: ERROR: connecting to 127.0.0.1:5087 [Errno 111] Connection refused.
Is adb running on your computer?
2019-12-27 11:00:01 WARNING (SyncWorker_3) [homeassistant.components.androidtv.media_player] Could not connect to Master Bedroom Fire TV 4K at 192.168.1.158:5555 using ADB server at 127.0.0.1:5087
2019-12-27 11:00:01 WARNING (SyncWorker_13) [homeassistant.components.androidtv.media_player] Could not connect to Great Room Fire TV 4K at 192.168.1.157:5555 using ADB server at 127.0.0.1:5087
2019-12-27 11:00:01 WARNING (SyncWorker_15) [homeassistant.components.androidtv.media_player] Could not connect to Dining Room Fire TV 4K at 192.168.1.156:5555 using ADB server at 127.0.0.1:5087
2019-12-27 11:00:01 WARNING (MainThread) [homeassistant.components.media_player] Platform androidtv not ready yet. Retrying in 180 seconds.
2019-12-27 11:00:01 WARNING (MainThread) [homeassistant.components.media_player] Platform androidtv not ready yet. Retrying in 180 seconds.
2019-12-27 11:00:01 WARNING (MainThread) [homeassistant.components.media_player] Platform androidtv not ready yet. Retrying in 180 seconds.
2019-12-27 11:03:02 WARNING (SyncWorker_3) [androidtv.adb_manager] Couldn't connect to host 192.168.1.158:5555 via ADB server 127.0.0.1:5087, error: ERROR: connecting to 127.0.0.1:5087 [Errno 111] Connection refused.
Is adb running on your computer?
2019-12-27 11:03:02 WARNING (SyncWorker_7) [androidtv.adb_manager] Couldn't connect to host 192.168.1.157:5555 via ADB server 127.0.0.1:5087, error: ERROR: connecting to 127.0.0.1:5087 [Errno 111] Connection refused.
Is adb running on your computer?
2019-12-27 11:03:02 WARNING (SyncWorker_4) [androidtv.adb_manager] Couldn't connect to host 192.168.1.156:5555 via ADB server 127.0.0.1:5087, error: ERROR: connecting to 127.0.0.1:5087 [Errno 111] Connection refused.
Is adb running on your computer?
2019-12-27 11:03:02 WARNING (SyncWorker_3) [homeassistant.components.androidtv.media_player] Could not connect to Master Bedroom Fire TV 4K at 192.168.1.158:5555 using ADB server at 127.0.0.1:5087
2019-12-27 11:03:02 WARNING (SyncWorker_7) [homeassistant.components.androidtv.media_player] Could not connect to Great Room Fire TV 4K at 192.168.1.157:5555 using ADB server at 127.0.0.1:5087
2019-12-27 11:03:02 WARNING (SyncWorker_4) [homeassistant.components.androidtv.media_player] Could not connect to Dining Room Fire TV 4K at 192.168.1.156:5555 using ADB server at 127.0.0.1:5087
2019-12-27 11:03:02 WARNING (MainThread) [homeassistant.components.media_player] Platform androidtv not ready yet. Retrying in 180 seconds.
2019-12-27 11:03:02 WARNING (MainThread) [homeassistant.components.media_player] Platform androidtv not ready yet. Retrying in 180 seconds.
2019-12-27 11:03:02 WARNING (MainThread) [homeassistant.components.media_player] Platform androidtv not ready yet. Retrying in 180 seconds.

Background
I originally setup ADB on my Mac and generated the keys and then used the Python add-on, and that worked, but when the TVs were off, the state constantly toggled between unknown and unavailable. I then deleted the key and switched to the ADB server. I let it self-generate the key and setup the Fire TV sticks to use the new key. That worked more reliably for me. When the TV was off, the Fire Stick 4K showed as OFF.

However, after upgrading the underlying HassOS from 2.#.# (don’t remember exact version) to 3.7, my media player devices no longer showed up, and the ADB server commands no longer existed in Services in Developers Tools.

I’ve tried everything I can think of including uninstalling and re-installing, turning off ADB on the FireTV Stiick 4K, rebooting, turning ADB back on, rebooting HA, re-accepting the certificate on the Fire TV Stick 4K and telling it to remember the computer, but still it doesn’t show up in HA. I have hit a wall. :frowning:

Any help is much appreciated!

I turned off the ADB server and went back to the pythod method, and everything is working OK for now under that version. I still wonder why the ADB server isn’t working, but at least I have control back for now.

I’ve recently acquired a new Sony Android |TV and have just been trying to set up the AndroidTV component on and off over the last few days.

I can report that I’m getting the same symptoms as reported by @Salty. The ADB Server component has connected to the TV and I’ve accepted the key etc. Logs from the the ADB Server show it connecting but HA logs are showing the same problems as Salty. I only just upgraded HassOS to 3.7 tonight and was getting the problem yesterday too, so not specific to 3.7

I hope there’s a solution to this soon,as I’ve not had any joy as yet connecting via Python method, but I’ll give it another go.

EDIT: I just turned up the debug on HA and captured the following in the logs:

2019-12-29 22:53:34 INFO (MainThread) [homeassistant.components.media_player] Setting up media_player.androidtv
2019-12-29 22:53:34 WARNING (SyncWorker_7) [androidtv.adb_manager] Couldn't connect to host 192.168.0.111:5555 via ADB server 127.0.0.1:5087, error: ERROR: connecting to 127.0.0.1:5087 [Errno 111] Connection refused.
Is adb running on your computer?
2019-12-29 22:53:34 DEBUG (SyncWorker_7) [androidtv.adb_manager] ADB command not sent to 192.168.0.111:5555 via ADB server 127.0.0.1:5087 because pure-python-adb connection is not established: getprop ro.product.manufacturer && getprop ro.product.model && getprop ro.serialno && getprop ro.build.version.release && ip addr show wlan0 | grep -m 1 ether && ip addr show eth0 | grep -m 1 ether
2019-12-29 22:53:34 WARNING (SyncWorker_7) [homeassistant.components.androidtv.media_player] Could not connect to Sony TV at 192.168.0.111:5555 using ADB server at 127.0.0.1:5087

Besides your ADB problems, you should try this custom component. Since I use this one, I don’t have any problems with my Sony TV and the python adb connection. :wink:

Thanks for the pointer, I’ll give it a try when I’m back home in a few days.

:tada: Release v0.5.5

Full Changelog

This is a general maintenance release.

:hammer: Changes

  • :fireworks: Updates maintenance/license year to 2020
  • :arrow_up: Upgrades add-on base image to v4.0.3
  • :pencil2: Funding adjustments
  • :pencil2: Fixes some spelling and grammar

Questions? Join our Discord server! https://discord.me/hassioaddons
Enjoying my add-ons? Consider supporting my work:
https://github.com/sponsors/frenck or https://patreon.com/frenck

Hello all,

This is great work, some awesome tutorials. Thanks to all.

I can get all my apps to launch except when I read my shield or Sony android tv with adb I am missing two. Nhl live and dazn

Any help would be appreciated.

Thanks

:tada: Release v0.5.6

Full Changelog

This is a small bugfix/improvement release.

:hammer: Changes

  • :hammer: Change adb-connect to wait on port (#20)

Questions? Join our Discord server! https://discord.me/hassioaddons
Enjoying my add-ons? Consider supporting my work:
https://github.com/sponsors/frenck or https://patreon.com/frenck