eslavnov / pylips

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

[BUG] pairing 55PUS7394/12 (2019) fails #41

Closed domcross closed 4 years ago

domcross commented 4 years ago

Describe the bug Try to pair a Philips 55PUS7394-12 android-tv fails.

To Reproduce Steps to reproduce the behavior:

  1. edit settings.ini and set ´host = ip.of.my.tv´
  2. using command ´python3 pylibs.py´as given in the readme

paring faills with ´´´ Checking API version and port... Trying http://ip.of.my.tv:1925/6/system {'nettvversion': '8.2.0', 'serialnumber_encrypted': 'FF/uIq2oG7QNf1+D0dHzh4daNuM/nA7xfA9ACehFV4E=\n', 'name': '55PUS7394-12', 'country': 'Germany', 'menulanguage': 'German', 'featuring': {'jsonfeatures': {'applications': ['TV_Apps', 'TV_Games', 'TV_Settings'], 'mappings': ['server_mapping'], 'activities': ['intent'], 'ambilight': ['LoungeLight', 'Hue', 'Ambilight', 'HueStreaming'], 'recordings': ['List', 'Schedule', 'Manage'], 'inputkey': ['key'], 'editfavorites': ['TVChannels', 'SatChannels'], 'pointer': ['not_available'], 'menuitems': ['Setup_Menu'], 'channels': ['preset_string'], 'textentry': ['not_available']}, 'systemfeatures': {'tvsearch': 'intent', 'secured_transport': 'true', 'companion_screen': 'true', 'pairing_type': 'digest_auth_pairing', 'content': ['dmr', 'pvr'], 'tvtype': 'consumer'}}, 'epgsource': 'no_epg', 'softwareversion_encrypted': 'LgzCE7mnhZ//JRJPgUJIZaD3Y4/yKMxa8/dD/XnWAD74niOiUJUk8uK2/4K/ope6\n', 'notifyChange': 'http', 'os_type': 'MSAF_2019_P', 'api_version': {'Minor': 1, 'Major': 6, 'Patch': 0}, 'model_encrypted': 'E8Syb2W6Wwf9SIXSAJv6QNP7S7KRzTEYuNaUxz/5xkY=\n', 'deviceid_encrypted': '1+X/37SGxu+oXD+k5fy6jSncMGK65aAkWs/SOss/ExY=\n'} No valid credentials found, starting pairing process... Sending pairing request {'scope': ['read', 'write', 'control'], 'device': {'type': 'native', 'device_os': 'Android', 'device_name': 'heliotrope', 'id': 'xMIp8wZyp7hkmirx', 'app_name': 'Pylips', 'app_id': 'app.id'}} https://ip.of.my.tv:1926/6/pair/request ... Traceback (most recent call last): File "pylips.py", line 453, in pylips = Pylips(os.path.dirname(os.path.realpath(file))+"/settings.ini") File "pylips.py", line 76, in init self.pair() File "pylips.py", line 186, in pair self.pair_request(data) File "pylips.py", line 193, in pair_request r = requests.post("https://" + str(self.config["TV"]["host"]) + ":1926/"+str(self.config["TV"]["apiv"])+"/pair/request", json=data, verify=False, timeout=2) File "/home/pi/.local/lib/python3.5/site-packages/requests/api.py", line 110, in post return request('post', url, data=data, json=json, kwargs) File "/home/pi/.local/lib/python3.5/site-packages/requests/api.py", line 56, in request return session.request(method=method, url=url, kwargs) File "/home/pi/.local/lib/python3.5/site-packages/requests/sessions.py", line 488, in request resp = self.send(prep, send_kwargs) File "/home/pi/.local/lib/python3.5/site-packages/requests/sessions.py", line 609, in send r = adapter.send(request, kwargs) File "/home/pi/.local/lib/python3.5/site-packages/requests/adapters.py", line 499, in send raise ReadTimeout(e, request=request)requests.exceptions.ReadTimeout: HTTPSConnectionPool(host='ip.of.my.tv', port=1926): Read timed out. (read timeout=2) ´´´

eslavnov commented 4 years ago

Your TV does not seem to respond to the pairing request for some reason. Try unplugging the TV and plugging it back in, this sometimes helps with the API issues.

Also, does the mobile Philips remote app work for you?

domcross commented 4 years ago

I did not install the Philipps remote app, but will try your suggestions and report back.

eslavnov commented 4 years ago

Closing for now, feel free to reopen if any additional info is available.

domcross commented 4 years ago

Update the TVs Android software and successfully paired it with the iOS remote app, but the app doesn't do too much (ratings in the app store complain about missing/broken functionality with the latest app version).

After rebooting the TV now I get following:

python3 pylips.py 
Checking API version and port...
Trying http://IP.OF.MY.TV:1925/6/system
Connection refused
Trying http://IP.OF.MY.TV:1925/5/system
Connection refused
Trying http://IP.OF.MY.TV:1925/1/system
Connection refused
PING IP.OF.MY.TV (IP.OF.MY.TV) 56(84) bytes of data.
64 bytes from IP.OF.MY.TV: icmp_seq=1 ttl=64 time=0.597 ms

--- IP.OF.MY.TV ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.597/0.597/0.597/0.000 ms
IP IP.OF.MY.TV is online, but no known API is found. Exiting...

When I open the URL http://IP.OF.MY.TV:1925/6/systemin my browser the result is

{"notifyChange":"http","menulanguage":"German","name":"55PUS7394-12","country":"Germany","serialnumber_encrypted":"H0HR6EHZSqqWtybuK40VCrnDxto62F89nqinyiuKo8A=\n","softwareversion_encrypted":"HUUPMg2cTvN\/QxSl+S+1x3LDy\/rpbDcYCScz\/pD42bjcp9kbObXMYLF7gEfGNXYK\n","model_encrypted":"x378brSX+8m4vCn29qtoG6a7g4l1YG3eX8XDWCDesZ4=\n","deviceid_encrypted":"hzu0wwK8b2wml0HUPWJz3tkNCxAuEqgRji79EOR\/yKI=\n","nettvversion":"8.2.0","epgsource":"no_epg","api_version":{"Major":6,"Minor":1,"Patch":0},"featuring":{"jsonfeatures":{"editfavorites":["TVChannels","SatChannels"],"recordings":["List","Schedule","Manage"],"ambilight":["LoungeLight","Hue","Ambilight","HueStreaming"],"menuitems":["Setup_Menu"],"textentry":["not_available"],"applications":["TV_Apps","TV_Games","TV_Settings"],"pointer":["not_available"],"inputkey":["key"],"activities":["intent"],"channels":["preset_string"],"mappings":["server_mapping"]},"systemfeatures":{"tvtype":"consumer","content":["dmr","pvr"],"tvsearch":"intent","pairing_type":"digest_auth_pairing","secured_transport":"true","companion_screen":"true"}},"os_type":"MSAF_2019_P"}

The other URLs do not return anything.

domcross commented 4 years ago

how can I reopen the issue #41

unickq commented 3 years ago

Try unplugging the TV and plugging it back in, this sometimes helps with the API issues.

This worked for me. But for 2018