Samsung Smart TV WS API wrapper
Project description
Samsung Smart TV WS API wrapper
This project is a Python library for remotely controlling Samsung televisions via a TCP/IP connection.
It supports modern (post-2016) Samsung Smart TVs running Tizen OS, connected via Ethernet or Wi-Fi.
Documentation
Most of the general usage and features are documented in this README. Some advanced topics are covered in dedicated documents:
-
Commands
Detailed remote key reference, including the full key list and all supported ways to send keys via the CLI. -
Applications (App IDs)
Extended documentation about application IDs, how to find them, and how to install or launch applications from the TV.
Features
- WebSocket and REST APIs
- Sync and async support
- Encrypted v1 API support for older TVs
- Full Art Mode support (Frame TVs)
- Command-line interface (CLI)
Installation
Requires Python >= 3.9.
Install from PyPI (recommended)
Core library:
pip install samsungtvws
Common install (async + encrypted + CLI):
pip install "samsungtvws[async,encrypted,cli]"
Optional extras
async: async I/O support (aiohttp,websockets)encrypted: v1 encrypted API support (older Orsay TVs)cli: installs thesamsungtvcommand (typer,wakeonlan)
Examples:
pip install "samsungtvws[cli]"
pip install "samsungtvws[async]"
pip install "samsungtvws[encrypted]"
Install from GitHub (latest main branch)
pip install "git+https://github.com/xchwarze/samsung-tv-ws-api.git#egg=samsungtvws[async,encrypted,cli]"
Local development install
git clone https://github.com/xchwarze/samsung-tv-ws-api.git
cd samsung-tv-ws-api
pip install --editable ".[async,encrypted,cli]"
--editable installs the package in development mode and can be omitted for a regular local install.
CLI check
If installed with the cli extra:
samsungtv --help
Usage
This library can be used either programmatically or via the CLI, depending on the integration needs.
Programmatic usage
For custom integrations or advanced control flows, the library can be consumed directly from Python code.
The examples/ directory contains ready-to-run programmatic examples, including:
- WebSocket and REST usage
- Async integrations
- Encrypted API usage
- Art Mode control
Reviewing these examples is the recommended starting point for manual integrations.
CLI usage
For quick testing, automation, or scripting, the library provides a fully featured command-line interface.
Requires installation with the cli extra.
Once installed:
samsungtv --help
CLI examples
Power on TV using Wake-on-LAN:
samsungtv --host 192.168.1.50 wol
Toggle power:
samsungtv --host 192.168.1.50 power
List installed applications:
samsungtv --host 192.168.1.50 apps
Run an application by ID:
samsungtv --host 192.168.1.50 app-run 3201606009684
Open a URL in the TV browser:
samsungtv --host 192.168.1.50 open-browser https://duckduckgo.com
Get device information:
samsungtv --host 192.168.1.50 device-info
Enable Art Mode:
samsungtv --host 192.168.1.50 art-mode on
Upload an image to Art Mode:
samsungtv --host 192.168.1.50 art-upload image.jpg
The CLI exposes most of the library functionality, including:
- App management
- Remote control keys
- Device information
- Wake-on-LAN
- Full Art Mode management
Supported TVs
This library is designed to support all Samsung Smart TVs running Tizen OS (2016+).
It also provides support for older Orsay-based TVs, specifically:
- H series (2014)
- Part of J series (2015)
Support for Orsay devices is mainly provided through the encrypted v1 API.
Official Samsung compatibility references:
- https://developer.samsung.com/smarttv/develop/extension-libraries/smart-view-sdk/supported-device/supported-tvs.html
- https://developer.samsung.com/smarttv/develop/specifications/tv-model-groups.html
Patreon and Tips!
(I have this block in all my GPL projects) Those who want to help buy testing hardware or just give me a tip, you can do it by sending donations to my Binance account. I also made a Patreon
License
LGPL-3.0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file samsungtvws-3.0.3.tar.gz.
File metadata
- Download URL: samsungtvws-3.0.3.tar.gz
- Upload date:
- Size: 42.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4c2a70a2aa878c9584f239e37f030fbcb0b583bb7ae189ccbfeaaf77eb244038
|
|
| MD5 |
68075a3d6c248221b8e3d76b2218b8fc
|
|
| BLAKE2b-256 |
32b869ff7fbc1379d09d83680fff29460f884f8ad20aaa246af33de6b31c20a6
|
Provenance
The following attestation bundles were made for samsungtvws-3.0.3.tar.gz:
Publisher:
release.yml on xchwarze/samsung-tv-ws-api
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
samsungtvws-3.0.3.tar.gz -
Subject digest:
4c2a70a2aa878c9584f239e37f030fbcb0b583bb7ae189ccbfeaaf77eb244038 - Sigstore transparency entry: 813317492
- Sigstore integration time:
-
Permalink:
xchwarze/samsung-tv-ws-api@6c850671b2a83a5440079c3120de7ecb1d6a7e81 -
Branch / Tag:
refs/tags/v3.0.3 - Owner: https://github.com/xchwarze
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@6c850671b2a83a5440079c3120de7ecb1d6a7e81 -
Trigger Event:
release
-
Statement type:
File details
Details for the file samsungtvws-3.0.3-py3-none-any.whl.
File metadata
- Download URL: samsungtvws-3.0.3-py3-none-any.whl
- Upload date:
- Size: 45.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a9548a63dff2a6e9d20367ad6aff7e60881fcd433fc44e020c04e69b9fbfc203
|
|
| MD5 |
70698d0244d072263e31c4fa3cdc9e42
|
|
| BLAKE2b-256 |
94b5e519c9afdf2dc03de1464796dbe3e14eda24971cbf97a84f8b5173d6fb7b
|
Provenance
The following attestation bundles were made for samsungtvws-3.0.3-py3-none-any.whl:
Publisher:
release.yml on xchwarze/samsung-tv-ws-api
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
samsungtvws-3.0.3-py3-none-any.whl -
Subject digest:
a9548a63dff2a6e9d20367ad6aff7e60881fcd433fc44e020c04e69b9fbfc203 - Sigstore transparency entry: 813317493
- Sigstore integration time:
-
Permalink:
xchwarze/samsung-tv-ws-api@6c850671b2a83a5440079c3120de7ecb1d6a7e81 -
Branch / Tag:
refs/tags/v3.0.3 - Owner: https://github.com/xchwarze
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@6c850671b2a83a5440079c3120de7ecb1d6a7e81 -
Trigger Event:
release
-
Statement type: