To replace my older wall mounted Lenovo 10 inch tablet I bought one of these cheap China clones (LNMBBS P40). The tablet can be turned on and off with androidtv but no apps are found. Also the currently launched app is not displayed. This is the output of adb_response the calculator app is started but not recognized:
{'screen_on': True, 'awake': True, 'audio_state': 'playing', 'wake_lock_size': 0, 'current_app': None, 'media_session_state': None, 'audio_output_device': None, 'is_volume_muted': None, 'volume': None, 'running_apps': None, 'hdmi_input': None}
In another thread I found the custom query for Google TV Devices,
which is also stored in constants.py:
#: Get the current app
CMD_CURRENT_APP = "CURRENT_APP=$(dumpsys window windows | grep mCurrentFocus) && CURRENT_APP=${CURRENT_APP#*{* * } && CURRENT_APP=${CURRENT_APP%%/*} && echo $CURRENT_APP"
#: Get the current app for a Google TV device
CMD_CURRENT_APP_GOOGLE_TV = "CURRENT_APP=$(dumpsys activity a . | grep -E 'mResumedActivity' | cut -d ' ' -f 8) && CURRENT_APP=${CURRENT_APP%%/*} && echo $CURRENT_APP"
this GOOGLE_TV query works on my tablet:
P40-EEA:/ $ bash-5.0# adb -s 192.168.1.56 shell
P40-EEA:/ $ CURRENT_APP=$(dumpsys activity a . | grep -E 'mResumedActivity' | cut -d ' ' -f 8) && CURRENT_APP=${CURRENT_APP%%/*} && echo $CURRENT_APP
com.google.android.calculator
How does androidtv distinguish if it is a Google device or a ‘normal’ Android device?
What can I do, so that my tablet is recognized as a Google TV device?
I updated docker image to the current Homeassistant version 2021.2.3, but unfortunately with the same result. My current androidtv version
androidtv in /usr/local/lib/python3.8/site-packages (0.0.57)
The tablet has Android version 10 installed.
I have several Android phones, tablets and fire tv’s they all work fine, but they all have an Android version lower than 10. Maybe that makes a difference
My media_player entry in configuration.yaml looks like this:
media_player:
- platform: androidtv
name: LNM Tablet
device_class: androidtv
host: !secret ip_lnm_tablet
adb_server_ip: !secret ip_localhost
turn_on_command: !secret lnm_tablet_unlock
turn_off_command: "input keyevent POWER"