Philips Android TV component

Detecting the playing state is not possible with the API. We can only Play or Pause, but not know which state the video is in.

Is it possible to filter the dropdown (source) menu?

You can create a favorite lists for your TV channels and then put “favorite_channels_only: true” in your config. Then only your favorite channels are displayed.

No way to do this for apps currently.
Make a feature request to the home assistant media player for this. Since this is a standart component.

I already use this

Would be nice to have this for the apps too.

To be honest I don’t know how and where to open a pull request. When I click open pr it tells me to compare versions.
Could you open that PR?

A PR is when you want to submit code changes you made.
Make a feature request thread here in this forum, and hope that others will upvote it.

In GitHub Repos you can create Issues to make feature request.

Done:

There has been some great code clean up from Marcos Amorim.

Checkout the better code on Github.

I bumped the version to 0.0.3, but there have been no functional changes.

Bumped to 0.0.4 because of errors

I followed the manual from https://github.com/nstrelow/ha_philips_2016
But I get the following error.
tv is on, pairing succesfull, hass and pi rebooted… config added in configuration.yaml

Configuration invalid
Platform not found: media_player.philips_android_tv

folder:

Anybody has an idea?

Files look fine for me. How does the config look like?

Try playing around with your config, maybe some whitespace is messing it up.

I don’t see anything strange in the ident or so…
It is under the mediaplayer: header…

When checking the config it comes with:
48

After retyping all the entities. AND changing the name to something without quotes
it worked on 93.2…

This morning I accidently upgraded to 94…
Problem is back
&*^%$#$%

Does it still work for you guys?

Probably something to to with custom components inside HA. Try again, something will make it work again :wink:

Ans try without the quotes. I think they are not necessary in yaml

Tried it indeed without quotes… yesterday it worked… after updating… broken again…
hmmmm tonight again new possibilities to try…

So for all those like me who do not know Python etc and don’t understand the minimal explanation that the techies are giving for getting the pairing codes, here is what I ended up doing. Anyone please correct me if I’m wrong as it took me days to figure out and I didn’t document it…
The pairing does not need to be done on the Pi (I actually ruined a Hassio installation), but can be done in Windows. Commands are all run from the normal Windows command prompt (which I ran as Administrator, but I’m not sure that’s necessary)

  1. Download and install Microsoft Visual C++ Compiler for Python 2.7 from https://www.microsoft.com/en-us/download/details.aspx?id=44266; it will be required for the pip installation later on
  2. Download Python 2.716 (I used this version as dziugasp mentions in his comment) https://www.python.org/downloads/release/python-2716/
  3. Install Python, in the installation wizard click the Advanced button and tick:
    Compile .py files to byte code after installation.
  4. Read this: https://github.com/BurntSushi/nfldb/wiki/Python-&-pip-Windows-installation
  5. Do the verification and the full pip install as described in doc above. Note that all commands are in the normal Windows command line and you need to cd to the directory that either python.exe or pip (in scripts folder) are installed in
  6. From https://github.com/suborb/philips_android_tv copy [requirements.txt] to the pip folder and run the command pip install -r requirements.txt from the command prompt. It should run without errors (no red text or error descriptions) and install ‘pycrypto’ and ‘requests’. It had errors for me before I installed the MS Visual C++ compiler.
  7. Turn on the TV
  8. From https://github.com/suborb/philips_android_tv copy [philips.py] to the python folder and run python philips.py --host <IP of TV> pair from the command prompt
  9. You should then get the 4 number password on the TV to enter into the prompt which should give you the username and password.
    Hopefully this helps many others of you and save you days of pulling out hairs and swearing at your computer! And thanks to the techies for developing this awesome component, keep up the good work!
    Windows 10, HASSIO, Philips 43PUS7202
7 Likes

LOL… retyping the platform… did the trick this time… weird things happen sometimes…

I had some issues with the “get_channels” option, see issue

State doesn’t change en some errors #15

My python skills are not the best but today I change my own code and add the option disable_channels.
I have made a Pull Request with my code.

Hi,

I have pairied succesfully my Philips 55pus7503 tv, but have this problems

2019-6-9 22:01:19] [PhilipsTV] getAmbilightState - Got non JSON answer - not updating state: ’

getPowerState - Got non JSON answer - not updating state:

The same with volume state, basically with all states

I have icons in Home app. but their is sign NO RESPONSE
Any ideas?

Time for some quality of life updates. Less crashes! Better errors!

As I cannot test, I need some testers which can confirm everything is working
If I you guys green light it, I will make the update available through custom_updater for the rest.

Update media_player.py in custom_components/philips_android_tv.

Previously when the TV would return a non json repsonse, the component would just miserably die, forcing you to restart HA, if you still wanted it working.

Now a non json response (mostly html) of the will print a warning in the log. It will contain the API, which returned a non json response and what this response was.

This should make it possible to better understand errors and maybe make changes to avoid them. And make a compatability chart of which TV is compatible with which program.

I have updated the philips_android_tv component with our latest code and it is starting as it should and I can control the TV :slight_smile: Is there anything special you would like me to test? I am using a 55PUS8303/12 model.

1 Like