• Stars
    star
    178
  • Rank 214,989 (Top 5 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created almost 6 years ago
  • Updated 11 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

πŸ“Ί Remote control your TV via JS!

πŸ“Ί Library for remote control Samsung TV in your NodeJS application.

Tested with Samsung UE43NU7400 and UN55NU7100

Build Status codecov Latest Stable Version Downloads total Downloads month License Paypal Donate Patreon

πŸ“– Documentation

Installation

Requires Node v9 or above.

npm install samsung-tv-control --save

NODE-RED

Also you can use the lib in your Node-RED https://github.com/Toxblh/node-red-contrib-samsung-tv-control

Usage

You can try example code

// import Samsung, { APPS, KEYS } from 'samsung-tv-control'
const { Samsung, KEYS, APPS } = require('samsung-tv-control')

const config = {
  debug: true, // Default: false
  ip: '192.168.1.2',
  mac: '123456789ABC',
  nameApp: 'NodeJS-Test', // Default: NodeJS
  port: 8001, // Default: 8002
  token: '12345678',
}

const control = new Samsung(config)

control.turnOn()
control
  .isAvailable()
  .then(() => {
    // Get token for API
    control.getToken((token) => {
      console.info('# Response getToken:', token)
    })

    // Send key to TV
    control.sendKey(KEYS.KEY_HOME, function (err, res) {
      if (err) {
        throw new Error(err)
      } else {
        console.log(res)
      }
    })

    // Get all installed apps from TV
    control.getAppsFromTV((err, res) => {
      if (!err) {
        console.log('# Response getAppsFromTV', res)
      }
    })

    // Get app icon by iconPath which you can get from getAppsFromTV
    control.getAppIcon(
      `/opt/share/webappservice/apps_icon/FirstScreen/${APPS.YouTube}/250x250.png`,
      (err, res) => {
        if (!err) {
          console.log('# Response getAppIcon', res)
        }
      },
    )

    // Open app by appId which you can get from getAppsFromTV
    control.openApp(APPS.YouTube, (err, res) => {
      if (!err) {
        console.log('# Response openApp', res)
      }
    })

    // Control will keep connection for next messages in 1 minute
    // If you would like to close it immediately, you can use `closeConnection()`
    control.closeConnection()
  })
  .catch((e) => console.error(e))

Commands List

All commands you can find here

All popular apps you can find here

More Repositories

1

MTMR

🌟 [My TouchBar My rules]. The Touch Bar Customisation App for your MacBook Pro
Swift
4,215
star
2

MTMR-presets

πŸ’ˆ [My TouchBar My rules] Share your preset!
Shell
426
star
3

WinToLinux

Reboot Windows to Linux in two clicks! Editing UEFI order for next start of the system
C#
88
star
4

tizen-studio-arch

How to install TizenStudio on Arch Linux
Shell
38
star
5

KeychainExportPasswords

πŸ”‘ Export you passwords from Keychain to CSV for another password keepers (LassPass, 1Password, BitWarden) works with MacOS Mojave
AppleScript
31
star
6

youtube-speed-control

JavaScript
25
star
7

node-red-contrib-samsung-tv-control

node-red plugin for samsung tv control
HTML
25
star
8

Awesome-Windows-Apps

πŸ’Ύ Awesome windows apps which you need to try
23
star
9

skype-to-telegram

Skype to Telegram bot, for receive your message from skype in telegram
TypeScript
20
star
10

btt-touchbar-preset

🧰 My TouchBar BTT preset
18
star
11

dotfiles

βš™οΈ .files
Shell
17
star
12

hack-my-ipc

I bought my first secure camera, but it is start to my hacker life. GM8136+OV9712(?)
C++
11
star
13

Linux-Applications

🐧My pack of applications which I use on Linux
Shell
11
star
14

Keenetic-Manager

Π£ΠΏΡ€Π°Π²Π»Π΅Π½ΠΈΠ΅ ΠΏΠΎΠ»ΠΈΡ‚ΠΈΠΊΠ°ΠΌΠΈ ΠΊΠ»ΠΈΠ΅Π½Ρ‚ΠΎΠ² Π½Π° Ρ€ΠΎΡƒΡ‚Π΅Ρ€Π°Ρ… ΠšΠΈΠ½Π΅Ρ‚ΠΈΠΊ. Быстрая смСна VPN
Python
11
star
15

atom-package

:atom: Best atom packages for frontend development
CSS
9
star
16

skype-http-api

TypeScript
7
star
17

samsung-apps-remover

Delete at at all Samsung TV apps
JavaScript
7
star
18

vscode-package

πŸ“¦ My vscode packages for development
Shell
6
star
19

ALVR-Companion

Python
6
star
20

welcome-alt-packer

Init system to start to build packages for alt linux
Shell
5
star
21

revolutExchange

Test task
JavaScript
4
star
22

Bluetooth-MQTT-Switcher

JavaScript
4
star
23

sony-headphones-control-linux

Python
3
star
24

polacode-fork

πŸ“Έ Polaroid for your code
JavaScript
2
star
25

LNMP_ModxEVO_BashScripts

Bash Scripts VPS for NMP (Nginx+mysql+php) on Ubuntu
2
star
26

installMyMac

Configure environment for my mac. Dot files
Shell
2
star
27

NoddleScore

Get you credit score from noddle.co.uk in your CLI
JavaScript
2
star
28

alt-buildovich

Shell
2
star
29

altlinux-termux

Shell
2
star
30

MosMetro_Auto

iOS app, for auto login in MosMetro_free
Swift
2
star
31

telegram-github-bot

Return small statistic
JavaScript
2
star
32

CreditClub

Your score from clubs.moneysavingexpert.com/creditclub
JavaScript
2
star
33

dell-switcher-linux

Ugly switcher DELL source
Rust
2
star
34

Github-ish-skin-BugZilla

Skin user JS/CSS override for BugZilla
CSS
2
star
35

vscode-svgo

SVGO for vscode
JavaScript
1
star
36

Awesome-MacOS-Apps

πŸ’Ύ Awesome macos apps which you need to try
1
star
37

react-hoc-outside-click

React HOC OutsideClick
JavaScript
1
star
38

kube-capacity-aur

Kube-capacity AUR updater
Shell
1
star
39

toxblh-site

JavaScript
1
star
40

Toxblh

1
star
41

ClearScore

A simple way to collect your score from clearscore.com
JavaScript
1
star
42

toxblh.github.io

HTML
1
star
43

binary-mipsel

1
star
44

windows-wsl-install

Install WSL and configure it for frontend dev
Shell
1
star
45

altlinux-helper-vscode

TypeScript
1
star
46

mbpfanctl

Python
1
star
47

jira-timesheet

JavaScript
1
star
48

tfl-telegram-bot

Bot for get arrivals time something in London
JavaScript
1
star
49

1password-aur

Shell
1
star
50

rzd_monitor

PHP
1
star
51

samagicTV

Samagic - send any video from your browser to TV!
1
star
52

simple-telegram-bot

Simple bot for managing local chat
Python
1
star
53

Doors-Dotfiles

QML
1
star
54

ChatOneConnection

Java Socket Learning...
Java
1
star
55

production-zone

Chrome extension. Red Production Zone!
JavaScript
1
star
56

awesome-quick-look

Collection Quick Look plugins
1
star
57

brightness-display-ddc

JavaScript
1
star
58

gatsby-mtmr

JavaScript
1
star
59

sony-fastconnect

Blurz fast connect headphones
Rust
1
star
60

banggood-tracking-numbers

Get tracking numbers from Banggood
JavaScript
1
star
61

react-simple-pdf-viewer

TypeScript
1
star
62

LinuxToWin

Rust
1
star
63

Airpods-Battery-Monitor

JavaScript
1
star
64

macbook-macros

Shell
1
star