suborb / philips_android_tv

Tools to control Philips 2016 Android TVs
GNU General Public License v2.0
121 stars 61 forks source link

Switch to specific source #9

Open stijnbuurman opened 6 years ago

stijnbuurman commented 6 years ago

First of all, thanks a lot for making this library. I can now turn on the tv with my google home and who knows what more. There is just one thing that i'm missing desperately, when I turn on my tv and xbox with a voice action, i need the tv to switch to a specific source. The only solution I found is using key presses: 'Sources' -> up/down -> 'enter'. But as the order of sources is not always the same (depends on which devices are on, and what source it is currently on), it is hard to determine how many up's or down's i need.

So the question: Did you find a way to access the sources api? Or do you know another way?

fliphess commented 6 years ago

I ran into the same challenge and am still looking for a real solution, but by tcpdumping and man in the middling the official philips ios app it seems to me that this is not possible using the jointspace implementation of post 2016 philips TV's....

Even the ios app does not support selecting sources in other ways than opening the "sources menu" and selecting one by navigating to the correct source and selecting Confirm, which is the current way i use too....

nstrelow commented 5 years ago

There is a lot of talk about building a Home-Assistant integration here: https://community.home-assistant.io/t/philips-android-tv-component/17749/93

There is code for easy stuff like volume setting, but some folks figured out how to set sources (I think it was home assistant user boloni, script for switching is his):

Source (Channel) switching: https://github.com/nstrelow/ha_philips_2016/blob/master/philips_2016.py#L373 (currently not used in the plugin as I switched it to showing apps) Also similar to issue #7.

App switching: https://github.com/nstrelow/ha_philips_2016/blob/master/philips_2016.py#L379 Detailed payload found in issue #5, in the component I just send back what I got from /applications

And somebody made a component for setting Ambilight through home assistant: https://community.home-assistant.io/t/philips-android-tv-ambilights-light-component/67754/18

stijnbuurman commented 5 years ago

If I remember correctly changing channels does not allow to change source. I actually have home assistant so thanks for the integration! I will try it out soon

nstrelow commented 5 years ago

Oh you mean switching the HDMI selected device? You could try using HDMI CEC commands. That would make it possible, but you need e.g. a Raspberry Pi attached to the TV