New Chromecast w/ Android TV Integration only showing as Off or Idle

@mboarman @diodorus I’ve been trying to install this but I haven’t had any luck. I created the “androidtv” folder within the custom_componets folder as stated in the repo but that’s where I got a little confused. Do I copy everything from the main “HA-androidtv11” folder of the repo or everything from the “androidtv11hack” subfolder that is within the main folder.? After I get that straightened out what are my next steps.? Thanks in advance.

If you have a “androidtv” folder created under custom_components, then just grab the entire folder structure of the repo and drop it in there.

Reboot
Add Integration - AndroidTV through the config panel
Add your TV’s through the AndroidTV integration. (each on requires a new integration be setup)

Even with the hacked version I’m still getting app_id: 'InputMethod}:' :frowning:

It can at least turn on and off the device I think, but states are also messed up as volume slider and basically everything else

Hmmmm…are you sure its using the hacked integration? What android device are you using it with?

i factory reset my shield and it fixed the app_id: ‘InputMethod}:’

hassle to set everything up again, but worth it

I’ll try again, but it is a TCL TV with google tv (TCL C725), not exactly the new chromecast. I’ll try again but heres the steps i took

Deleted the standard android tv device.
Copied the repo contents to a folder called “androidtv” inside of custom components
Reset home assistant
Add the android tv integration (it was exactly the same, i’m assuming it’s all in background)

Update: User error is really a thing. I’ve tried moving the folder using vscode but it only created folders not files. So I redid it using the samba integration and all files are there.

Now I see that it went in because the name of the integration changed from “Android TV” to “androidtv”.

BUT, I still have it showing something that is not what it should. Now it’s showing “AssistPreviewPanel}:” on the state. It does query the tv volume but I cannot change it still :frowning: everything else is the same.

Using the ADB query someone posted above I get the current app returned with success:

CURRENT_APP=$(dumpsys activity a . | grep -E 'mResumedActivity' | cut -d ' ' -f 8) && CURRENT_APP=${CURRENT_APP%%/*} && echo $CURRENT_APP
1 Like

Hello, I tried both the hacked integration and the official integration on latest core but the integration stays idle.
For the hacked integration I renamed the folder to androidtv and placed in custom components folder.
Assuming I did everything correct, or is there something I’m missing?
My device is Tivo 4k

Getting inputmethod in media, any solutions yet ?

Has anyone successfully downgraded to Android 9? I want to use the Android ‘sendevent’ command as opposed to the default ‘input’ which requires A9 as A10 has introduced a security policy to block this command

The above is documented.ob the official HA integration page

I use a template sensor for this.

template:
  - sensor:
    - name: "chromecast_adb_office_on_screen"
      state: >
        {% set astate = state_attr('media_player.chromecast_adb_office', 'adb_response') %}
        {% if "{'screen_on':" in astate -%}
        {% set onscreen = astate | regex_findall_index("{'screen_on': (\w+)") %}
        {% if onscreen == "True" -%}
          {{ onscreen }}
        {%- endif %}
        {% if onscreen == "False" -%}
          {{ onscreen }}
        {%- endif %}
        {%- endif %}  

And on every state change of the player i fire up this service:

  - service: androidtv.adb_command
    data:
      command: GET_PROPERTIES
    target:
      entity_id: media_player.chromecast_adb_office

It is not the best method, but better than nothing.

Check this link out: [Testers needed!] Custom state detection rules for Android TV / Fire TV - #28 by Pronown
Should work like Fire TV since it is same integration and Fire TV is Android based.

Known ids:
Plex = com.plexapp.android
Netflix = com.netflix.ninja
Hulu = com.hulu.plus

Others can be found by visiting the play store via browser (preferably pc so it doesn’t auto open the app) and copying the com.blank.blank from the url.

I was able to get most states through all three sources using

- playing:
    media_session_state: 3
- paused:
    media_session_state: 2
- idle
- standby

Anyone know how to make the adb connection stop falling off randomly?

1 Like