[TESTERS NEEDED] Android TV / Fire TV key generation

i’ve got an error :
2019-10-11 22:28:03 WARNING (SyncWorker_6) [custom_components.androidtv.androidtv.adb_shell.adb_device] Data_length 2449 does not match actual number of bytes read: 1424

it’s not really important , i think that is when my firetv statut changed

Quick update: I was testing your latest update on the original HA instance and Fire TV where I originally had issues, and haven’t encountered the issue again. I’ll submit a PR if I encounter the issue again.

In regards to the testing (from original post), I tested the new component on another HA instance and Fire TV TV stick 4K and didn’t encounter any issues.

A handful of people have mentioned that warning, but I never really looked into it until now. I don’t think it matters, so I took it out.

Awesome, thanks for reporting back!:+1:

Questions for testers

  1. [ Yes | No | N/A ] Did the key generation feature work for you?
  2. [ Yes | No ] Once setup, did the media player experience any issues?
    • Becoming unavailable or seeing error messages in the logs qualifies as an issue
    • Incorrect state detection does not count as an issue for these purposes
  1. Yes
    2.No
    the only issues come from my wifi router “nova mesh” , it restart himself daily at 04:00 am to clean all connections …

image

  1. key gen didn’t work for me,
  2. everything other than key gen was working after directing to my adbkey(older)

What happened when you tried to generate the key? Did it create the file YOUR_CONFIG_DIRECTORY/.storage/androidtv_adbkey?

nothing comes on TV no popup.
I stopped trying to create key and used the key which i had.
I would like to request one thing, is it possible to use this integration without restarting HA, as alexa_media can be used without restarting.

edit.
Today after upgrading and trying withoud my old keys,
it created new keys inside /config/.storage/ (as per you asked me to check) but wihtout any popup on tv asking to grant permission for my HA device.
now it seems to be working

i have been struggling with getting ADB and Fire Cube to work. gave up a while back and moved to an Nvidia Shield. Recently re-tried this and boom!
This worked exactly as you highlighted.

Stopped ADB docker.
Rebooted FireCube
Stopped HA
Deleted the adbkey and adbkey.pub from .storage
started HA
Popup comes up to accept = WINNING

amazing work, thanks for building. Now to work on my apps and statuses

  1. Did the key generation feature work for you?

Yes, no problems. Got a popup right after restarting Home Assistant. So that seems to work fine.

  1. Once setup, did the media player experience any issues?

Just enabled it. But for now no issues. If i run into issues i will post it here.

Thanks for the feedback, @dwinnn, @kirpat, @Fabrice_Barthelemy, @jaburges, and @hvdheurik!

Just to confirm: no one is having any ADB issues with the device becoming unavailable?

I’d like to create a new release of the backend package and get this into HA!

No problems here ! Works fine ! Great work ! No extra docker container needed for me if this integration works.

same, working great. No unavailable status.

Also could anyone point me to a good guide or example code block of how apps and 'state_detection_rules` are configured?
I’m assuming i should be able to select source of the friendly name of the app I list (that doesnt seem to work, so maybe i have configured it incorrectly).
also i’ve set to debug but i’m not sure how i get the states of the various apps :frowning:
any guidance greatly appreciated

Thanks for the feedback!

  • For configuring apps and state_detection_rules, see Full Configuration
  • Launching apps from the sources list only works for Fire TV devices, not Android TV devices. But you can use the androidtv.adb_command service to do whatever you want. For examples, see this list of intents.
  • For coming up with custom state detection rules, see Custom State Detection. You don’t want to set the log level to debug.

No unavailable issues for me either. Thanks for updating this component and fixing my prior issues with it!

Good to go
:+1::+1::+1:

thanks
the app example was only one app, and couldn’t figure out if i needed a - before when using multiple. This post seemed to have the example i was looking for

I’m also using a Fire Cube and works really well, ditched the shields and the nearby alexa and consolidated.

I was missing how to get the wake_lock_size values.
androidtv.adb_command : GET_PROPERTIES per state to test. ie

  1. open app and play something
  2. run the adb command
  3. check the values
  4. pause whatever is playing
  5. run the command
    6.check the values again
    [this maybe really obvious, but that is the piece i was missing]

Works great here :grinning:

This will be in the 0.101 release!:+1:

1 Like