Homey Community Forum

Philips TV Testing

Hello everyone,

I’ve recently published an alpha version of the Philips TV Remote Control app :partying_face: and have already invited a few of you to test it. Currently the app only has the on/off feature implemented, but stay tuned because I’ll add some more features soon.

https://apps.athom.com/app/codes.lucasvdh.philips-jointspace

This app supports all Philips TV models which have the JointSpace API enabled. So it should work on older models from 2015 and before as well as models from 2016 and up (which requires a pairing process).

I want you
There’s a couple of features which I’m not able to test and it would be great of you could help me out with the following:

  • Because I’ve got a 2018 model myself, I’m not able to test the older JointSpace v1 API. It would be very helpful if someone with an older model could test the paring process and if they’re actually able to send an on/off command.
  • I don’t have any channels installed on my TV so I’ll need someone who does to test the features regarding those. I haven’t had time to implement these though.

Want access to the alpha?
I you want access to the alpha version of the app you can:

  • install it yourself by cloning the repo and running athom app install from the project dir
  • or send me your email adress so I can add you to the alpha testers and then you’ll be able to install it via the store

Features
Implemented features:

  • Get/set power on/standby
    This includes Wake-on-LAN if enabled on the TV
  • Get audio
    This includes the current volume and if the TV is muted (doesn’t update)
  • Get MAC address

Planned features:

  • Set key
    Send a key from your remote e.g. CursorUp or Confirm
  • Set adio
    Set audio level and mute or unmute
  • Get applications
    A list of all apps installed on the TV
  • Get/set current application
    Get the currently openen app or send an intent to your TV opening a specific app
  • Get/set channels
    Get currently opened channel or set a specific one (not sure if setting is possible)
  • Get/set ambilight mode
    Enable/disable your ambilight but also control the configuration, if it should follow video/audio/etc and what type of ambilight you want relax/intense/etc
  • Get/set source (2015 and older models only)

I also plan to create flow triggers and conditions for all gettable attributes, and flow actions for all settable attributes.

Feedback
This topic’s main purpose is for providing feedback and suggestions.

If you’re having issues pairing/adding your device, please provide the following:

  • Year your TV was made (or when you bought it)
  • Model name
  • Test if one of the following urls works (api_version can be 1 to 6)
    • http://{your_tv_ip}:1925/{api_version}/system
    • http://{your_tv_ip}:1926/{api_version}/system
    • https://{your_tv_ip}:1925/{api_version}/system
    • https://{your_tv_ip}:1926/{api_version}/system
  • Most importantly provide the JSON result of one of the urls above that worked e.g.:
{
  "notifyChange": "http",
  "menulanguage": "English",
  "name": "Philips TV",
  "country": "Netherlands",
  "serialnumber_encrypted": "+YXeLii/7x4PudEZPE7fxFZiccpHcPnNjGNQBssloXI=\n",
  "softwareversion_encrypted": "tG/6miHRZlqTyOhN8e4g7ugTBEdhvjm7l5cB/PKiVp6/Ecf9w+/ONTBes1hbeIWZ\n",
  "model_encrypted": "RFuwAs4veDiW6QQjfZ96Nzev3SItQMyIU9DmePJ1rRA=\n",
  "deviceid_encrypted": "czZq4Qlvz8bULBph7JY4/hFiuejajnO2V5jxk9r/554=\n",
  "nettvversion": "8.0.2",
  "epgsource": "one",
  "api_version": {
    "Major": 6,
    "Minor": 1,
    "Patch": 0
  },
  ...
}

THIS IS AN EXAMPLE, PLEASE INCLUDE ENTIRE JSON RESPONSE*

Cheers

4 Likes

Hi Lucas,

Doesn’t seem to pair. I have a 49PUS6551/12 from 2017. When connecting for the first time it keeps “loading”

Hi Lucas,

Same here no pairing on the 49pus7101/12 i will run the app in the cli see what the logs says and test the tv with the code on https://github.com/arzzen/philips-tv/

@Mickel_Luiten and @Ben_Lens and anyone else whom it might concern.

I’m about to release a new alpha version which should fix some of the pairing issues people are having.

Apparently there are little more versions of the Jointspace API out there then I assumed. I’ve added all versions now and better error handling so it’s clearer what’s going on e.g. incorrect api version.

Let me know if you’re still experiencing issues;

I’m also aware of an issue that might arise with people who have an older version than 6 but still require the authenticated version of the app. I’m looking into solving this.

Hi @lucasvdh

Pairing times out. v0.1.2

{message":“socket hang up”:“ECONNRESET”}

55PUS7101/12 YEAR:2016

{“notifyChange”:“http”,
“menulanguage”:“Dutch”,
“name”:“TV Woonkamer”,
“country”:“Netherlands”,
“serialnumber_encrypted”:“ygvm1jxU6BYNkBZbgzItoWaRoSIE4ABw0A8ftRSq+8A=\n”,
“softwareversion_encrypted”:“eyqO3oSosiX9Mf8dKohRZX48ql7bejcyyUZSzhvRGe4=\n”,
“model_encrypted”:“y05qeQWpHgeHtqHOGI4vFxjdD9PeCVmQuxwAebYlLGc=\n”,
“deviceid_encrypted”:“G0t23TyKZrTVd3GuDfnzTmffbdCXdVfmXI3CCYXIVkY=\n”,
“nettvversion”:“8.1.0”,
“epgsource”:“one”,
“api_version”:{
“Major”:6,
“Minor”:2,
“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”,“dms_tad”],“tvsearch”:“intent”,“pairing_type”:“digest_auth_pairing”,“secured_transport”:“true”}}}

Hi @Tim_Messerschmidt,

What I see from the Json you posted is that your TV doesn’t require authentication. However if this is not the entire Json response, please modify your post to include everything.

I’ll write a fix today so the app uses the system info to determine if authentication is required or not.

Thanks for the feedback!

Hi @lucasvdh

added missing info from Json

I’ve just pushed a new test script to the git repository with which you should be able to debug the pairing process more thoroughly.

So if you’ve got node running locally and are having trouble with pairing your TV, you can help me debug this issue by running the test script like this:

~ $ git clone git@github.com:lucasvdh/codes.lucasvdh.philips-jointspace.git\
 && cd codes.lucasvdh.philips-jointspace\
 && git checkout alpha\
 && cd tests
Cloning into 'codes.lucasvdh.philips-jointspace'...
remote: Enumerating objects: 5887, done.
remote: Counting objects: 100% (5887/5887), done.
remote: Compressing objects: 100% (3247/3247), done.
remote: Total 5887 (delta 2229), reused 5816 (delta 2158), pack-reused 0
Receiving objects: 100% (5887/5887), 4.52 MiB | 3.90 MiB/s, done.
Resolving deltas: 100% (2229/2229), done.
Switched to a new branch 'alpha'
~ $ node pairing.js

If this test script fails, please provide the response here.

Can’t help you. nothing running locally and not at home currently.

@Tim_Messerschmidt no worries, just mentioning for the people who do.

HI Lucas, tryed some things. Still on model 49pus7101/12 march2016

First of all the output from tv at http://192.168.2.140:1925/6/system

{
    "notifyChange": "http",
    "menulanguage": "Dutch",
    "name": "tv-philips",
    "country": "Netherlands",
    "serialnumber_encrypted": "1DjCNN8EaOUGsBbxCdx51bsga6hjenEs2pTvGhkQO/c=\n",
    "softwareversion_encrypted": "8a9dSFrH0LfQql5SsdUlns4a+SGPjjtt5XCcXrcmF8o=\n",
    "model_encrypted": "u/Bx4QtqANkTYeKPMGDtGdTJb6tLPcT719zX8YQiJAg=\n",
    "deviceid_encrypted": "Paq+4i+nwwemhiTaD0WOP9pryu1PHPQxf6TBAr8b2Bg=\n",
    "nettvversion": "8.1.3",
    "epgsource": "one",
    "api_version": {
        "Major": 6,
        "Minor": 2,
        "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",
                "dms_tad"
            ],
            "tvsearch": "intent",
            "pairing_type": "digest_auth_pairing",
            "secured_transport": "true"
        }
    }
}

Then the output of your testscript.
? What’s your TV’s IP? 192.168.2.140
? What’s your API version? (1-6) 6
Updating client config
Sending system info call
API version as returned by TV: 6
Starting pairing process
Successfully started pairing process
? What’s the pin code displayed on the tv? 1683
Sending ping: 1683
(node:8640) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.

WIth the testscript the pincode is displayed on the tv.

When i run the app version v0.1.4 on homey and enter tvname(same as in json output) , IPadress and apiversion(6) nothing happens on tv(no pincode is displayed) and homey will endless load.

Hope this helps to find the fix.

@Mickel_Luiten yes thanks! That helps a lot.

Three question:

  1. does the tests/pairing.js script crash after the DeprecationWarning or do you eventually get a timeout?
  2. does the following url also give you the system response:
    https://192.168.2.140:1926/6/system
  3. does your TV run on Android?

(Pro tip: if you wrap pieces of JSON or text in 3 backticks (also known as grave accent ` ) it’ll be displayed in a code block)

    ```
    like this but without the spaces
    ```

@lucasvdh

1, Scripts hangs after DeprecationWarning and after a while a timeout with error

JointspaceClient response error {“code”:“ECONNRESET”} undefined
An error occurred when trying to confirm the pairing process

{“code”:“ECONNRESET”}
2. No system response with https://192.168.2.140:1926/6/system
3. Yes android

Thanks for the tip

@Mickel_Luiten thanks for the info, I think I know what the issue is.

I’ve just pushed a new version of the tests/pairing.js script. If not mistaken you should be able to complete the pairing process with that script now. (Get the new version by running git pull origin alpha)

I’ve added manual port selection to the test script. In your case you’d need to select ip 192.168.2.140, api version 6 and port 1925.

Let me know if it works!

@lucasvdh, pretty sure something wrong.

When i type http://192.168.2.140:1925/6/system in my browse i get a response.
But testscript return "

? What’s your TV’s IP? 192.168.2.140
? What’s your API version? (1 to 6) 6
? What port number should be used? Either 1925 or 1926 1925
Updating client config
Sending system info call
API version as returned by TV: 6
Starting pairing process
Could not reach api endpoint, connection was reset. Incorrect port number?

WHen i do the followiing in the script a get a response but also a error after timeout.
? What’s your TV’s IP? 192.168.2.140
? What’s your API version? (1 to 6) 6
? What port number should be used? Either 1925 or 1926 1926
Updating client config
Sending system info call
API version as returned by TV: 6
Starting pairing process
Successfully started pairing process
? What’s the pin code displayed on the tv? 6209
Sending pin verification: 6209
Unexpected pairing error {“code”:“ECONNRESET”}

I’ve just published a new version (0.2.0) of the app.

This version fixes the following issues:

  • Jointspace client not initializing correctly for older Philips TVs which do not require auth
  • Jointspace client not initializing at all after device or app recovers from a crash
  • Pairing issues for older TVs
  • Various bugs when sending commands to tv (I’m working on making these actions available in flows)

The following feature has been added:

  • Selecting a TV type (Android TV or Other) during pairing

There is still one known issue with Android TVs that prevents you from confirming the pairing process. I’m looking into this but haven’t found a solution yet.

I have installed the latest version.

In the browser I can enter using ip http://192.168.1.147:1925/1/system, but when I try to pair it in the app it tells me that it can connect to the TV but the api number is incorrect.

In the previous version I managed to match the TV but the application chash after a few seconds.

I have a 65PUS6703/12 whitout android.

@Eduardo_Rodriguez when pairing, what tv type did you select?

Could you also help me by sending the response that you get from the http://192.168.1.147:1925/1/system then I might be able to debug some more.

Thanks in advance.

I currently have some other obligations so I’ll be back in about 2 or 2.5 weeks.

This is my response:

{
	"menulanguage": "Spanish",
	"name": "65PUS6703/12",
	"country": "Spain",
	"serialnumber_encrypted": "K2kseVsmQFgkd15gKkJ+avjDoGct/qJZad6sIi7G+Iw=",
	"softwareversion_encrypted": "K2kseVsmQFgkd15gKkJ+ak3ednbEwu0L3RKYbs0Gj1zjDF1Kd8PWKGcCIghmwRrZ",
	"model_encrypted": "K2kseVsmQFgkd15gKkJ+aomwrvYy3DqdX0gO2ZbGsc4=",
	"deviceid_encrypted": "K2kseVsmQFgkd15gKkJ+avLNWHHkyj1JGMrXxuUbBdo=",
	"nettvversion": "4.6.0.1",
	"epgsource": "ip",
	"api_version": {
		"Major": 6,
		"Minor": 1,
		"Patch": 0
	},
	"featuring": {
		"jsonfeatures": {
			"recordings": [
				"List",
				"Schedule",
				"Manage"
			],
			"ambilight": [
				"Hue",
				"Ambilight"
			],
			"textentry": [
				"context_based",
				"initial_string_available"
			],
			"inputkey": [
				"key",
				"unicode"
			],
			"pointer": [
				"context_based"
			],
			"activities": [
				"browser"
			]
		},
		"systemfeatures": {
			"tvtype": "consumer",
			"content": [
				"dmr"
			],
			"pairing_type": "none",
			"os_type": "Linux"
		}
	}
}

This is the options i set:

And the error: