AndroidTV ADB

So,

I’ve set up the Android Debug Bridge on my Sony Bravia KD-65X85K per: https://www.home-assistant.io/integrations/androidtv/

I can connect to the TV via ADB on both my Linux box and through HA.

When I send the androidtv.learn_sendevent command, I don’t get a notification.

This is that the setup looks like:

Any ideas what I’ve done wrong?

Thanks

first, you should be sending to the entity, not the device.

i presume you did hit the physical remote hardware button? and you did so after the services button went green, but before 8 seconds elapsed from that point?

i have a few sony bravia’s as well and i can attest that at least the bravia’s i have do respond to the learn_sendevent command.

Ok, switched sending to an entity. The icon is a TV with a line through it.

TV on, hit the call service button, it turns green and then touch one of the buttons on the remote.

I get nothing.

Thoughts?

I think you need press call service button first.
Then press desired button.
Then wait until call service button turns green.
Then go to states menu and adb_response under your tv entity.

Found explonation in forum:
https://community.home-assistant.io/t/how-to-use-androidtv-learn-sendevent-when-deploying-python-adb/327971

apologies, @doobes is right. hit the remote button. the service call should complete (and turn green) after that.

Okay,

Making headway.

Went to states/media_player.android_tv_192_168_10_232

Got this:

adb_response: “/system/bin/sh: ANDROIDTV.LEARN_SENDEVENT: inaccessible or not found”
hdmi_input: null
device_class: tv
friendly_name: Android TV 192.168.10.232
supported_features: 23997
volume_level: 0.31
is_volume_muted: false
entity_picture: >-
/api/media_player_proxy/media_player.android_tv_192_168_10_232?token=45eaeb085e5265bdf8fbedcfad310feb2e663accbf07596eeccbec7034df196b&cache=939b436d837aff78

Something is obviously caddywompus. Any idea what?

Thanks

i’ve not seen that error before. smells almost like the auth token is expired.
do any other commands to it work? if none are working, i’d try removing and re-establishing a fresh pairing to the tv.

So,

I went to the TV and reset all the ADB permissions.

Did the ADB-Bridge integration setup. TV asked me if it could connect. Said yes.

Went through the services thingy again.

Same response in states.

I’m confuzzled.

:frowning:

i’m confused too. especially since i have several bravia’s and haven’t seen this issue.

For some button functions you can use supported service calls.
For example to turn tv on or off can use:

service: androidtv.adb_command
  target:
    entity_id: media_player.androidtv_tv_living_room
  data:
    command: "POWER"

https://www.home-assistant.io/integrations/androidtv