eslavnov / pylips

Control Philips TVs (2015+) and Ambilight (+ Hue) through their reverse-engineered API (+ MQTT support!)
MIT License
334 stars 58 forks source link

[FEAT] Add Support for Saphi OS TVs #73

Open emivaljr opened 3 years ago

emivaljr commented 3 years ago

Is your feature request related to a problem? Please describe. Couldn't find anywhere saying that this code supports Saphi OS TVs and this would be nice to have.

Describe the solution you'd like I would like to be able to control Saphi OS TVs with the same commands that you have for other philips TVs

Describe alternatives you've considered I don't think there is anywhere some alternatives for this type of TVs.

Additional context No

eslavnov commented 3 years ago

Hi @emivaljr,

Saphi OS TVs are not officially supported by Pylips, but some of the commands still work (don't know which). You can check #39 and #47 for some discussions on this topic.

The gist of it is that since I don't own a Saphi OS TV, there is nothing I can really do to add a proper support for such models. I need somebody to try all Pylips commands with such a TV and let me know which ones fail. Besides that, I need someone to capture the traffic (I use Charles for that) from the official mobile Philips TV Remote app sending these commands (that fail on Pylips), so I can reverse-engineer the payloads and fix them in Pylips.

Since I am flying totally blind here, there is unfortunately nothing I can do without the community's help.

JurnD commented 3 years ago

I would really like to help with this since I just got a philips 55pus6704/12 (Saphi) TV. Unfortunately I have not been able to connect the Philips TV Remote app to it and when I try pylips.py it succesfully connects but then the TV immediately closes port 1925. It's open after taking the power of, but it stays open about 12 seconds after connecting anything to it.

Before I start wasting time on this TV, has anybody else experienced the port closing?

Edit: So I came to a conclusion way too soon. It seems version 6 of the API does work, but as soon as an incorrect command is send the port closes. So for example "powerstate" and "home" do work, but "list_channels" closes the port. And then I have to completely remove power to the TV to get it open again.

That being said, there is no philips remote app I can get to work with this TV even though they say they are connected. I suspect they use /1/system instead of /6/system which both give a reply but everything else I send to API 1 gets a forbidden message.

DavidFFerreira commented 3 years ago

JurnD thats not correct, I have tried several commands, and I did never reboot the TV. the ports didn't close at all. Some commands don't work, thats true, but the most works. Power on, standby, volume up, volume down, scenes of ambient light...5*

emivaljr commented 3 years ago

@DavidFFerreira Are you sure you have Saphi OS TV? Because looking at the code and also with personal tests there is no way power on will work. The code there is specific for Android TV versions.

JurnD commented 3 years ago

@DavidFFerreira You can say that's not correct, but I can see it happen. Every time I try a command that is not supported I check the port with Nmap and it is closed. Perhaps it doesn't work that way for your TV, but for mine it does.

DavidFFerreira commented 3 years ago

@emivaljr yes I have PHILIPS 65PUS6754/12 The power on, works just fine with network packages, and you can even retrive the power state from tv after power on

emivaljr commented 3 years ago

@emivaljr yes I have PHILIPS 65PUS6754/12 The power on, works just fine with network packages, and you can even retrive the power state from tv after power on

Can you send the details of that? Maybe the rest call. Maybe we can try to change this library to support that.

DavidFFerreira commented 3 years ago

I use it in Home Assistant

media_player:

emivaljr commented 3 years ago

Ok, using WOL. Can you confirm that works all the time? I think @eslavnov already had some comments around this: https://github.com/eslavnov/pylips/issues/16#issuecomment-488034130

DavidFFerreira commented 3 years ago

For me works all the time =) my tv is philips 65pus6754 with SAPHI OS