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

That should be fixed now.

1 Like

where are the files?
which file?
is it merged in patch-17

You just need the new androidtv package, and specifically androidtv.py.

1 Like

its working now and also vice versa,
from androidtv box to HA and HA to androidtv box
thanks

dear one small problem without any error
when i reduce or increase volume form HA to Andoidbox my device on HA shows me off and than comes back as it was.
dont know what might be the error as no error in log

Does it change to off or unavailable?

I don’t know what could be causing that error. But when it comes back on, has the volume been successfully changed?

1 Like

Yes, that does works

I reproduced the bug that you mentioned. It seems like there’s a bug or hidden feature in Android where sending volume up/down commands in rapid succession causes it to do a quick power cycle.

I implemented a different approach. Let me know if it works. You’ll need to

no it doesnt work,
i does reflect the change from AndroidBox to HA
but doenst change when changed in HA

Try this command via the androidtv.adb_command service (update you’re entity_id):

{
  "entity_id": "media_player.fire_tv_living_room",
  "command": "input keyevent 24; input keyevent 24; input keyevent 24; input keyevent 24; input keyevent 24; input keyevent 24; input keyevent 24; input keyevent 24; input keyevent 24; input keyevent 24; input keyevent 24"
}

Let me know if

  1. It bumps the volume up a bunch and
  2. It doesn’t power cycle your device.

It turn off and on when using your code provided.

Ok, next attempt, same deal as before:

{
  "entity_id": "media_player.fire_tv_living_room", "command":"(input keyevent 24 && sleep 1 && input keyevent 24 && sleep 1 && input keyevent 24 && sleep 1 && input keyevent 24 && sleep 1 && input keyevent 24 && sleep 1 && input keyevent 24 && sleep 1 && input keyevent 24 && sleep 1 && input keyevent 24 && sleep 1 && input keyevent 24 && sleep 1 && input keyevent 24 && sleep 1 && input keyevent 24 && sleep 1 && input keyevent 24) &"
}

Thanks for your help with testing this!

after clicking on it for so many times it does restart itself in UI
and it does reflect from Androidtv box to HA,
but doesnt reflect when changing in HA
And for testing, if your work is coding for helping community, it’s my duty to test it, if I want to use it.
actually your are putting more time than me,
So a big thanks to you.

I thought it would be easier to test this via the android.adb_command service rather than constantly updating the package and component. So if sliding the volume for the media_player in the Home Assistant UI didn’t do anything before, then it still won’t do anything, but that’s not what that command was testing.

Are you saying that command doesn’t result in the volume being bumped up a bunch?

Are you saying that if you send that command repeatedly, the device restarts? But if you just click it once or twice, it doesn’t?

This addon seems to work well and I am able to control my Shield without buying any new hardware. So very happy so far. I am not sure about the reconnect every 90 seconds though. This seems to generate a ton of log messages saying ‘already connected to 192.168.x.xx:5555’ that appear regardless of the log level setting. Since I’m running on a Pi SD card, disk IO is something I feel I should watch. Perhaps an enhancement to suppress this message or maybe an option to connect when needed instead of keeping the connection open?

Correct, it is to ensure if you device restarts or turned, regains network access or power is picked up quick enough.

Those messages are not written to disk/sd.

You can’t tell, unfortunately. And in case of a restart of the shield, it doesn’t report back itself with “Hey I’m back!”.

This is all based around a Debug tool for Android Application development. Which assumes it has a developer in control of the buttons.

Command had done its work by changing volume value, on my screen.
But , when I click 5-6 times testing command, it restart.

It doesn’t restarted when I click for one or two times,
And due to that I was testing volume slider from my HA, which resulted in not changing volume level.

Dear, today i tried many attempts for clicking after updating available files from next-version branch.
and i dont see any restart.
now only thing left is to change volume when changed on HA

I just updated the androidtv package and the HA component. As before, you’ll need to update:

Let me know how this works. I think this might be the best that we can do.

@JeffLIrion
when i check next-release the file updated is basetv.py and your post shows me to update androidtv.py

what should i go for?