Philips Android TV component

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

Thank you, if it works and nothing unforseen happens, then this is enough.

Just bumped the custom_updater version number.

Problem with favorite_channels: Fixed!

Hi!

As custom_updater is deprecated now, can you add HACS support?
Thanks!

1 Like

Very very awesome. Thanks for telling me!

I will look into how to migrate to it :grin:

1 Like

HI,

i have a 55pus8503 and I was able to connect it to home assistant. but I only get the media player button. I am not able to get anything else.

What I am really searching for is a way to determine if the tv is powered on.
Is there a easy way to get this done?

i am not able to find it here.

Thanks!

try pressing on the 3 vertical dots icon on the right hand side of the media player card

Yes that works, any way to just get the powerstate? I want it in an automation.

its just the state attribute so:
{{states("media_player.livingroom_tv")}}
works for me and returns ‘on’

You might be better off doing a negative check for ‘off’ - I need to confirm, but I think at times, if I’m chrome casting, or in smart tv, the state might not be ‘on’ but something else. I need to test/confirm this though so I can raise an accurate issue if that is the case

e.g.

{% if is_state("media_player.livingroom_tv","off") -%}
off
{%- else -%}
on
{%- endif %}

Thanks it worked,

I am still testing but for now it got the following states back:
TV on = On
Tv off = Off
Tv in apps = idle

i need to further test to see what other status i get back, if i have done this i will share it here.

1 Like