Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SURVEY: Customizable commands used #1

Open
ollo69 opened this issue May 12, 2022 · 11 comments
Open

SURVEY: Customizable commands used #1

ollo69 opened this issue May 12, 2022 · 11 comments
Assignees
Labels
help wanted Extra attention is needed question Further information is requested

Comments

@ollo69
Copy link
Owner

ollo69 commented May 12, 2022

I open this survey with the purpose to collect the customizable command used in the configuration option. This would probably help to understand the right command to use for different AndroidTV models and find a method to implement this in backend library.

Please provide:

  • Model and manufacturer of your AndroidTV device
  • Customizable command configured

Thanks.

@ollo69 ollo69 added help wanted Extra attention is needed question Further information is requested labels May 12, 2022
@ollo69 ollo69 self-assigned this May 12, 2022
@ollo69 ollo69 pinned this issue May 12, 2022
@ollo69 ollo69 changed the title SURVEY: Customizable command used SURVEY: Customizable commands used May 12, 2022
@glassbase
Copy link

glassbase commented May 12, 2022

Onn Android TV with OS 10
current app:
dumpsys activity a . | grep -E 'mResumedActivity' | cut -d ' ' -f 8 | cut -d '/' -f 1
** this untested with your custom component, it was merely what I figured out using adb_response with official component.

(I am not an expert with this type of coding (grep, etc) but this is what I figured out so far)

@glassbase
Copy link

glassbase commented May 12, 2022

Based on my experience with this Onn with OS 10 with official component: app_id, app_name, source is never populated. So do we need a way to create custom command to get current app?

GET_PROPERTIES from official component:

{
  "screen_on": true,
  "awake": true,
  "audio_state": "paused",
  "wake_lock_size": 4,
  "current_app": null,
  "media_session_state": null,
  "audio_output_device": "hdmi",
  "is_volume_muted": false,
  "volume": 15,
  "running_apps": [
    "com.android.systemui",
    "com.google.android.inputmethod.latin",
    "com.google.android.tv.remote.service",
    "com.google.process.gservices",
    "com.google.android.tvrecommendations",
    "com.netflix.ninja",
    "com.google.android.apps.mediashell",
    "com.google.android.tv.axel",
    "com.google.android.katniss:interactor",
    "com.google.android.katniss:search",
    "com.google.android.gms.unstable",
    "com.plexapp.android",
    "com.android.providers.tv",
    "com.google.android.gms",
    "com.google.android.gms.persistent",
    "com.google.android.partnersetup",
    "com.quickplay.android.bellmediaplayer",
    "com.android.vending",
    "com.google.process.gapps",
    "com.android.vending:background",
    "com.google.android.tvlauncher",
    "com.askey.android.tvsetup.partnercustomizer"
  ],
  "hdmi_input": null
}

@kauelima
Copy link

kauelima commented May 18, 2022

Hey guys! I'm the one with the TCL c725. I've used the HA-androidtv11 hack but now changed to this as it seems to work a little better. @ollo69 I was using your samsung integration before changing my now defunct samsung for this new TCL! Your work is great!

Let me know what I can do to help gather more information. At this time I'll report some things that I already tried:

Model name: TCL c725 with android 11 (Google TV). On Android, the model reads as "Smart TV Pro"

Here's the properties using this custom component:

adb_response: com.tcl.tv
hdmi_input: TV
friendly_name: Android TV 192.168.3.38
supported_features: 23997
source_list:
  - com.google.android.gms
  - com.android.systemui
  - com.tcl.bi:service
  - com.google.android.ext.services
  - com.tcl.usercenter
  - com.google.android.tv.remote.service
  - com.google.android.katniss:search
  - com.android.providers.media.module
  - Google TV Launcher
  - com.android.providers.tv
  - com.google.process.gapps
  - com.tcl.inputmethod.international
  - com.tcl.xian.StartandroidService
  - com.google.android.youtube.tv.recommendations
  - com.google.process.gservices
  - com.google.android.apps.tv.launcherx:coreservices
  - Google Cast
  - com.google.android.gms.persistent
  - com.google.android.apps.mediashell:privileged_process0
  - com.google.android.katniss:interactor
  - de.cyberdream.androidtv.notifications.google
volume_level: 0.13
is_volume_muted: false
app_id: 'de.cyberdream.androidtv.notifications.google}:'
app_name: 'de.cyberdream.androidtv.notifications.google}:'
source: 'de.cyberdream.androidtv.notifications.google}:'
entity_picture: >-
  /api/media_player_proxy/media_player.android_tv_192_168_3_38?token=<REDACTED>&cache=1652890527.092747

ADB response was using @glassbase command
dumpsys activity a . | grep -E 'mResumedActivity' | cut -d ' ' -f 8 | cut -d '/' -f 1

Full resumed activity:
'mResumedActivity: ActivityRecord{d310a3b u0 com.tcl.tv/.TVActivity t478}'

What works:
On/Off button
Play/Pause button
Volume +
Volume -
Source changing

What does not work:
Entity and device not listed on ADB send command service interface
Volume slider (gets the current volume but does not set values)
States are weird
app_id
app_name
source
Entity picture blinks and turns dark to try and get the next picture

@ollo69
Copy link
Owner Author

ollo69 commented May 18, 2022

Here I'm just adding to standard integration the customizable commands implemented by @JeffLIrion in AndroidTV library. I hope that this thread and this repository can help to provide additional suggestion for the library and come back to original HA integration.

@JeffLIrion
Copy link

  • Model and manufacturer of your AndroidTV device

Specifically, what is needed is the output of this command:

https://github.com/JeffLIrion/python-androidtv/blob/043bbb5bf72717f40fde7ea3d4bb776293c49005/tests/test_constants.py#L119

getprop ro.product.manufacturer && getprop ro.product.model && getprop ro.serialno && getprop ro.build.version.release

@kauelima
Copy link

kauelima commented May 19, 2022

Specifically, what is needed is the output of this command:

Hey @JeffLIrion! In my TCL c725 that's the result:

adb_response: |-
  TCL
  Smart TV Pro
  d80140df0a50330ed
  11

I don't know how to run the whole script you linked to get this info, but if you need me to do it just direct me on how to and I'll do it!

@glassbase
Copy link

glassbase commented May 19, 2022

Onn Android TV

askey
sti6140d360
OUSA2110031108
10

here is my custom_current_app_media_session_state:
CURRENT_APP=$(dumpsys activity a . | grep -E 'mResumedActivity' | cut -d ' ' -f 8 | cut -d '/' -f 1) && echo $CURRENT_APP && dumpsys media_session | grep -A 100 'Sessions Stack' | grep -A 100 $CURRENT_APP | grep -m 1 'state=PlaybackState {'

@supergroover
Copy link

Nvidia Shield tv pro 2019

adb_response: |-
  NVIDIA
  SHIELD Android TV
  1323420042908
  11

Nvidia Shield tv 2017

adb_response: |-
  NVIDIA
  SHIELD Android TV
  0322818016167
  11

@TommisGR
Copy link

adb_response: |-
SkyworthDigital
TV Box
4482203280071217
10

and using custom_current_app_media_session_state:

CURRENT_APP=$(dumpsys activity a . | grep -E 'mResumedActivity' | cut -d ' ' -f 8 | cut -d '/' -f 1) && echo $CURRENT_APP && dumpsys media_session | grep -A 100 'Sessions Stack' | grep -A 100 $CURRENT_APP | grep -m 1 'state=PlaybackState {'

@boralyl
Copy link

boralyl commented Aug 20, 2022

2019 Nvidia Shield Pro

$ getprop ro.product.manufacturer && getprop ro.product.model && getprop ro.serialno && getprop ro.build.version.release
NVIDIA
SHIELD Android TV
1320722089217
11

@jrousek
Copy link

jrousek commented Feb 5, 2023

SkyworthDigital
TV Box
4490000000268143
10

unfortunately, I still haven't understood how I can add states or other

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed question Further information is requested
Projects
None yet
Development

No branches or pull requests

8 participants