Philips Android TV component


#205

Well like it says:

“<!DOCTYPE html>” Should not be there, this comes from download http sites instead of the .py file


#206

Did you try the original Phtilips TV component? There is an official component, maybe that works better for you.

Also I had some problems with http requests using Postman. It just stopped working after a while.

This and your problem could be related to HTTP long polling which the API is using: https://www.pubnub.com/blog/2014-12-01-http-long-polling/


#207

Strange. I have uploaded file philips_2016.py which was downloaded from your Github page. I will try original component tonight. Thanks!


#208

@nstrelow The script is working fine! Thanks a lot… you are a genius, the only part that won’t work is the turn on tv button. Do you have any idea how to fix this?


#209

I have the same problem. Suspect the TV reacts to WakeOnLan packets, and is only then controllable.


#210

Thanks for the great work! :smiley:
I got it working with my 55POS9002. I don’t have cable/flow tv, only use Apps and HDMI. I got a Intel NUC connected to my Denon X1000 receiver and I would like to detect when it’s active on HDMI. The receiver is connected to HDMI 2 and HA can’t detect that source.

image

Current activities shows

curl -X GET --digest --insecure -u user:pwd https://172.16.0.30:1926/6/activities/current

{“component”:{“packageName”:“org.droidtv.playtv”,“className”:“org.droidtv.playtv.PlayTvActivity”}}

I tried lots of variants of sources, current sources. Any ideas?
I’m running lasted version of https://github.com/nstrelow/ha_philips_2016 and a Raspberry Pi3 Hassbian image, HA version 0.82.1.

/Lars


#211

It is working for me. Takes a while until it starts.
Make sure to have Wake on WLAN WoWLAN, enabled, it’s in the network settings of the TV


#212

I do not think I found a possibility to switch between hdmi devices.
Sources are only channels and apps. TV is one app and you can start it, but that will just display the last hdmi channel used I think.

Try https://www.home-assistant.io/components/hdmi_cec/
I use it to switch between hdmi devices. You have to have your HA devices (e.g. RPI) attached to the tv via hdmi


#213

I got it working. Instead of downloading component directly from GitHub, I have downloaded raw version. And it worked like a charm. Thanks!


#214

Look on a media_player.philips_js component and a patched ha-philipsjs. It should work with allcab/allsat as well.


#215

Hi,

i tried to set up the philips_2016 and ambilights component. Both devices (mediaplayer and light) are unknown or not availbale.

I have a 9002.

For the mediaplayer component I get this error (it looks very similar to the one I get from the ambilight component):

Update for media_player.tv fails
Traceback (most recent call last):
File “/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity.py”, line 221, in async_update_ha_state
await self.async_device_update()
File “/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity.py”, line 349, in async_device_update
await self.hass.async_add_executor_job(self.update)
File “/usr/local/lib/python3.6/concurrent/futures/thread.py”, line 56, in run
result = self.fn(*self.args, **self.kwargs)
File “/usr/local/lib/python3.6/site-packages/homeassistant/util/init.py”, line 324, in wrapper
result = method(*args, **kwargs)
File “/config/custom_components/media_player/philips_2016.py”, line 235, in update
self._tv.update()
File “/config/custom_components/media_player/philips_2016.py”, line 314, in update
self.getState()
File “/config/custom_components/media_player/philips_2016.py”, line 381, in getState
r = self._getReq(‘powerstate’)
File “/config/custom_components/media_player/philips_2016.py”, line 291, in _getReq
return json.loads(resp.text)
File “/usr/local/lib/python3.6/json/init.py”, line 354, in loads
return _default_decoder.decode(s)
File “/usr/local/lib/python3.6/json/decoder.py”, line 339, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File “/usr/local/lib/python3.6/json/decoder.py”, 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)


#216

Hei

I have an 55PUS7272/12 and are new to this and want to connect it to HAIO.

Have tried different ways but not seems to get it to work.

Could anyone tell me step by step how to connect my PH TV to HAIO?

Thanks very much for helps :slight_smile:


#217

Hey guys,

Thank you everyone for contributing to this component!

The one thing that I really hated about my Philips TV is that I had to go deep into the menu to turn on/off ‘Ambilight + hue’ (the one that syncs hue lights and TV’s ambilight), which made it almost impossible to automate. While Philips mobile apps can toggle this setting, I’ve never seen anybody successfully changing this setting through the exposed API.

So, I’ve decided to sniff the traffic between the mobile app and the TV using a simple man-in-the-middle attack and BINGO, now I can actually get the status and toggle ‘Ambilight + hue’. I need to run some more tests, but it definitely works!

I have 2 questions for the community:
1) Is this ‘Ambilight + hue’ setting useful for anyone besides me?
I can add it to the component, but I want to make sure that this would not be a useless change.
2) Is there any other functionality in the iOS/Android app that has not been discovered in the API yet?
I can sniff the traffic and hopefully add the missing functions.

Cheers guys!


#218

This is very usefull. I almost never use Ambilight because of the hidden menu.


#219

@Nutti85 Thanks for the reply, glad to hear I am not the only one who hates this menu… Which TV model do you have? Would you be willing to test the updated component if I prepare one? (it works on my TV, but I want to test it on other models before making it public…)

@nstrelow Would you be open to accepting a Pull Request with “Ambilight + hue” toggle added? If yes, I’ll prepare one once everything is tested and ready to go.


#220

This looks like it is not working for your TV model OR your username password or some other setting is wrong.


#221

I think it becomes very clear that I need a good Readme in my Github repo.
I will try to add one soon and link it back here.


#222

Not sure, I did go through all know APIs and the app itself, and I don’t think there is something especially useful not already discovered in an API. A way to switch between HDMI devices, that would be awesome.

I am super happy to get PRs. But I am unsure if this fits into this media component.

Actually there is an Ambilight component Philips Android TV Ambilights (Light) component

Check that out, it supports a lot of different modes. Maybe your change is already built in or it fits better there.

Ideally we should built a python module for the Philips TV. It should support everything from media player, app switching and amiblight stuff, so everything the API supports.
This python module should then be used for both Ambilight and media player.


#223

Very much appreciated

Thank you


#224

Thanks, that’s a good idea, I’ll give it a go.

Not sure if there is a way through API (I’ll check), but it’s super easy through ADB: you can send any keypresses through it and function keys (F1, F2, etc) switch input on my Philips TV.