Giter Club home page Giter Club logo

samsungctl's Introduction

samsungctl

samsungctl is a library and a command line tool for remote controlling Samsung televisions via a TCP/IP connection. It currently supports both pre-2016 TVs as well most of the modern Tizen-OS TVs with Ethernet or Wi-Fi connectivity.

Dependencies

  • Python 3
  • websocket-client (optional, for 2016+ TVs)
  • curses (optional, for the interactive mode)

Installation

samsungctl can be installed using pip:

# pip install samsungctl

Alternatively you can clone the Git repository and run:

# python setup.py install

It's possible to use the command line tool without installation:

$ python -m samsungctl

Command line usage

You can use samsungctl command to send keys to a TV:

$ samsungctl --host <host> [options] <key> [key ...]

host is the hostname or IP address of the TV. key is a key code, e.g. KEY_VOLDOWN. See Key codes.

There is also an interactive mode (ncurses) for sending the key presses:

$ samsungctl --host <host> [options] --interactive

Use samsungctl --help for more information about the command line arguments:

usage: samsungctl [-h] [--version] [-v] [-q] [-i] [--host HOST] [--port PORT]
                  [--method METHOD] [--name NAME] [--description DESC]
                  [--id ID] [--timeout TIMEOUT]
                  [key [key ...]]

Remote control Samsung televisions via TCP/IP connection

positional arguments:
  key                 keys to be sent (e.g. KEY_VOLDOWN)

optional arguments:
  -h, --help          show this help message and exit
  --version           show program's version number and exit
  -v, --verbose       increase output verbosity
  -q, --quiet         suppress non-fatal output
  -i, --interactive   interactive control
  --host HOST         TV hostname or IP address
  --port PORT         TV port number (TCP)
  --method METHOD     Connection method (legacy or websocket)
  --name NAME         remote control name
  --description DESC  remote control description
  --id ID             remote control id
  --timeout TIMEOUT   socket timeout in seconds (0 = no timeout)

E.g. samsungctl --host 192.168.0.10 --name myremote KEY_VOLDOWN

The settings can be loaded from a configuration file. The file is searched from $XDG_CONFIG_HOME/samsungctl.conf, ~/.config/samsungctl.conf, and /etc/samsungctl.conf in this order. A simple default configuration is bundled with the source as samsungctl.conf.

Library usage

samsungctl can be imported as a Python 3 library:

import samsungctl

A context managed remote controller object of class Remote can be constructed using the with statement:

with samsungctl.Remote(config) as remote:
    # Use the remote object

The constructor takes a configuration dictionary as a parameter. All configuration items must be specified.

Key Type Description
host string Hostname or IP address of the TV.
port int TCP port number. (Default: 55000)
method string Connection method (legacy or websocket)
name string Name of the remote controller.
description string Remote controller description.
id string Additional remote controller ID.
timeout int Timeout in seconds. 0 means no timeout.

The Remote object is very simple and you only need the control(key) method. The only parameter is a string naming the key to be sent (e.g. KEY_VOLDOWN). See Key codes. You can call control multiple times using the same Remote object. The connection is automatically closed when exiting the with statement.

When something goes wrong you will receive an exception:

Exception Description
AccessDenied The TV does not allow you to send keys.
ConnectionClosed The connection was closed.
UnhandledResponse An unexpected response was received.
socket.timeout The connection timed out.

Example program

This simple program opens and closes the menu a few times.

#!/usr/bin/env python3

import samsungctl
import time

config = {
    "name": "samsungctl",
    "description": "PC",
    "id": "",
    "host": "192.168.0.10",
    "port": 55000,
    "method": "legacy",
    "timeout": 0,
}

with samsungctl.Remote(config) as remote:
    for i in range(10):
        remote.control("KEY_MENU")
        time.sleep(0.5)

Key codes

The list of accepted keys may vary depending on the TV model, but the following list has some common key codes and their descriptions.

Key code Description
KEY_POWEROFF Power off
KEY_UP Up
KEY_DOWN Down
KEY_LEFT Left
KEY_RIGHT Right
KEY_CHUP P Up
KEY_CHDOWN P Down
KEY_ENTER Enter
KEY_RETURN Return
KEY_CH_LIST Channel List
KEY_MENU Menu
KEY_SOURCE Source
KEY_GUIDE Guide
KEY_TOOLS Tools
KEY_INFO Info
KEY_RED A / Red
KEY_GREEN B / Green
KEY_YELLOW C / Yellow
KEY_BLUE D / Blue
KEY_PANNEL_CHDOWN 3D
KEY_VOLUP Volume Up
KEY_VOLDOWN Volume Down
KEY_MUTE Mute
KEY_0 0
KEY_1 1
KEY_2 2
KEY_3 3
KEY_4 4
KEY_5 5
KEY_6 6
KEY_7 7
KEY_8 8
KEY_9 9
KEY_DTV TV Source
KEY_HDMI HDMI Source
KEY_CONTENTS SmartHub

Please note that some codes are different on the 2016+ TVs. For example, KEY_POWEROFF is KEY_POWER on the newer TVs.

References

I did not reverse engineer the control protocol myself and samsungctl is not the only implementation. Here is the list of things that inspired samsungctl.

samsungctl's People

Contributors

ape avatar fhempy avatar kucharskim avatar nunofgs avatar pedrinho avatar scop avatar stancuflorin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

samsungctl's Issues

v0.3.0 gives errors regarding the from_bytes handling of the response

The from_bytes handling of the response is producing errors as follows:

$ samsungctl
Traceback (most recent call last):
  File "/usr/local/bin/samsungctl", line 9, in <module>
    load_entry_point('samsungctl===0.3.0-git', 'console_scripts', 'samsungctl')()
  File "build/bdist.linux-x86_64/egg/samsungctl/__main__.py", line 101, in main
  File "build/bdist.linux-x86_64/egg/samsungctl/remote.py", line 27, in __init__
  File "build/bdist.linux-x86_64/egg/samsungctl/remote.py", line 51, in _read_response
AttributeError: type object 'int' has no attribute 'from_bytes'

While I found this potentially relevant suggestion, I did not pursue any further:
https://stackoverflow.com/questions/28210333/python-nonetype-object-has-no-attribute-from-bytes

If these are all user error on my part, my apologies! I did my best to troubleshoot through these.

Thank you!

Unexpected behavior for KEY_HDMI

@nunofgs @Ape First, samsungctl has been working great for me with my Samsung UN24M4500AF. So, this isn't really a question about the samsungctl project. Rather, it's a question regarding my Samsung TV. KEY_HDMI and KEY_HDMI1 etc. do not switch to the specified HDMI. Instead, KEY_HDMI cycles through the input sources. Do you know if this functionality is common among many Samsung TVs, or does it only apply to few Samsung TVs?

Thank you!

Windows compatibility

Im running on windows and followed your instructions:

  1. pip install samsungctl
  2. python -m samsungctl

I get the following error from 2.

Traceback (most recent call last):
  File "C:\Users\xbmc\AppData\Local\Programs\Python\Python36-32\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "C:\Users\xbmc\AppData\Local\Programs\Python\Python36-32\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\xbmc\AppData\Local\Programs\Python\Python36-32\lib\site-packages\samsungctl\__main__.py", line 11, in <module>
    from . import interactive
  File "C:\Users\xbmc\AppData\Local\Programs\Python\Python36-32\lib\site-packages\samsungctl\interactive.py", line 1, in <module>
    import curses
  File "C:\Users\xbmc\AppData\Local\Programs\Python\Python36-32\lib\curses\__init__.py", line 13, in <module>
    from _curses import *
ModuleNotFoundError: No module named '_curses'

What am i doing wrong?

Python version 3.6.0

Delay when using command line

Hi - I've noticed using this via Home Assistant commands sent to the TV are almost instantaneous but using it from the command line there can be significant delays up to 5 seconds. Is there a difference in the versions bundled with HA vs running this via python3?

Thanks.

Configuration file in /etc

Configuration file should be searched from /etc (after the current locations) and setup.py should install the default configuration file.

KEY_POWERON is not working

Hello,
I am using KEY_POWERON to switch on the tv. But, command is not reaching to the TV. How can i turn ON the TV?

Thank you,
Gowtham M

How to get acknowledgement from samsung Tv ?

Hi,
I have sent "KEY_POWEROFF" command to samsung smart tv. The TV is turn off successfully.
But, i want to get acknowledgement from TV. how to get acknowledgement from TV?
For example, If i am changing my channel every time it should acknowledge to me.

v0.3.0 gives errors regarding 'encode'

Once the other errors are cleared, I run into errors regarding the values from the config file
(This is both pip version 0.3.0 and git Master)

$ samsungctl --interactive
Traceback (most recent call last):
  File "/usr/local/bin/samsungctl", line 9, in <module>
    load_entry_point('samsungctl===0.3.0-git', 'console_scripts', 'samsungctl')()
  File "build/bdist.linux-x86_64/egg/samsungctl/__main__.py", line 101, in main
  File "build/bdist.linux-x86_64/egg/samsungctl/remote.py", line 21, in __init__
TypeError: descriptor 'encode' requires a 'str' object but received a 'unicode'

I may have incorrectly fixed this by changing this:

                          self._serialize_string(str.encode(description)) +\
                          self._serialize_string(str.encode(id)) +\
                          self._serialize_string(str.encode(name))

to this:

                          self._serialize_string(description.encode('ascii')) +\
                          self._serialize_string(id.encode("ascii")) +\
                          self._serialize_string(name.encode("ascii"))

PIP version missing README.md resulting in FileNotFoundError

The last couple versions on pypi are missing README.md resulting in the trigger of FileNotFoundError, which is not defined:

Traceback (most recent call last):
  File "/usr/local/bin/samsungctl", line 9, in <module>
    load_entry_point('samsungctl===0.3.0-git', 'console_scripts', 'samsungctl')()
  File "build/bdist.linux-x86_64/egg/samsungctl/__main__.py", line 88, in main
  File "build/bdist.linux-x86_64/egg/samsungctl/__main__.py", line 36, in _read_config
NameError: global name 'FileNotFoundError' is not defined

Websocket timeout exception

Hi,
I am getting a websocket timeout exception when trying to run this against my Samsung UE40KU6405 TV.

The command run is:
samsungctl --host 10.10.0.191 --method websocket -i -v --timeout 10 POWER

The relevant network packages sent/received are:

T 10.10.20.248:49904 -> 10.10.0.191:8001 [AP]
GET /api/v2/channels/samsung.remote.control?name=c2Ftc3VuZ2N0bA== HTTP/1.1.
Upgrade: websocket.
Connection: Upgrade.
Host: 10.10.0.191:8001.
Origin: http://10.10.0.191:8001.
Sec-WebSocket-Key: rQzS/gChQASWksDDbnq7+A==.
Sec-WebSocket-Version: 13.
.

##
T 10.10.0.191:8001 -> 10.10.20.248:49904 [AP]
HTTP/1.1 101 Switching Protocols.
Upgrade: websocket.
Connection: Upgrade.
Sec-WebSocket-Accept: StzHg6opiZEMJIg4pld3vv3rnSI=.
.
##
T 10.10.0.191:8001 -> 10.10.20.248:49904 [AP]
..{"event":"ms.channel.timeOut"}

Any idea what I might be doing wrong?

UN65KS850 - UnhandledResponse ms.channel.timeOut

I have a UN65KS850 (2016 curved model) that appears to use websockets. When I try to use this tool, it throws:

python -m samsungctl --host <IPADDRESS> --method websocket KEY_POWER
  File "samsungctl/remote.py", line 10, in __init__
    self.remote = RemoteWebsocket(config)
  File "samsungctl/remote_websocket.py", line 25, in __init__
    self._read_response()
  File "samsungctl/remote_websocket.py", line 67, in _read_response
    raise exceptions.UnhandledResponse(response)
samsungctl.exceptions.UnhandledResponse: {u'event': u'ms.channel.timeOut'}

I've tried specifying other flags such as ID and changing the keycode, but it makes no difference. I also don't receive a request on my TV asking about allowing access (as others have implied may happen).

Output of wireshark:

Not shown: 65522 closed ports
PORT      STATE SERVICE
7676/tcp  open  imqbrokerd
7678/tcp  open  unknown
8000/tcp  open  http-alt
8001/tcp  open  vcom-tunnel
8002/tcp  open  teradataordbms
8080/tcp  open  http-proxy
8187/tcp  open  unknown
9119/tcp  open  unknown
9197/tcp  open  unknown
9999/tcp  open  abyss
10443/tcp open  unknown
15500/tcp open  unknown
49326/tcp open  unknown

Samsung KS8000 support?

Hello, I have a KS8000 Samsung TV and have found that port 55000 is not open. Any ideas on how we could support my TV?

Here's a quick nmap of the running TV:

Host is up (0.010s latency).
Not shown: 994 closed ports
PORT     STATE SERVICE
7676/tcp open  imqbrokerd
8000/tcp open  http-alt
8001/tcp open  vcom-tunnel
8002/tcp open  teradataordbms
8080/tcp open  http-proxy
9999/tcp open  abyss

Direct Access denied message

Hello Ape,

I have a Samsung UE46D6500. Samsung's own iOS App "Smart View" is working.

I've installed samsungctl and called it by the following command:

samsungctl --host 192.168.100.102 --name myremote KEY_CHDOWN

I've although tried to enter a description and an id and set the timeout to 0.

But I always get the following output direct (without waiting):

Authorization cancelled.
Error: Access denied!

Any ideas ?

Thanks and regards,

Ralf

Try to connect UA65HU8500W

This is 2014 model, so try the traditional way with port 55000. Seems the TV reject to setup the TCP
image

Try the websocket method. Installed websocket with command "sudo pip3 install websocket-client". When restart HA, got the error below:

hass[17816]: 2017-08-31 13:25:10 ERROR (MainThread) [homeassistant.helpers.entity] Update for media_player.samsung_tv_remote fails
hass[17816]: Traceback (most recent call last):
hass[17816]: File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity.py", line 225, in async_update_ha_state
hass[17816]: yield from self.hass.async_add_job(self.update)
hass[17816]: File "/usr/lib/python3.5/asyncio/futures.py", line 380, in iter
hass[17816]: yield self # This tells Task to wait for completion.
hass[17816]: File "/usr/lib/python3.5/asyncio/tasks.py", line 304, in _wakeup
hass[17816]: future.result()
hass[17816]: File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result
hass[17816]: raise self._exception
hass[17816]: File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run
hass[17816]: result = self.fn(*self.args, **self.kwargs)
hass[17816]: File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/media_player/samsungtv.py", line 121, in update
hass[17816]: return self.send_key('KEY')
hass[17816]: File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/media_player/samsungtv.py", line 134, in send_key
hass[17816]: self.get_remote().control(key)
hass[17816]: File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/media_player/samsungtv.py", line 127, in get_remote
hass[17816]: self._remote = self._remote_class(self._config)
hass[17816]: File "/srv/homeassistant/lib/python3.5/site-packages/samsungctl/remote.py", line 10, in init
hass[17816]: self.remote = RemoteWebsocket(config)
hass[17816]: File "/srv/homeassistant/lib/python3.5/site-packages/samsungctl/remote_websocket.py", line 13, in init
hass[17816]: import websocket
hass[17816]: ImportError: No module named 'websocket'

did I install the websocket correctly?

TypeError: __init__() takes exactly 4 arguments (1 given)

Have python3 and websocket installed.
Below is my conf and the error from samsungctl - any advice how to solve?

pi@raspberrypi ~ $ samsungctl --host 192.168.1.24 KEY_VOLUP

Traceback (most recent call last):
  File "/usr/local/bin/samsungctl", line 9, in <module>
    load_entry_point('samsungctl==0.6.0', 'console_scripts', 'samsungctl')()
  File "/usr/local/lib/python3.2/dist-packages/samsungctl/__main__.py", line 101, in main
    with Remote(config) as remote:
  File "/usr/local/lib/python3.2/dist-packages/samsungctl/remote.py", line 10, in __init__
    self.remote = RemoteWebsocket(config)
  File "/usr/local/lib/python3.2/dist-packages/samsungctl/remote_websocket.py", line 21, in __init__
    self.connection = websocket.WebSocket()
TypeError: __init__() takes exactly 4 arguments (1 given)

My conf:

pi@raspberrypi ~ $ cat .config/samsungctl.conf
{
        "name": "samsungctl",
        "description": "PC",
        "id": "",
        "method": "websocket",
        "port": 7676,
        "timeout": 0
}

v0.3.0 gives errors relating to missing config if not manually created

Once installed the current pip version (0.3.0) as well as the git Master triggers an undefined error if the config is not manually created.

$ samsungctl
Traceback (most recent call last):
  File "/usr/local/bin/samsungctl", line 9, in <module>
    load_entry_point('samsungctl===0.3.0-git', 'console_scripts', 'samsungctl')()
  File "build/bdist.linux-x86_64/egg/samsungctl/__main__.py", line 88, in main
  File "build/bdist.linux-x86_64/egg/samsungctl/__main__.py", line 36, in _read_config
NameError: global name 'FileNotFoundError' is not defined

Once the config file is created, this particular error disappears.

samsung ue48ju7500t

sorry but samsung ue48ju7500t not work . the error is Error: Connection refused

Some TV models are not working

Edited by @Ape:
I hijacked this issue to collect all instances where some random TV model does not work, but we don't know what is the cause or how it could be fixed. Some TV models might not simply support TCP/IP control at all, and some models may require a whole new protocol. When you have techinical details about a specific case that could be fixed please open a new issue.


Original message:
I'm wondering if anyone can confirm if this works for their JS9000 or H5203? Getting 'Connection refused' from the 9000 and no response from the 5203.

Couldn't run Samsungctl.

This error shows up.

samsungctl --host 192.168.1.2 key KEY_POWER Traceback (most recent call last): File "/home/pi/.local/bin/samsungctl", line 11, in <module> sys.exit(main()) File "/home/pi/.local/lib/python2.7/site-packages/samsungctl/__main__.py", line 92, in main config = _read_config() File "/home/pi/.local/lib/python2.7/site-packages/samsungctl/__main__.py", line 37, in _read_config except FileNotFoundError: NameError: global name 'FileNotFoundError' is not defined

When commented the FileNotfoundError exception
New error popped up

samsungctl --host 192.168.1.2 key KEY_POWER
Traceback (most recent call last):
  File "/home/pi/.local/bin/samsungctl", line 11, in <module>
    sys.exit(main())
  File "/home/pi/.local/lib/python2.7/site-packages/samsungctl/__main__.py", line 93, in main
    config = _read_config()
  File "/home/pi/.local/lib/python2.7/site-packages/samsungctl/__main__.py", line 46, in _read_config
    with config_file:
UnboundLocalError: local variable 'config_file' referenced before assignment

PS:I used pip for installation.

Configurable output verbosity

The following options should be added:

  • -q to suppress any non-fatal output
  • -v enables info ouput
  • -vv enables debug output

Using samsungctl over the internet

im trying to remotely fire off events but im getting ms.channel.timeOut each time. Port 8001 is open so i can connect using websockets. Is this a known issue?

samsung ue48h6650 not working

tried to set-up my tv via homeassistant but got no luck, so i tried to use samsungctl directly from my pc to see whats wrong.

nmap output:

nmap -p 1-65535 192.168.99.20
Starting Nmap 7.40 ( https://nmap.org ) at 2017-05-11 11:41 CEST
Nmap scan report for 192.168.99.20
Host is up (0.0034s latency).
Not shown: 65529 closed ports
PORT      STATE SERVICE
7676/tcp  open  imqbrokerd
8000/tcp  open  http-alt
8001/tcp  open  vcom-tunnel
8080/tcp  open  http-proxy
8443/tcp  open  https-alt
15500/tcp open  unknown

looks like this tv is using 8001 (websockets) - telnet to this ip,port works.
so i tried samsungctl:
samsungctl --host 192.168.99.20 --method websocket KEY_MUTE
(got no output on the console - so it shall be ok)
but on the wireshark i see that it is not.


mypc -> tv
GET /api/v2/channels/samsung.remote.control?name=cmVtb3Rl HTTP/1.1
Upgrade: websocket
Connection: Upgrade
Host: 192.168.99.20:8001
Origin: http://192.168.99.20:8001
Sec-WebSocket-Key: u5Y00EnwvXkhM4CqnAGJVQ==
Sec-WebSocket-Version: 13

tv -> my pc
HTTP/1.1 101 Switching Protocols
Upgrade: websocket
Connection: Upgrade
Sec-WebSocket-Accept: xAXj7aiUcGOEkRzP+LaFtHVICqs=

tv->my pc(via websocket)
{"event":"ms.channel.connect","data":{"id":"43c8abe0-1ddc-11b2-8e9e-eb818775dcdb","clients":[{"id":"43c8abe0-1ddc-11b2-8e9e-eb818775dcdb","connectTime":4375967,"attributes":{"name":"cmVtb3Rl"},"isHost":false}]}}

mypc->tv (via websocket)
{"params": {"Cmd": "Click", "Option": "false", "TypeOfRemote": "SendRemoteKey", "DataOfCmd": "KEY_VOLUP"}, "method": "ms.remote.control"}

tv->mypc (via websocket)
{"event":"ms.error","data":{"message":"unrecognized method value : ms.remote.control"}}

mypc->tv (via websocket)
connection close (status code: normal closure(1000)

tv->mypc (via websocket)
connection close (status code: normal closure(1000)

got any idea what could be wrong? i have something disabled on my tv? or h series uses some different protocol? - i can test something more if needed

Handle TV responses

The controlled TV sends return messages with the TCP connection. These messages should be handled.

Some cases:

  • Wait for ack before sending the next key
  • Show error messages
  • Wait for user authorization

no response from TV

Hi, when using this commad:

samsungctl --host 192.168.5.91 --port 8001 KEY_MUTE --method websocket --name "home-assistant" --id 1234567890 --timeout 30 -v

the output is : Sending control command: KEY_MUTE

the TV dosent ask me to accept it as a remote, any ideas?

Porting to C#

Hi,

I'm attempting to port this over to c# to eventually use in homeseer for my 2016 UN55KU6270.

I'm able to get a connection and authenticate with the tv. However, after sending the JSON I'm getting the following error from the tv:

{"event":"ms.error","data":{"message":"missing method field from message"}}

I'm sending the following JSON across:

"{\"method\":\"ms.remote.control\",\"params\":\"{\"Cmd\":\"Click\",\"DataOfCmd\":\"KEY_MENU\",\"Option\":\"false\",\"TypeOfRemote\":\"SendRemoteKey\"}\"}"

Any clue what I'm doing wrong here?

Key code for smart hub

I'm trying to use samsungctl to automate some common tasks. However, most tasks relevant to me involves the smart hub, and I can't find or figure out the key code for that. Does anyone know it, or is anyone able to figure it out by sniffing the network traffic?

How to set volume to specific value

Hi friends,
I want to set my TV volume to specific value like "Volume 40, Volume 55". How can we set like, how we are setting for channels.

how to operate Multiple key?

Hi,
I want to operate multiple keys (KEY_0,KEY_1,KEY_2......,) in python program.
Where those keys are mainly used ?. I'm trying those keys to open applications present on the TV. how can i achieve this?

Make fields on Remote constructor config optional

Currently the default configuration parameters are set on the command line tool, not on the Remote object. This means that all configurations fields must be set when using samsungctl as a library.

Change this so that even library usage has the default parameters so that some configuration fields can be omitted.

Support for Text Input

Legacy TVs support text being sent through the remote. I wonder if that is also possible with the new models. Maybe through some other params in this request:

        payload = json.dumps({
            "method": "ms.remote.control",
            "params": {
                "Cmd": "Click",
                "DataOfCmd": key,
                "Option": "false",
                "TypeOfRemote": "SendRemoteKey"
            }
        })

Conffused!!!

Hi,
First Sorry for Silly question and bad Grammar!
I do electronic stuff with ARM and AVR , and I decided to control Samsung Smart TV with TCP/IP, with no background.
1.How execute .py ?
2.How to connect to TV? How send Key Codes?
3.Can i connect TV to my WiFi module and then command it by IP??!
4.At last , what should i do for first step?
Please give me a overview to what to do and what to learn.

AUR package

AUR is a community based application repository for Arch Linux. PKGBUILD should be created and uploaded there.

Error: Broken pipe

When I start the interactive mode and when I choose to show the menu, it wil show it on de screen of my tv. But after about 30 seconds and entering a new command it's not responding anymore and the console gets closed with the message Error: Broken pipe

I can start the interactive mode again and the first few commands are working correctly but after 30 seconds I get the same error again.

System: Raspberry Pi 3
Tv: Samsung UE55KS7000
samsungctl 0.7.0

[Edit]
I notice I have the same issue as #16. After a while I have to allow again before I can connect

How to change channels from digital setup box ?

Hi,
I want to change channels present in my digital setup box from samsungctl API. KEY_CHUP & KEY_CHDOWN is not working for my setup box. How can i change channels using samsungctl API ?

Comprehensive guide

Write a detailed step-by-step tutorial that shows what samsungctl does and how it should be used.

[WinError 10035] A non-blocking socket operation could not be completed immediately

Hi,

When i try to run the sample on a windows machine (Windows 10, python 3.6 64-bit) i get the following error:

File "sample.py" line 16, in
with samsungctl.Remote(config) as remote:
File "C:\Program Files\Python36\lib\site-packages\samsungctl\remote.py", line 10, in init
self.remote = RemoteWebsocket(config)
File "C:\Program Files\Python36\lib\site-packages\samsungctl\remote_websocket.py", line 22, in init
self._serialize_string(config["name"])), config["timeout"])
File "C:\Program Files\Python36\lib\site-packages\websocket_core.py", line 487, in create_connection
websock.connect(url, **options)
File "C:\Program Files\Python36\lib\site-packages\websocket_core.py", line 211, in connect
options.pop('socket', None))
File "C:\Program Files\Python36\lib\site-packages\websocket_http.py", line 71, in connect
sock = _open_socket(addrinfo_list, options.sockopt, options.timeout)
File "C:\Program Files\Python36\lib\site-packages\websocket_http.py", line 114, in _open_socket
sock.connect(address)
BlockingIOError: [WinError 10035] A non-blocking socket operation could not be completed immediately

Any idea what the issue could be? Python is not my really my programming language so I have no idea where to start solving this issue myself.

Error: Operation now in progress

Hi!

When I type command sudo python3 -m samsungctl --host 192.168.1.110 --port 8001 KEY_MUTE --method websocket in my terminal I see this error:

Error: Operation now in progress

I think this is from web socket, but do not know workaround. Do not see this message in your code.

My TV is H6640.

UE43KU6670SXXN

When I use the ssh command line Samsungctl via Websocket it works. However when I use the Domoticz plugin I get a message Error: Not Connected. Can't seem to find the problem...

Second digit is not sent

I have something like this

with samsungctl.Remote(config_remote) as remote:
for digit in channel:
remote.control("KEY_" + digit)
remote.control("KEY_ENTER")
print 'The channel was changed to ', channel

but the problem is that each time the second command is not sent

If channel is "123" on my TV i get only 13.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.