Native support for Android TV / Android devices


What features are available through this component,
Please make a video,
As I am getting it working, but can’t see any options to open an app using this component.


Wait how did you install the ADB binaries on Hassio ? I thought that was impossible, but I don’t know much bout Hassio. I’m going to assume you meant Home-assistant installed with docker on a RPi to help you solve your issue. We’re going to updtate the library used by this component:
cd /config/deps/lib/python3.6/site-packages/androidtv/
Then restart HA and report back! :wink:

@noheton Glad you got it to work, ADB connection can be inconsistent sometime.


The available features are explained in the original post, under the service section. The “Open app” service has not yet been implemented as I don’t have access to an Android TV for the hollidays.


Now the adb connection seems to work but unfortunately the androidtv package cant make sense of my device properties.

Init of the component fails with:

File “/config/deps/lib/python3.6/site-packages/androidtv/ **init** .py”, line 327, in device_info
btmac = re.findall(BTMAC_REGEX_PATTERN, properties)[0]
IndexError: list index out of range

My [email protected]:~$ adb shell getprop

[dalvik.vm.appimageformat]: [lz4]
[dalvik.vm.dex2oat-Xms]: [64m]
[dalvik.vm.dex2oat-Xmx]: [512m]
[dalvik.vm.heapgrowthlimit]: [192m]
[dalvik.vm.heapmaxfree]: [8m]
[dalvik.vm.heapminfree]: [512k]
[dalvik.vm.heapsize]: [512m]
[dalvik.vm.heapstartsize]: [16m]
[dalvik.vm.heaptargetutilization]: [0.75]
[dalvik.vm.image-dex2oat-Xms]: [64m]
[dalvik.vm.image-dex2oat-Xmx]: [64m]
[dalvik.vm.isa.arm.features]: [default]
[dalvik.vm.isa.arm.variant]: [cortex-a9]
[dalvik.vm.stack-trace-file]: [/data/anr/traces.txt]
[dalvik.vm.usejit]: [true]
[dalvik.vm.usejitprofiles]: [true]
[debug.atrace.tags.enableflags]: [0]
[debug.force_rtl]: [0]
[debug.hwui.use_buffer_age]: [0]
[dev.bootcomplete]: [1]
[drm.service.enabled]: [true]
[hwc.rm]: [0]
[init.svc.adbd]: [running]
[init.svc.audioserver]: [running]
[init.svc.bindersvr_tv]: [running]
[init.svc.blackBox]: [stopped]
[init.svc.bootanim]: [stopped]
[init.svc.cameraserver]: [running]
[init.svc.clearCounter]: [stopped]
[init.svc.console]: [running]
[init.svc.ddg]: [running]
[init.svc.debuggerd]: [running]
[init.svc.drm]: [running]
[]: [stopped]
[init.svc.gatekeeperd]: [running]
[init.svc.healthd]: [running]
[init.svc.insmod]: [stopped]
[init.svc.installd]: [running]
[init.svc.k2logcat]: [running]
[init.svc.keystore]: [running]
[init.svc.lmkd]: [running]
[init.svc.logd]: [running]
[init.svc.logd-reinit]: [stopped]
[init.svc.mdnsd]: [running]
[]: [running]
[init.svc.mediacodec]: [running]
[init.svc.mediadrm]: [running]
[init.svc.mediaextractor]: [running]
[init.svc.mount_cache]: [stopped]
[init.svc.mtk_rm]: [stopped]
[init.svc.netd]: [running]
[init.svc.p2p_supplicant]: [running]
[init.svc.servicemanager]: [running]
[init.svc.surfaceflinger]: [running]
[init.svc.tvnativeserver]: [running]
[init.svc.ueventd]: [running]
[init.svc.updatedns]: [stopped]
[init.svc.vold]: [running]
[init.svc.wakelock_proxy]: [running]
[init.svc.zram-svc]: [stopped]
[init.svc.zygote]: [running]
[media.hls.default.max-height]: [1080]
[media.hls.default.max-width]: [1920]
[media.stagefright.codecremote]: [0]
[mtk.disable_sync_from_ts]: [1]
[mtk.inside]: [1]
[mtk.omx.vdp]: [1]
[mtk.tma.enable]: [0]
[mtk.wopacket.force_default_on]: [1]
[]: [Android]
[net.change]: [net.dns1]
[net.dns1]: []
[net.dns2]: []
[net.hostname]: [android-a87b1772108d6866]
[net.qtaguid_enabled]: [1]
[net.tcp.default_init_rwnd]: [60]
[]: [0]
[persist.service.bdroid.bdaddr]: [22:22:bd:17:6e:7e]
[persist.sys.BTRemotePairingDone]: [0]
[persist.sys.CEC_wakeup_en]: [1]
[persist.sys.ColdBootReason]: [CrashBoot]
[persist.sys.Greenmutestatus]: [false]
[persist.sys.ICPsignon]: [0]
[persist.sys.OFFRS_UI_IS_OPENED]: [false]
[persist.sys.OLED]: [0]
[persist.sys.PHLRC]: [0]
[persist.sys.PinCodeResult]: [-1]
[persist.sys.PinStatus]: [NONE]
[persist.sys.WOWCAST]: [0]
[persist.sys.bluetooth.dialogs]: [true]
[persist.sys.dalvik.vm.lib.2]: []
[persist.sys.deviceprovisioned]: [true]
[persist.sys.dumpId]: [00000227_00000003_00033816.508622_1794]
[persist.sys.inputid]: [com.mediatek.tvinput/.dtv.TunerInputService/HW9]
[persist.sys.isfav]: [0]
[persist.sys.locale]: [de-DE]
[persist.sys.loungmode.booting]: [false]
[]: [true]
[persist.sys.mediaindex]: [3]
[persist.sys.power_appswitch]: [org.droidtv.playtv]
[persist.sys.power_currentstate]: [FULL]
[persist.sys.power_lastapp]: [none]
[persist.sys.power_previousstate]: [BOOTING]
[persist.sys.power_silentreboot]: [03.01.2019 4:38:07 vorm.(PERFORMED)]
[persist.sys.profiler_ms]: [0]
[persist.sys.screen_status]: [OFF]
[persist.sys.set_type]: [55PUS6482/12]
[persist.sys.source_ui_running]: [0]
[persist.sys.timezone]: [Etc/GMT-1]
[persist.sys.upgrade_filename]: []
[persist.sys.upgrade_source]: []
[persist.sys.usb.config]: [adb]
[persist.sys.virginbit]: [0]
[persist.sys.webview.vmsize]: [104857600]
[pm.dexopt.ab-ota]: [speed-profile]
[]: [speed-profile]
[pm.dexopt.boot]: [verify-profile]
[pm.dexopt.core-app]: [speed]
[pm.dexopt.first-boot]: [interpret-only]
[pm.dexopt.forced-dexopt]: [speed]
[pm.dexopt.install]: [interpret-only]
[pm.dexopt.nsys-library]: [speed]
[pm.dexopt.shared-apk]: [speed]
[]: [1]
[ro.allow.mock.location]: [0]
[ro.baseband]: [unknown]
[ro.board.platform]: [mt5891]
[ro.boot.flash.locked]: [1]
[ro.boot.hardware]: [mt5891]
[ro.boot.serialno]: [000070af2412bd2f]
[]: [Fri Aug 31 15:31:47 CST 2018]
[]: [1535700707]
[]: [Philips/PH7M_EU_5596/PH7M_EU_5596:7.0/NTG46/276:user/release-keys]
[ro.bootloader]: [unknown]
[ro.bootmode]: [unknown]
[]: [nosdcard,tv]
[]: [Fri Aug 31 15:31:47 CST 2018]
[]: [1535700707]
[]: [PH7M_EU_5596-user 7.0 NTG46 276 release-keys]
[]: [NTG46 release-keys]
[]: [Philips/PH7M_EU_5596/PH7M_EU_5596:7.0/NTG46/276:user/release-keys]
[]: [PH7M_EU_5596-user]
[]: [TWCLS075]
[]: [NTG46]
[]: [PH7M_EU_5596]
[]: [release-keys]
[]: [user]
[]: [jenkins]
[]: [REL]
[]: []
[]: [REL]
[]: [276]
[]: [0]
[]: [7.0]
[]: [24]
[]: [2018-07-05]
[]: [1]
[]: [1]
[]: [android-philips-tv]
[]: [N_Q3_2017]
[ro.config.debugdump.customized]: [true]
[ro.config.media_vol_steps]: [60]
[]: [true]
[ro.crypto.fuse_sdcard]: [true]
[ro.crypto.state]: [unsupported]
[ro.dalvik.vm.native.bridge]: [0]
[ro.debuggable]: [0]
[ro.expect.recovery_id]: [0x37a09ab16edfd8e4916c5830bc239fb7665091b5000000000000000000000000]
[ro.hardware]: [mt5891]
[ro.hdmi.device_type]: [0]
[ro.hwui.disable_scissor_opt]: [true]
[ro.hwui.drop_shadow_cache_size]: [6]
[ro.hwui.gradient_cache_size]: [1]
[ro.hwui.layer_cache_size]: [48]
[ro.hwui.path_cache_size]: [32]
[ro.hwui.r_buffer_cache_size]: [8]
[ro.hwui.text_large_cache_height]: [1024]
[ro.hwui.text_large_cache_width]: [2048]
[ro.hwui.text_small_cache_height]: [1024]
[ro.hwui.text_small_cache_width]: [1024]
[ro.hwui.texture_cache_flushrate]: [0.4]
[ro.hwui.texture_cache_size]: [48]
[ro.mtk.sys_driver_only]: [0]
[ro.mtk.system.audiosync]: [1]
[ro.mtk.system.av_record_lib]: [1]
[ro.mtk.system.cec.hal]: [1]
[]: [1]
[ro.mtk.system.dvbs.existed]: [1]
[ro.mtk.system.hbbtv.existed]: [1]
[ro.mtk.system.marketregion]: [eu]
[ro.mtk.system.mheg5.existed]: [1]
[ro.mtk.system.oad.existed]: [1]
[ro.mtk.system.subtitle.existed]: [1]
[ro.mtk.system.timesync.existed]: [1]
[ro.mtk.system.ttx.existed]: [1]
[ro.mtk.twoworlds]: [1]
[ro.nrdp.hdr10.revision]: [1]
[ro.nrdp.validation]: [ninja_4]
[ro.opengles.version]: [196610]
[ro.product.board]: [TPM17XE_96]
[ro.product.brand]: [Philips]
[ro.product.cpu.abi]: [armeabi-v7a]
[ro.product.cpu.abi2]: [armeabi]
[ro.product.cpu.abilist]: [armeabi-v7a,armeabi]
[ro.product.cpu.abilist32]: [armeabi-v7a,armeabi]
[ro.product.cpu.abilist64]: []
[ro.product.device]: [PH7M_EU_5596]
[ro.product.first_api_level]: [23]
[ro.product.locale]: [en-US]
[ro.product.manufacturer]: [Philips]
[ro.product.model]: [TPM171E]
[]: [PH7M_EU_5596]
[ro.recovery_id]: [0x37a09ab16edfd8e4916c5830bc239fb7665091b5000000000000000000000000]
[ro.revision]: [0]
[ro.runtime.firstboot]: [1546524549207]
[]: [1]
[ro.serialno]: [000070af2412bd2f]
[ro.setupwizard.mode]: [OPTIONAL]
[ro.sf.lcd_density]: [320]
[ro.system.hdr10.revision]: [1]
[]: [TPM171E_R]
[ro.tpvision.product.swversion]: [TPM171E_R.]
[ro.url.safetylegal]: []
[ro.wifi.channels]: []
[ro.zygote]: [zygote32]
[security.perf_harden]: [1]
[selinux.reload_policy]: [1]
[service.adb.tcp.port]: [5555]
[service.bootanim.exit]: [1]
[sys.boot_completed]: [1]
[sys.display-size]: [3840x2160]
[sys.hwc.improve.disable]: [0]
[sys.hwc.improve.enable]: [1]
[sys.isHbbTvActive]: [1]
[sys.isHbbTvStreamStart]: [0]
[sys.isMHEG5Active]: [0]
[sys.mtk.dmremoteservice.ready]: [1]
[sys.mtk.livetv.ready]: [1]
[]: [1]
[sys.mtk.tif.timeshift]: [1]
[sys.mtk.tvremoteservice.ready]: [1]
[sys.playtv.booted]: [1]
[sys.sysctl.extra_free_kbytes]: [24300]
[sys.sysctl.tcp_def_init_rwnd]: [60]
[sys.usb.config]: [adb]
[sys.usb.configfs]: [0]
[sys.usb.state]: [adb]
[system_init.startsurfaceflinger]: [0]
[vold.has_adoptable]: [1]
[vold.post_fs_data_done]: [1]
[wifi.interface]: [wlan0]
[wlan.driver.status]: [ok]


replacing yields:

Traceback (most recent call last):
  File "/home/pi/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/", line 128, in _async_setup_platform
    SLOW_SETUP_MAX_WAIT, loop=hass.loop)
  File "/usr/lib/python3.5/asyncio/", line 400, in wait_for
    return fut.result()
  File "/usr/lib/python3.5/asyncio/", line 293, in result
    raise self._exception
  File "/usr/lib/python3.5/concurrent/futures/", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/home/pi/.homeassistant/custom_components/media_player/", line 181, in setup_platform
    atv = AndroidTV(host, adbkey)
  File "/home/pi/homeassistant/lib/python3.5/site-packages/androidtv/", line 230, in __init__ = self.device_info()
  File "/home/pi/homeassistant/lib/python3.5/site-packages/androidtv/", line 330, in device_info
    wifi_out = self._adb_shell('ip addr show wlan0')
  File "/home/pi/homeassistant/lib/python3.5/site-packages/androidtv/", line 474, in _adb_shell_python_adb
    return self._adb.Shell(cmd)
  File "/home/pi/homeassistant/lib/python3.5/site-packages/adb/", line 376, in Shell
  File "/home/pi/homeassistant/lib/python3.5/site-packages/adb/", line 411, in Command
    return ''.join(cls.StreamingCommand(usb, service, command, timeout_ms))
  File "/home/pi/homeassistant/lib/python3.5/site-packages/adb/", line 439, in StreamingCommand
    for data in connection.ReadUntilClose():
AttributeError: 'NoneType' object has no attribute 'ReadUntilClose'


Do this as suggested by a1xea4
I got it working few hours back but forget to mention.

Thanks @a1ex4

cd /config/deps/lib/python3.6/site-packages/androidtv/
Then restart HA and report back! :wink:


I tho it it’s already implemented,
I would like to have music app under apps.
How to get it?
Please guide.
Thanks in adv.


I guess you are using the component with the adb key, and unfortunately I’m not sure I’ll be able to fully make the component work with this implementation. Can you please try the newer but with the component configured to connect to the adb server ? Should look like this:

  - platform: androidtv
    host: IP
    name: NAME


What do you mean ?


To control music.
I want to add music app.
How can I add it?


this works beautifully.


I took an initial stab at creating a addon for setting up an ADB server. Currently, it doesn’t work – it won’t install. Contributions are welcome! The repository and all the info you need can be found here:


A help needed,
When my android TV box is turned off,
My log is getting busy creating logs for not connected,
How to stop created Ng log when android TV is off

One more thing when my android is off the ui shows dark blue colour and when on it turns to light blue, please invert colours to match other media_player device.
When some thing is playing on amazon or any app, play symbol is seen( even if on idle)
But when I pause it, pause icon doesn’t appear,
Is it like that?
Please guide


@a1ex4 Component from PR19157 works great with Xiaomi Mi Box 3 (MDZ-16-AB with Oreo). I use configuration with ADB server. When will the component be included in HA?

#55 user here with a Mi Box 3, anyway i can help test this?

As I understand it the client version needs a ADB server running on the same machine as HA which is not possible on yet?? Any update on the Standalone version?


This is a screenshot playing and pausing youtube on my android box and still ui doesn’t change.
It is stuck at idle even when playing YouTube or any app video.


I think it’s possible to get ADB working on I’ve installed the portainer add-on. After that i’ve added a container with a Raspbian image and installed android-tools-adb on it. When i’m home tonight i can check if it really works. I think my Android TV is waiting for the authentication confirmation. At least that is what the log is tellling me

" This adb server’s $ADB_VENDOR_KEYS is not set
Try ‘adb kill-server’ if that seems wrong.
Otherwise check for a confirmation dialog on your device. "


I can confirm that it’s working on with ADB installed in a container !!!


Awesome ! :tada:
So what IP is in your configuration.yaml ? Because I thought that the user would need to find out on its own the container’s IP but if it works with then that’s just perfect.
Thanks! :+1:

To everyone else, sorry I don’t have any time to work on the component or fixing your specific issues… I’ll be coming back to it in a short time though :slight_smile:


The following is my configuration.yaml :

  - platform: androidtv
    name: AndroidTV
      "kodi": "Kodi"
      "tunein": "TuneIn Radio"     

Where is the internal container IP address. I think wil also work because the container is connected to the hassio network in Portainer. If more people are interested i can post some screenshots of the configuration i did in Portainer.