Philips TV (2016+) Binding

jointspace
philips
binding
Tags: #<Tag:0x00007f1e5f13b5a8> #<Tag:0x00007f1e5f13b3f0> #<Tag:0x00007f1e5f13b260>
(Benjamin) #1

Hello community,

I created a binding for the Philips TV 2016 and later Series (Jointspace v6+), which use the Android TV OS. Therefore I am reaching out to you, seeking for tester. Please give me feedback and also write down your TV model.

I’ve tested all the functionality by myself with the 55PUS7101/12 model.
EDIT: It came to my attention, that some 2016+ TVs (e.g.: 55PUS6262/12) use the Jointspace Version 6.1 , which is in most cases identical to the 6.2 Version. However, some TVs with v6.1 does not need any Pairing in advance, since no Credentials are used. If YOU happen to own such a TV, please leave a post. I would adjust my binding to support such TVs, but I need testers in the first place.

Below you find all the information needed for getting started, enjoy!

History:

17.01.19: Initial Version
22.01.19: Adjusted autodiscovery for 2017&2018 TV models

Features:

  • Initial Pairing Process
  • Automatically discovers if TV turned on/off
  • Turn On/Off TV (On does only work with WOL, read Side notes below)
  • Set and Read Volume/Mute
  • Send Button commands (emulate Keys from infrared Remote Controller)
  • Turn On/Off Ambilight
  • Turn On/Off Ambilight + Hue
  • Toggle Google Assistant Search on TV for given Input
  • Start an Application (Netflix and so on)
  • Show current App running plus Icon (ItemType: Image)
  • Start a TV Channel
  • Automatic refresh of current running App name, icon and the Volume (default 10 secs, configurable at the Thing)

Side notes:

  • Turning ON needs to be used in combination with Wake-On-LAN Binding. At first I implemented it into the binding, but WOL is just not reliable enough in combination with Philips TV (20-30 secs till TV is finally ON). I recommend using HDMI-CEC instead, if possible.
  • Source cannot be set or read. Sadly this feature was removed from the jointspace API. I recommend HDMI-CEC. If not possible this could be an alternative: https://github.com/eslavnov/android-tv-remote
  • TV Channels cannot be read, only set. This was also removed, compared to earlier jointspace versions.
  • Channels for KeyCode, AppName and TvChannel have as soon as the TV is initializied a List of available commands.
  • Only Android TV based Philips TVs are supported right now.
  • Sometimes, pretty rare, the TV does not accept commands (unknown reason). If this appears, the binding tries it automatically again.

Planned features:

  • Full Ambilight control
  • … there are still a lot of undiscovered features.

Tested TV Models:

  • 55PUS7101/12 (WORKS)
  • 43PUS6412/12 (WORKS)
  • 65PUS8102/12 (WORKS)
  • 49PUS8503/12 (WORKS)
  • 50PUS7373/12 (WORKS)
  • 55PUS6262/12 (NOT YET SUPPORTED) - Seeking for tester!

Installation:

Important: The TV must be configured to always use the same IP via the network setting. See https://www.usa.philips.com/c-f/XC000008994/how-do-i--manually-configure-the--wireless-settings-on-my-philips-tv for help.

Place the following jar in your addons folder and follow the instructions below:

If you stumble upon following error in the logs:

2019-03-31 23:07:19.161 [WARN ] [org.apache.felix.fileinstall ] - Error while starting bundle: file:/usr/share/openhab2/addons/org.openhab.binding.philipstv-2.5.0-SNAPSHOT.jar
org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.philipstv [235]
Unresolved requirement: Import-Package: org.eclipse.jdt.annotation; resolution:=“optional”
Unresolved requirement: Import-Package: org.eclipse.smarthome.config.discovery.upnp

you’ll need to execute the command feature:install esh-io-transport-upnp.

Follow the following instructions and look at the full example items (open the Link for better view!):

…and give me feedback :slight_smile:

Thanks go out to the creator and contributors of the SamsungTV Binding. Their code helped me a lot building a binding for a TV!

7 Likes

Philips Android TV
Binding to Philips 49PUS7101/12 android TV
Binding to Philips 49PUS7101/12 android TV
(Daniel Linder) #2

I will definitely try this. Bought a 49PUS8503/12 for one of my daughters a few weeks ago

1 Like

(Michael Aschenborn) #3

My Philips 55pus7909 seems to be a little bit to old?!?
It’s an Android TV but not with the newest version.

2019-01-17 20:31:38.417 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'philipstv:tv:5AFEF00D_BABE_DADA_FA5A_1c5a6b75309e' to inbox.
2019-01-17 20:31:48.558 [INFO ] [g.philipstv.handler.PhilipsTvHandler] - Pairing code for tv authentication is missing. Starting initial pairing process. Please provide manually the pairing code shown on the tv at the configuration of the tv thing.

No pairing code is displayed.

0 Likes

(Benjamin) #4

Hey,

thanks for your feedback! Indeed, the 55pus7909 TV model is from the year 2014. According to https://www.domoticz.com/wiki/Philips_tv your TV uses v5. Version 6 uses HTTPs with Digestauth, therefore the pairing process.

You can verify your jointspace version browsing this path: http://<TV-IP>:1925/5/system . This should show you a JSON with jointspace v5.

Btw: Setting the logging level to DEBUG for my binding, should show exactly whats going on.

0 Likes

(Flole) #5

Did you note that while the TV is still in it’s shutdown process you can not send a wake on lan command but have to send the power command again and are you handling this properly in the binding? By pinging the device you can get the power status, that’s how I am doing it right now.

0 Likes

(Benjamin) #6

What exactly do you want to achieve by using WOL during shutdown of the TV? But yes, I’m handling these cases during startup and shutdown phase, where the TV does not accept commands.

I’ve used the WOL way to turn the TV on myself but didn’t find it very reliable nor fast enough. Maybe other TV models are better with this. The “Philips TV Remote App” for mobile phones is also using WOL for turning the TV on and only succeeds sometimes (at least for my TV).

0 Likes

(Sascha ) #7

Hi and thank you for the binding!!

My TV: 43PUS6412 / 2017

Working but the pairing had to be done with already known secret key as the PIN code has not been requested when adding the thing. Also the PIN shown on the TV with the philips app has not been accepted.

Thing shows online but changing volume does not change the volume but shows this stack trace in the log:

2019-01-18 20:09:34.835 [ERROR] [ipstv.internal.service.VolumeService] - Error during the setting of Volume: 10.0.0.41:1926 failed to respond
org.apache.http.NoHttpResponseException: 10.0.0.41:1926 failed to respond
at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:141) ~[265:org.openhab.binding.philipstv:2.5.0.201901171527]
at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:56) ~[265:org.openhab.binding.philipstv:2.5.0.20190117
1527]
at org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:259) ~[265:org.openhab.binding.philipstv:2.5.0.201901171527]
at org.apache.http.impl.DefaultBHttpClientConnection.receiveResponseHeader(DefaultBHttpClientConnection.java:163) ~[265:org.openhab.binding.philipstv:2.5.0.201901171527]
at org.apache.http.impl.conn.CPoolProxy.receiveResponseHeader(CPoolProxy.java:165) ~[265:org.openhab.binding.philipstv:2.5.0.201901171527]
at org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecutor.java:273) ~[265:org.openhab.binding.philipstv:2.5.0.201901171527]
at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:125) ~[265:org.openhab.binding.philipstv:2.5.0.201901171527]
at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:272) ~[265:org.openhab.binding.philipstv:2.5.0.201901171527]
at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:185) ~[265:org.openhab.binding.philipstv:2.5.0.201901171527]
at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89) ~[265:org.openhab.binding.philipstv:2.5.0.201901171527]
at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:111) ~[265:org.openhab.binding.philipstv:2.5.0.201901171527]
at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185) ~[265:org.openhab.binding.philipstv:2.5.0.201901171527]
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:118) ~[265:org.openhab.binding.philipstv:2.5.0.201901171527]
at org.openhab.binding.philipstv.internal.service.ConnectionService.doHttpsPost(ConnectionService.java:79) ~[265:org.openhab.binding.philipstv:2.5.0.201901171527]
at org.openhab.binding.philipstv.internal.service.VolumeService.setVolume(VolumeService.java:95) ~[265:org.openhab.binding.philipstv:2.5.0.201901171527]
at org.openhab.binding.philipstv.internal.service.VolumeService.handleCommand(VolumeService.java:57) [265:org.openhab.binding.philipstv:2.5.0.201901171527]
at org.openhab.binding.philipstv.handler.PhilipsTvHandler.handleCommand(PhilipsTvHandler.java:124) [265:org.openhab.binding.philipstv:2.5.0.201901171527]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]
at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:153) [102:org.eclipse.smarthome.core:0.10.0.oh240]

Any ideas or is this the current supposed state?

Thank you again!
Sascha

0 Likes

(Daniel Linder) #8

Did not work. Nothing is found. I belive I read somewhere that Jointspace is not available on 2018 models.

0 Likes

(Benjamin) #9

Hey Sascha,

this is not the intended behavior! It’s working with my TV model. What about the other features, do they work? (It would be surprising)

Could you try to open the following URLs and copy the shown text?

http://10.0.0.41:1925/6/system
http://10.0.0.41:1925/system

Thanks!

0 Likes

(Benjamin) #10

Hey Daniel,

that doesn’t sound so good. By “nothing is found”, do you mean the auto discovery at the inbox does not work? Could you try to add the thing manually via the inbox? You would have to set the IP and Port at the Thing Configuration.

Something I really have to add above is the information, that it is required that the TV always has the same IP, set via the Network Settings. But this has nothing to do with your problem.

0 Likes

(Sascha ) #11

Hey Benjamin,

thank you for your support. No, the other features also don’t work. The thing status nevertheless is online.

The URLs provide JSON output, pasted here:

http://10.0.0.41:1925/6/system
{“notifyChange”:“http”,“menulanguage”:“German”,“name”:“Wohnzimer”,“country”:“Germany”,“serialnumber_encrypted”:“LMG+lGXBOSkd9H7BL3Cmqpz9XtaYY2NZOQK5eNG237Q=\n”,“model_encrypted”:“C1s4oAUsj/9ATHkVZihhLvuqRtCkiP6i4KxUa2RZbME=\n”,“deviceid_encrypted”:“yhPjj0XqP8QX1ZDTgtQQPcIOFuOmEFOopxzOKSZ7SHc=\n”,“nettvversion”:“8.0.0”,“epgsource”:“one”,“api_version”:{“Major”:6,“Minor”:1,“Patch”:0},“featuring”:{“jsonfeatures”:{“editfavorites”:[“TVChannels”,“SatChannels”],“recordings”:[“List”,“Schedule”,“Manage”],“ambilight”:[“LoungeLight”,“Hue”,“Ambilight”],“menuitems”:[“Setup_Menu”],“textentry”:[“context_based”,“initial_string_available”,“editor_info_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”}}}

http://10.0.0.41:1925/system
{“notifyChange”:“http”,“menulanguage”:“German”,“name”:“Wohnzimer”,“country”:“Germany”,“serialnumber_encrypted”:“IXJR9pbsYlao2SpMUdE6ZwqGtRfyzGdBqn46HKc3t1o=\n”,“model_encrypted”:“6/mlZnveVI6tDfbGsquzkZ4uUe+eYo1khk6RU3Y89og=\n”,“deviceid_encrypted”:“U6VF4/rpPkm/WAKkUiK8gzH8uecqrMeUEFB6aVUWgRU=\n”,“nettvversion”:“8.0.0”,“epgsource”:“one”,“api_version”:{“Major”:6,“Minor”:1,“Patch”:0},“featuring”:{“jsonfeatures”:{“editfavorites”:[“TVChannels”,“SatChannels”],“recordings”:[“List”,“Schedule”,“Manage”],“ambilight”:[“LoungeLight”,“Hue”,“Ambilight”],“menuitems”:[“Setup_Menu”],“textentry”:[“context_based”,“initial_string_available”,“editor_info_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”}}}

Between these, only the encrypted properties are different.

If you need something, I’ll do my best to support your development! :slight_smile:

Sascha

0 Likes

(Benjamin) #12

Ah okay, the api_version indicates, that you are using jointspace version 6.1. (“api_version”:{“Major”:6,“Minor”:1,“Patch”:0})

Interestingly, from what I’ve seen on other boards you shouldn’t need any pairing or secured communication. (“pairing_type”:“digest_auth_pairing”,“secured_transport”:“true”)

What is the output from the following URL:

http://10.0.0.42:1925/6/audio/volume

Could you also please name your tv model?

I give my best to work this out with your help. :slight_smile:

0 Likes

(Sascha ) #13

Connecting to the audio/volume URL from my browser results in a connection time out.
Currently, I am using https://github.com/suborb/philips_android_tv/blob/master/philips.py to control my TV.

My TV is a 43PUS6412 from 2017.

Just tested this, working fine. https://github.com/arzzen/philips-tv

0 Likes

(Daniel Linder) #14

Hi,
I made some wrong conclusions here. Have been trying to communicate via jointspace with no success. However, manually adding the thing is working. The TV spits out a verification code - and voila. The thing gets connected and the items are available. All the available Items actually seems to work as expected.

0 Likes

(Benjamin) #15

Awesome! It seems that I just have to improve the autodiscovery for newer tv models.

0 Likes

(Benjamin) #16

Hmm the scripts mentioned are working the same way as the binding does. Could you verify the Username and Password are the same as the ones using the script? Thanks

0 Likes

(Flole) #17

I only want to turn it on and off. So now I send a turn off command, the TV enters it’s shutdown procedure but wake on lan won’t work yet to turn it back on, however sending turn off again turns it on properly.

0 Likes

(Roland S) #18

So my 48PUS7600 is also one year too old? But my girlfriend has a 50PUS7373 Android
So I can try it on her installation.

0 Likes

(Benjamin) #19

You can try it out, but it’s pretty likely that your 48PUS7600 won’t work.

Please give me feedback if also the autodiscovery worked for your newer tv, I just adjusted my binding to support 2017&2018 tvs.

0 Likes

(Norbert Schulze) #20

I have a 55POS9002 and the autodiscovery also doesn’t work.

The log entry for discovery is:

… - Device found: Philips TV DMR with desc UPnP Media Renderer 1.0

0 Likes