Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New: Added support for Samsung vendor specific media input sources (USB-C & Display Port) #677

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

petarhristov94
Copy link

@petarhristov94 petarhristov94 commented Apr 25, 2024

Description

I've added the highly requested feature of supporting Samsung vendor specific inputs, like the ones available on their OLED smart monitor lineup - USB-C and Display Port (#644, #632, #569). The two new inputs are now available under the input dropdown, as well as under the switch dropdown. The request for switching the new inputs utilizes the samsungvd.mediaInputSource, which also supports the traditional inputs. Should the request fail, it gracefully falls back to the original capability of mediaInputSource used in traditional TVs and leaves a debug level message in the console.

Furthermore, I've renamed the field MAC Address to Network MAC Address, so that it's clear, that the Network (Ethernet/WLAN/Wi-Fi) address is the one relevant. Not to confuse it with the Bluetooth address for example.

I've tested the added feature on my Samsung OLED G8 and I can confirm the input switching works quite well.

Contribution

I'd be honored to be added to the credits section for this contribution! Of course, no worries at all if you prefer not to. Regardless, I'm happy to have been able to help out. Cheers! 😉

Screenshots

Inputs Dropdown

image

Switch Dropdown

image

HomeKit

  • DESKTOP utilizes Display Port
  • MacBook Air utilizes USB-C
  • HDMI is self explanatory

Screenshot 2024-04-25 at 22 04 42

Network MAC Address

image

@@ -66,7 +66,13 @@ module.exports = class SmartThings {
}

setInputSource(value) {
return this.sendCommands({component: 'main', capability: 'mediaInputSource', command: 'setInputSource', arguments: [value]});
// Try to set input source with Samsung-specific vendor extended capability (used in e.g. smart monitors)
return this.sendCommands({component: 'main', capability: 'samsungvd.mediaInputSource', command: 'setInputSource', arguments: [value]})
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I cannot merge this PR because of this.

The plugin is developed for TVs, not for Smart Monitors. So the main focus should be for TVs.

Also, this function should not catch errors.

If this is the implementation that helps you, please fork the plugin and change the code as it fits your specific needs :)

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please show me a dump of http://TV_IP:8001/api/v2/ from your monitor? Maybe there is something we can relate to and change the capability based on that.

Copy link
Author

@petarhristov94 petarhristov94 Apr 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I appreciate the plugin's focus on TVs, but considering the convergence between smart TVs and monitors - both running on Tizen OS - it's beneficial to expand the plugin's capabilities to include Samsung's smart monitors and similar devices. This addition doesn't detract from the TV functionality due to its fallback mechanism that ensures compatibility across existing devices. Furthermore, this feature responds to direct community requests (issues #644, #632, and #569) and reflects a natural extension of the plugin to handle special cases in Tizen OS devices. As one of those users myself, I do think integrating this support will not only meet existing demand but also enhance the plugin’s appeal.

Something I also forgot to mention is, that the samsungvd.mediaInputSource capability also completely supports the existing enumeration list. This means, that switching the input to HDMI1, digitalTv or even FM totally works and does not throw any errors, making the mediaInputSource capability redundant for newer devices. I'd still keep it there, as I can't ensure that older devices also have this capability.

As you requested, here's a dump of the response (I've anonymized some fields to empty GUIDs and placeholder MAC-addresses):

{
	"device": {
		"EdgeBlendingSupport": "false",
		"EdgeBlendingSupportGroup": "0",
		"FrameTVSupport": "false",
		"GamePadSupport": "true",
		"ImeSyncedSupport": "true",
		"Language": "en_GB",
		"OS": "Tizen",
		"PowerState": "on",
		"TokenAuthSupport": "true",
		"VoiceSupport": "true",
		"WallScreenRatio": "-1",
		"WallService": "false",
		"countryCode": "DE",
		"description": "Samsung DTV RCR",
		"developerIP": "0.0.0.0",
		"developerMode": "0",
		"duid": "uuid:00000000-0000-0000-0000-000000000000",
		"firmwareVersion": "Unknown",
		"id": "uuid:00000000-0000-0000-0000-000000000000",
		"ip": "192.168.X.X",
		"model": "22_PONTUSML_GMT8",
		"modelName": "LS34BG850SUXEN",
		"name": "Samsung Odyssey G8",
		"networkType": "wireless",
		"resolution": "3440x1440",
		"smartHubAgreement": "true",
		"ssid": "XX:XX:XX:XX:XX:XX",
		"type": "Samsung SmartTV",
		"udn": "uuid:00000000-0000-0000-0000-000000000000",
		"wifiMac": "XX:XX:XX:XX:XX:XX"
	},
	"id": "uuid:00000000-0000-0000-0000-000000000000",
	"isSupport": "{\"DMP_DRM_PLAYREADY\":\"false\",\"DMP_DRM_WIDEVINE\":\"false\",\"DMP_available\":\"true\",\"EDEN_available\":\"true\",\"FrameTVSupport\":\"false\",\"ImeSyncedSupport\":\"true\",\"TokenAuthSupport\":\"true\",\"remote_available\":\"true\",\"remote_fourDirections\":\"true\",\"remote_touchPad\":\"true\",\"remote_voiceControl\":\"true\"}\n",
	"name": "Samsung Odyssey G8",
	"remote": "1.0",
	"type": "Samsung SmartTV",
	"uri": "http://192.168.X.X:8001/api/v2/",
	"version": "2.0.25"
}

Response Headers:

NAME VALUE
content-type application/json; charset=utf-8
content-length 1363

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants