Philips Android TV component


videoland: org.droidtv.nettvbrowser
RTL XL: org.droidtv.nettvbrowser
KIJK: org.droidtv.nettvbrowser
NPO: org.droidtv.nettvbrowser


Renamed StateC to on, as I have no idea why it was called StateC
Also the new version is also using /powerstate, and setting the state in getState(). Exactly the same way you are doing it:

def getState(self):
        r = self._getReq('powerstate')
        if r:
            self.on = r['powerstate'] == 'On'
            self.on = False
if self._tv.on:
    if self._state == STATE_OFF or self._state == STATE_UNKNOWN:
        self._state = STATE_IDLE
        self._state = STATE_OFF


Ahh this explains it. This is a different internal app, which does not have a label. How do you use this NetTV browser?
This is not just an app you get from the Play Store right? Is it a Philips TV specific app?


i thought these packages were installed via the Philips App gallery… But i thought also some packages were installed with the google play store.


I think there is a difference in approche… you Will set the self._tv.on with an True or False.
In the stateC version there is a value: ON, or OFF.

When your television is off, but there is still networkactivity in the TV, the self._tv.on is set to TRUE (as it gets a response with the value OFF in your version)

When the television is turned off for a longer period… also the network stops responding. Then the self._tv.on will be FALSE (as it is the default value in the init section).

EDIT: TESTED IT AGAIN with your latest version
Television is off.
Turn it on with HA.
It is turning on… state from unknown to IDLE
then… turn off television: STATE is still IDLE.
HA keeps television in IDLE status. I can’t turn my television on again… .because it is already on with HA


I think it is a matter of taste what to do here. We have 3 situations:

Online but Off
Online and On

I currently use in the first two scenario’s off. In the current version it is using idle in the second off in the first and I think nstrelow wants to indicate On with a playing state if i am not mistaken?


This explains it, thx

I see, yeah that’s true, and it’s on my Todo list (@JSON_v62 code already handled it properly, I just didn’t see the problem when I changed it)

Will think about handling that state today and hopefully publish another version later today


Oh and a quick fix for turning on the TV when in Standby but the component reports idle:

Just press the play button :stuck_out_tongue: because sending any key when it is in the screen-off-but-online state turns it on


So with the new version i still got this failure

Traceback (most recent call last):
File “/usr/local/lib/python3.6/site-packages/homeassistant/helpers/”, line 221, in async_update_ha_state
await self.async_device_update()
File “/usr/local/lib/python3.6/site-packages/homeassistant/helpers/”, line 349, in async_device_update
await self.hass.async_add_job(self.update)
File “/usr/local/lib/python3.6/concurrent/futures/”, line 56, in run
result = self.fn(*self.args, **self.kwargs)
File “/usr/local/lib/python3.6/site-packages/homeassistant/util/”, line 324, in wrapper
result = method(*args, **kwargs)
File “/config/custom_components/media_player/”, line 225, in update
File “/config/custom_components/media_player/”, line 305, in update
File “/config/custom_components/media_player/”, line 343, in getChannelList
r = self._getReq(‘channeldb/tv/channelLists/all’)
File “/config/custom_components/media_player/”, line 279, in _getReq
return json.loads(resp.text)
File “/usr/local/lib/python3.6/json/”, line 354, in loads
return _default_decoder.decode(s)
File “/usr/local/lib/python3.6/json/”, line 339, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File “/usr/local/lib/python3.6/json/”, line 357, in raw_decode
raise JSONDecodeError(“Expecting value”, s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)


Hi I’m new to the party and i like to try and connect my philips 49pus850312 to with home assistent 0.81.0. In this thread was mentioned to start the pairing process. So far i have tried to do this directly from the ssh console :
core-ssh:~# python3 /config/ --host pair
core-ssh:~# /config/ --host pair

also tried to create a switch to start the script from the interface.
s = “Python syntax highlighting”
platform: command_line
command_on: python3 /config/python_scripts/ --host pair
command_off: python3 /config/python_scripts/ --host pair

All attempts have failed. i even installed python on windows with some dependent modules. there i get stuck on No module named ‘Crypto’.

Help is welcome


The script needs to be executed only once to get a username and password combo.

When executing it, you should be greeted with “Starting pairing request. Enter onscreen passcode”, where you have to enter the PIN then displayed on your TV screen. And have the Android TV Launcher open to be sure.
After entering the PIN you get a username/password combo you can use for all other requests.

The original repo with the script:

The device you execute this script from doesn’t matter. To make it work you have to install the needed packages. This is done by going into the directory of the repo and doing pip install -r requirements.txt. Should also work on windows. Have fun


Hmmm, I cannot see why this shouldn’t work. Try repairing it and specifying a new user/password in the config.

Somehow the TV is returning something other than JSON (probably HTML). This can be the case when the command channeldb/tv/channelLists/all is not know by the TV or the authentication fails, in which case pairing again might fix it.


Hi, thanks for the responce. I was aware i only have to pair once and i was using the py file in the repo like you suggested. The pip install -r requirements.txt was new for me. but it seems it is also new for hassio. I got the error :
-bash: pip: command not found

So went over to my windows box again and tried it there. Result:
Command “c:\users\user\appdata\local\programs\python\python37-32\python.exe -u -c “import setuptools, tokenize;file=‘C:\Users\martin\AppData\Local\Temp\pip-install-hvoop69i\pycrypto\’;f=getattr(tokenize, ‘open’, open)(file);’\r\n’, ‘\n’);f.close();exec(compile(code, file, ‘exec’))” install --record C:\Users\martin\AppData\Local\Temp\pip-record-l59pts7l\install-record.txt --single-version-externally-managed --compile” failed with error code 1 in C:\Users\user\AppData\Local\Temp\pip-install-hvoop69i\pycrypto\

am i doing something that is not allowed on hassio and only allowed on hassbian? The windows part was a last resort. I hope to do everything with the Pi.


Windows requires Microsoft Visual C++ Build Tools to be installed, which is a hassle. You could also try using Ubuntu on Windows Subsystem for Linux.

I don’t know your setup. If you have HassOS, it may be more difficult to install python correctly.
In my homeassistant docker container pip and python3 -m pip are working.

So go and figure out how to use install the requirements using pip, either on windows or your PI. You will figure it out I am sure of it :wink:


does anyone know how to fireup a http get command using the commandline in HA.
trying to get the powerstate with
requests.get(“https://ipaddress:1926/6/powerstate”)… but get error about x server …


I tried repairing but had no luck with it my tv modelnumber is: 40PFK6580/12


As far as I could find out, your model is from 2015. You might have more luck using the official Philips TV component or something else as this component is for 2016+ models.

I think this:
Probably with api version 5, but really it’s for you to find out :wink:


New Version
(Pro tip: You could build a script to git pull the newest changes)

(Play Movies and TV is my only TV channel :see_no_evil:)

  • Fixed on state: Now the TV is only shown as on when the screen is on (powerstate is on).
  • Now both channels and apps are switchable on source select
  • Better handling of launching System Apps, launching Settings shortcuts now works

Notes: When sending WakeOnLAN to the Wifi Mac of the TV the API is powered on. At that state (saved in the variable api_online) the TV can be talked to via the API. This could enable directly launching an App, because the TV starts when POST request is received. I have no good idea on how this could be used yet, suggestions welcome.

To make clear if it is an app or a TV channel you are choosing I am using the icons :iphone: for apps and :tv: for TV channels. This gives a clear overview, but also distinguishes between e.g. the Play Movies app and channel.

It is possible to create automations using the media_player.select_source service. When using this to launch an app or channel, be sure to include the icon (:iphone: or :tv:), a space and then the name of the app, as shown in the source list.
Example for YouTube:

  "entity_id": "",
  "source":"📱 YouTube"

Hope you all have unicode emoji support :man_technologist:


I installed the latest version. I have a philips POS9002 and i get this error once in 10sec:

2018-11-01 16:47:12 ERROR (MainThread) [homeassistant.helpers.entity] Update for media_player.philips_tv fails
Traceback (most recent call last):
File “/usr/local/lib/python3.6/site-packages/homeassistant/helpers/”, line 221, in async_update_ha_state
await self.async_device_update()
File “/usr/local/lib/python3.6/site-packages/homeassistant/helpers/”, line 349, in async_device_update
await self.hass.async_add_executor_job(self.update)
File “/usr/local/lib/python3.6/concurrent/futures/”, line 56, in run
result = self.fn(*self.args, **self.kwargs)
File “/usr/local/lib/python3.6/site-packages/homeassistant/util/”, line 324, in wrapper
result = method(*args, **kwargs)
File “/config/custom_components/media_player/”, line 229, in update
self._source_list = self._tv.app_source_list + self._tv.channel_source_list
TypeError: unsupported operand type(s) for +: ‘NoneType’ and ‘NoneType’


Okay, bad error handling from my side there. Uploaded a new version, which should not throw an error if there are no apps and channels:

More concerning is the part that both /channeldb/tv/channelLists/all and /applications is not working for you.
Does the 2017 model have a new api, which does not support these commands? You can try the commands yourself and report back.

Interesting for me would be what API version you have:
Could you execute the /system command and post your results?

curl -X GET --digest --insecure -u user:password https://<ip address>:1926/6/system

And remove the serialnumbers and device ids, just to be safe :wink:

    "notifyChange": "http",
    "menulanguage": "English",
    "name": "43PUS6401/12",
    "nettvversion": "8.1.0",
    "epgsource": "one",
    "api_version": {
        "Major": 6,
        "Minor": 2,
        "Patch": 0
    "featuring": {
        "jsonfeatures": {
            "editfavorites": [
            "recordings": [
            "ambilight": [
            "menuitems": [
            "textentry": [
            "applications": [
            "pointer": [
            "inputkey": [
            "activities": [
            "channels": [
            "mappings": [
        "systemfeatures": {
            "tvtype": "consumer",
            "content": [
            "tvsearch": "intent",
            "pairing_type": "digest_auth_pairing",
            "secured_transport": "true"