Philips Android TV component


I will add the new version and try the commands in few hours. Meanwhile here is the response from the /system call

"notifyChange": "http",
"menulanguage": "English",
"name": "Living room TV",
"country": "Romania",
"serialnumber_encrypted": "...",
"model_encrypted": "AR/NnwD3PqegI6MODoohu2+XxlVqMYiSkTo4xUXyOO4=\n",
"deviceid_encrypted": "...",
"nettvversion": "",
"epgsource": "one",
"api_version": {
    "Major": 6,
    "Minor": 1,
    "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",
        "companion_screen": "true"



Thanks, i got rid of HASSOS and i installed hassbian. Now i wass able to pair my tv. I picked up the latest file from github. One hour old, so thans for being so active on this subject. It shows up now in the main view. I’m unable to controll the TV.

The logfile shows the following errors. Is there still a pairing issue?

Update for fails
Traceback (most recent call last):
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/”, line 221, in async_update_ha_state
await self.async_device_update()
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/”, line 349, in async_device_update
await self.hass.async_add_executor_job(self.update)
File “/usr/lib/python3.5/asyncio/”, line 380, in iter
yield self # This tells Task to wait for completion.
File “/usr/lib/python3.5/asyncio/”, line 304, in _wakeup
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 “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/util/”, line 324, in wrapper
result = method(*args, **kwargs)
File “/home/homeassistant/.homeassistant/custom_components/media_player/”, line 226, in update
File “/home/homeassistant/.homeassistant/custom_components/media_player/”, line 303, in update
File “/home/homeassistant/.homeassistant/custom_components/media_player/”, line 373, in getState
r = self._getReq(‘powerstate’)
File “/home/homeassistant/.homeassistant/custom_components/media_player/”, line 280, in _getReq
return json.loads(resp.text)
File “/usr/lib/python3.5/json/”, line 319, in loads
return _default_decoder.decode(s)
File “/usr/lib/python3.5/json/”, line 339, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File “/usr/lib/python3.5/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)

Thank for the work on this.


wow great work… still the on/off is not working completely correctly… but …really thank you sooo much.

Ik tried to make a script:

alias: SBS6
- service: media_player.turn_on
- service: media_player.select_source
entity_id: media_player.philips_tv
source: SBS6

But this isn’t working. Looks like de select source is not working?
do you know what is going wrong ?


I installed the latest version and now it’s working. I think that it failed earlier because the TV was off for a long time and the state was reported as Idle. Also a few remarks, when i turn off the TV the state remains “idle” for 10 sec since the TV was turned off.

Also the set_volume_level method does not work for me.


I think it has to do with the pictrogram before the channel? how can i achieve this ? somebody know how ??


Very nice, on/off is working almost great for me. Sometimes it takes a while to register and sometimes pressing “ON” once doesn’t work, second time does then (I can probably improve on that somehow). Is this the problem you are having?

Exactly like I detailed in my post you have to add the emoji to tell if it is an app or TV channel.
You can just copy and paste it from here or somewhere else.
TV Channel: :tv: (television)
App: :iphone: (phone)

To type them in Windows use (Win + .) and type the name, but copying from here should work

  1. :tv: & :iphone:
  2. " " aka a space
  3. Name of the app/channel

You can also see it in the states section, just copy what is writting under source


Very nice, this state is idle is now reported better :wink: And, yeah, that is the default wait time (actually 5sec) until the update method kicks in. In theory it would make sense to report the state directly as off. Hmm, will think about it. Could be problematic if the turning off fails.

Hmm it works on my end. I also barely changed anything there.
I would try a curl POST command and check if you can set it that way.
route: /audio/volume

  'current': targetlevel,
  'muted': False

targetlevel: A number from 0-60

Also your api seems to be almost the same as mine, I could not imagine any command working for me, not working for you.


@nstrelow, is there any particular reason why you chose to use idle state rather than on?
I use universal media player and now it doesn’t work correctly at all after all changes re power state. As far as I understand idle for media player is considered “closer” to state off than on. Would it be better to use conventional states in case you decide to publish this component as an official?


Don’t have that much experience with HA code but digging into your code it might be the fact that the TV it’s turned off and only when the next poll interval happens the state it’s updated.


Doing a post on /audio/volume does not work for me :frowning:


Kudos on getting Hassbian, gives you much more freedom.

This is still most likely an pairing issue or the command is not supported by your TV.

You could also try executing:

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

Or even remove username and password, as this is not needed for access to /system
curl -X GET --digest --insecure https://<ip address>:1926/6/system

to check what nettvversion and what api version you have.

If you don’t have curl just install it with sudo apt-get install curl

But it is very probable that you still have some problem with the username and password. Double check that if you copied correctly


Yeah that is exactly it. It will probably be better to set it to OFF right away. The calling of the “powerstate” command gives us certainty that it’s off. If the command fails, then we would show it as OFF for 10sec before the powerstate is updated and detects the TV has not been shut down.

This is the only though I have in mind right now. Setting the powerstate should actually not fail, so it could be save. If it fails, well you would have to wait 10 secs, before being able to turn it off again.

Very sad :sob: Probably nothing to be done about it. You can try finding other ways of APIs for setting the volume


Also the media content type and media name it is set wrong in my case (app instead channel). The response from activities/current is

"component": {
    "packageName": "NA",
    "className": "NA"



Well what are you playing? A TV channel? But probably this part of the API is also not working.
You can check the States Tab in HA. All the detected channels and applications should be there under source_list. I assume you have nothing there.
Very sad that this is not working for you.

I do have “NA” too, when I have no app opened and just some HDMI channel.


Yes there is a very good reason. (correct me if I’m wrong)
Idle shows the player controller, e.g. the Play button.
An earlier version of somebody used STATE_ON, and that didn’t display the play button. As we have (currently) no way of checking if a video is playing or not, setting it to idle when on, enables resuming and pausing videos.

When using STATE_ON:



What could also work is setting “WoWLAN” to on, I think this makes the api more available throughout the TV.
Or try launching the commands when the home menu is opened.


Puh replying to so many people, I feel like Philips tech support.
I should ask them if they pay me for that :stuck_out_tongue:

Anyway, to sleep, have fun hacking around. Pull requests or also GitHub issues are always welcome.

But please add as much information as possible.
Great would be the /system GET call. That contains much useful information and shows directly if we have the same API.

Mine is 6.2.0


I see your point, but are you sure that it is a correct logic for media player to have a pair of states off and idle? Sorry for my ignorance but what is the use of Play button for automation purposes? If the pair off/idle is correct than it must be something else is wrong with the code why it does not integrate with universal player correctly.
I had to go back to my old code since it is more important for me to be able to combine cast and other players in one and to automate on/off, mute/unmute and use other attributes rather than to play/stop youtube from HA.


Yes i was playing a tv channel. In the Ha i can see the entire list of channels and qpps. More on that the activites/tv it’s returning the correct information for the current channel.


So that means that activities/current shows NA
But you are playing a TV channel which is correctly displayed at activities/tv ?
When TV is playing it is showing org.droidtv… something when using activities/current. I could change that and if activities/current is NA, but activities/tv is playing something then use the info from that.