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

Sorry for a repeat and by Jeff

So, I am running this great addon. Works as intended. However, now I am about to upgrade to 0.90. Will androidtv component be included with home assistant, i e should one remove the custom component androidtv?

Could it be related the the change in official component
Firestick to andriod? Or are you still running the custom component?

So, updated to 0.90 and the addon seems to work ie log says connected to my mibox but the entitys are gone. I am still running androidtv custom component.

Yes, i have found sollution to that problem (thanks to @JeffLIrion) and updated my gist.


Now im only lack 3 commands (media play, pause and stop)
I will update my github for my ā€œHassio Lovelace MultiRemoteā€ asap.

2 Likes

Use the KEY_* codes from constants.py. For example, play is input keyevent 126.

1 Like

i am new to this type of config for remote
can you please guide me how to create one for my android box only so that i can know and use it

i do use broadlink mini 3 for my onkyo and samsung tv
Please guide thanks
i am not using lovelace.

All of my setup is depended of Lovelace, my github is now updated, maybe you can get som tips there.

i have updated and all seems to working well expect for the following error

2019-03-21 20:58:07 ERROR (MainThread) [homeassistant.helpers.entity] Update for media_player.nvidia_shield_2 fails
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/homeassistant/helpers/entity.py", line 220, in async_update_ha_state
    await self.async_device_update()
  File "/usr/local/lib/python3.7/site-packages/homeassistant/helpers/entity.py", line 379, in async_device_update
    await self.hass.async_add_executor_job(self.update)
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.7/site-packages/homeassistant/components/androidtv/media_player.py", line 186, in _adb_exception_catcher
    return func(self, *args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/homeassistant/components/androidtv/media_player.py", line 342, in update
    self.aftv.update()
  File "/config/deps/lib/python3.7/site-packages/androidtv/androidtv.py", line 100, in update
    screen_on, awake, wake_lock_size, media_session_state, _current_app, audio_state, device, muted, volume_level = self.get_properties(lazy=True)
  File "/config/deps/lib/python3.7/site-packages/androidtv/androidtv.py", line 303, in get_properties
    "dumpsys audio")
  File "/config/deps/lib/python3.7/site-packages/androidtv/basetv.py", line 122, in _adb_shell_pure_python_adb
    return self._adb_device.shell(cmd)
  File "/config/deps/lib/python3.7/site-packages/adb_messenger/command/transport/__init__.py", line 20, in shell
    conn = self.create_connection(timeout=timeout)
  File "/config/deps/lib/python3.7/site-packages/adb_messenger/device.py", line 45, in create_connection
    self.transport(conn)
  File "/config/deps/lib/python3.7/site-packages/adb_messenger/command/transport/__init__.py", line 15, in transport
    connection.send(cmd)
  File "/config/deps/lib/python3.7/site-packages/adb_messenger/connection.py", line 77, in send
    return self._check_status()
  File "/config/deps/lib/python3.7/site-packages/adb_messenger/connection.py", line 83, in _check_status
    raise RuntimeError("ERROR: {} {}".format(repr(recv), error))
RuntimeError: ERROR: 'FAIL' 0025device '192.168.1.184:5555' not found

could someone please help me with this, itā€™s spamming my logs

Use this: https://github.com/JeffLIrion/home-assistant/blob/patch-14/homeassistant/components/androidtv/media_player.py

And please create an issue in the Home Assistant repo and link this PR: https://github.com/home-assistant/home-assistant/pull/22268

Hi how do I do this within hassio?

Ever since the 3.0 update I get an error When I press one of my buttons:

Failed to call service media_player/androidtv_key. Service not found.

Tried rebooting and restarting the ADB add-on but nothing worksā€¦

There is no service called androidtv_key any longer.
Unless you still have the old custom_component.
The service is now androidtv.adb_command.
Se my github above.

That is not the add-on, that is caused by the Home Assistant update. The Android TV component is now officially in (and changed a little). Please refer to the HA docs.

you are the best ! you rock man ! :star_struck: It works now flawlessly !

OK cool will look into that, thanks for the info.

Would it be possible to parse the output of commands aswell somehow? It shows up in the log, but would be great if we could parse it to use as sensors :slight_smile:

POST {{baseUrl}}/api/services/androidtv/adb_command

Authorization: {{token}}

content-type: application/json

{

"entity_id": "media_player.galaxytab",

"command":"dumpsys battery"

}

This returns:

HTTP/1.1 200 OK
Server: nginx/1.15.9
Date: Sat, 23 Mar 2019 11:31:56 GMT
Content-Type: application/json
Content-Length: 22
Connection: close
Content-Encoding: gzip

[]
```

For those using Plex Media Server on Nvidia Shield, I discovered that you can launch a specific movie.
You need your Unique Server ID and the Library Metadata info of the movie you want to watch.
The command :

am start -a android.intent.action.VIEW -d plex://<SERVER ID>/movie//library/metadata/<Movie ratingKey>

2 Likes

Wonder if you can do the same via Emby, but then again why would you want a specific movie??? Are you planing on mapping your whole library via buttons which makes no sense to meā€¦

I used all the file in your github but still get the media_player/androidtv_key.

Tried rebooting restarting, several times changing the files but nothing worksā€¦