Order a Samsung Smart TV

Hello,

I’m new to Gladys v4, although I’ve been following the project for several years.
I’ve mainly linked my Xiaomi gateway to control the temperature of the rooms, but not much more…

I would like to be able to control my Samsung smart TV via Gladys, at least to turn it off with other devices via a scene (typical scenario, we’re going to bed! :slight_smile: )

I found this kind of project in Python: GitHub - Ape/samsungctl: Remote control Samsung televisions via a TCP/IP connection · GitHub
And my TV responds at the URL: http://192.168.1.13:8001/api/v2/

{
  "device": {
    "FrameTVSupport": "false",
    "GamePadSupport": "true",
    "ImeSyncedSupport": "true",
    "Language": "fr_FR",
    "OS": "Tizen",
    "PowerState": "on",
    "TokenAuthSupport": "true",
    "VoiceSupport": "true",
    "WallScreenRatio": "0",
    "WallService": "false",
    "countryCode": "FR",
    "description": "Samsung DTV RCR",
    "developerIP": "0.0.0.0",
    "developerMode": "0",
    "duid": "uuid:91bdb683-b656-4929-aab7-a02cf64207f6",
    "firmwareVersion": "Unknown",
    "id": "uuid:91bdb683-b656-4929-aab7-a02cf64207f6",
    "ip": "192.168.1.13",
    "model": "19_MUSEM_QTV",
    "modelName": "QE65Q80RATXXC",
    "name": "[TV] Samsung Q80 Series (65)",
    "networkType": "wireless",
    "resolution": "3840x2160",
    "smartHubAgreement": "true",
    "ssid": "08:87:c6:53:af:45",
    "type": "Samsung SmartTV",
    "udn": "uuid:91bdb683-b656-4929-aab7-a02cf64207f6",
    "wifiMac": "D4:9D:C0:96:41:C6"
  },
  "id": "uuid:91bdb683-b656-4929-aab7-a02cf64207f6",
  "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": "[TV] Samsung Q80 Series (65)",
  "remote": "1.0",
  "type": "Samsung SmartTV",
  "uri": "http://192.168.1.13:8001/api/v2/",
  "version": "2.0.25"
}

Do you think it’s possible to do this and are other people interested?

Thanks in advance.

Hello and welcome

There is a similar feature request on the forum

https://community.gladysassistant.com/t/prise-en-charge-des-differentes-api-de-television/5506

If you have development knowledge and time, you might be able to lend a hand :slight_smile:

Don’t hesitate to vote to add a voice to the requests you would like to see in Gladys

@gregfly26 It’s quite possible to add support for this type of device to Gladys :slight_smile:

You would need to create a « Samsung Smart TV » service in Gladys. If your TV also has an HTTP API as simple as this, it shouldn’t be very complicated.

If you have development skills, don’t hesitate to start a service, we would be happy to add it to Gladys.

I don’t know if you’ve seen the tutorial in the documentation that talks about service development?

  1. Set up a development environment:
  2. Develop a Gladys service: Contributing on Gladys Assistant | Gladys Assistant

@pierre-gilles I’ll look into all of this, even though I’m not really a developer (a bit during my studies).
I am a Systems and Networks Administrator, so more system-oriented than development!

I will post my progress in this thread, if anyone has ideas for functions or use cases, I’m open to your opinions!

Do you think one of these 2 proposals would be a good lead for this module?

https://github.com/Toxblh/samsung-tv-control
https://github.com/Toxblh/node-red-contrib-samsung-tv-control

Hello,

I’ll try to answer. Generally, the best thing you can do is test the first link (the JS library to control your TV). You test it in a separate small file in Node and validate the operation. You try to understand the steps and the functioning. And when it’s good, you can move on to Gladys and get inspired by the services. Generally, when you look at the code behind it, it’s an API so quite classic! The integration shouldn’t be too hard I think :slight_smile:

In any case, lots of people here to help, so don’t hesitate :slight_smile:

Good evening,
Sorry, but I really need a hand to get started and test the package GitHub - Toxblh/samsung-tv-control: 📺 Remote control your TV via JS! · GitHub.
I have never used NodeJS …

I created a VM Ubuntu 20.04 on virtualbox in bridge network → OK
Installation of nodeJS 12 → OK
Installation of npm → OK

npm install samsung-tv-control --save → OK
A folder is created under « /usr/lib/node_modules/npm/node_modules/samsung-tv-control »

Creation of an example script as given in the repository → OK

What should I do next? I’m lost from there.

Thanks in advance for your help and sorry if this is a basic question, I’m a complete NodeJS newbie …

Hello no worries it’s normal.

If you are a sys admin you should know at least Python :smiley:

So it’s the same logic. At the root of the project you have a package.json file (all the information plus the packages you need so samsung-tv…), the node_modules which contains all the libraries you need and normally your example file (index.js / script.js / node.js …) Whatever you want :slight_smile: :slight_smile:

So you just have to run your file by doing node monfichier.js simply :slight_smile:

So here you just need to have the right config (your TV IP / MAC address etc) and then you will be able to test your script.

const control = new Samsung(config)

This is your object that you will be able to use in short your TV. You will be able to apply methods such as turning on / off as seen below.

Have fun with it to get familiar and it should be fine :slight_smile:

For information, a certain @rob-mccann is working on more comprehensive media management, and it seems promising, so for the integration of TV features, I think we will need to rely on his development.

Hi everyone :slight_smile:

I think this is a great candidate for a Matterbridge plugin :slight_smile: