samsungtvws
Samsung Smart TV WS API wrapper
What it is and what it does
Samsungtvws is a Python wrapper around Samsung Smart TV control APIs, letting you remotely control Tizen OS TVs (2016+) and older Orsay models via WebSocket or REST. It handles both synchronous and asynchronous control flows, with optional support for encrypted connections on legacy hardware. The library exposes remote key commands, app management, device information queries, Wake-on-LAN, and Art Mode control for Frame TVs—either programmatically from Python code or via a command-line interface.
The package depends on websocket-client, requests, and yarl for core networking, with optional extras for async I/O (aiohttp, websockets), encryption (cryptography, py3rijndael), and CLI tooling (typer, wakeonlan). It is actively maintained, marked as production-stable, and requires Python 3.9 or later. No known security vulnerabilities are recorded.
Use it for:
- Automate TV power, volume, and input switching in a home automation system without a dedicated remote.
- Launch apps or open URLs on the TV programmatically from a Python application or script.
- Integrate Samsung TV control into a larger smart-home orchestration platform via async APIs.
- Manage Art Mode on Frame TVs—upload images or toggle the feature from a custom application.
- Build CLI tooling to quickly test TV connectivity and send remote commands for debugging or scripting.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
A Python library for remotely controlling Samsung Smart TVs via WebSocket and REST APIs, supporting both modern Tizen OS TVs and older Orsay-based models with sync, async, and encrypted API options.
Yes, if you own a compatible Samsung TV and need programmatic control. The library is actively maintained, has low install friction, and covers a broad range of TV models and control scenarios. The LGPL-3.0 license is permissive for most use cases but requires derivative works to remain open-source. The main gotcha is the subnet restriction—your TV must be on the same network as your client.
Install
samsungtvws on PyPI
pip
pip install samsungtvwsuv
uv add samsungtvwspoetry
poetry add samsungtvwsInstalling samsungtvws
Before you install
Low install friction with a pure-Python wheel distribution. Active maintenance with a recent commit on 2026-08-08 and 419 repository stars. Requires Python >= 3.9.
License in practice
Licensed under LGPL-3.0 (copyleft). Any derivative work or modification must remain open-source under the same license; proprietary applications using this library must comply with copyleft obligations.
Quickstart
pip install samsungtvws
from samsungtvws import SamsungTVWS
tv = SamsungTVWS(host="192.168.1.50")
tv.power()
TV must be on the same subnet as the client; WebSocket connections across different subnets or VLANs are not supported by Samsung TVs.
Verify before relying
- Whether the library works reliably with all Tizen OS TVs from 2016 onward or if specific TV models have known compatibility issues.
- Performance characteristics when controlling multiple TVs concurrently or sending rapid command sequences.
- Whether the encrypted v1 API for older Orsay TVs (H series 2014, J series 2015) is actively maintained or deprecated.
Package facts
| License | LGPL-3.0 (copyleft) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — websocket-client, requests, yarl |
| Maintenance | actively maintained — 78 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 117,705/month — #12,154 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: samsungtvws-3.0.5-py3-none-any.whl
Tags
More Networking packages
h11 is a pure-Python HTTP/1.1 protocol…
permissive · top 100 on PyPI
psutilpsutil retrieves real-time information about…
permissive · top 1,000 on PyPI
pyOpenSSLpyOpenSSL wraps OpenSSL's SSL/TLS functionality…
permissive · top 1,000 on PyPI
uvloopuvloop is a drop-in replacement for Python's…
permissive · top 1,000 on PyPI
execnetexecnet lets you spawn and communicate with…
permissive · top 1,000 on PyPI
pyzmqPyZMQ provides Python bindings for ZeroMQ…
permissive · top 1,000 on PyPI
pyatvAn asyncio Python library for controlling Apple…
permissive · top 15,000 on PyPI
pybraviaProvides an async Python interface to control…
permissive · top 15,000 on PyPI
pykodiPyKodi provides an async Python interface to…
permissive · top 15,000 on PyPI
aiowebostvAsync Python library for controlling LG…
permissive · top 15,000 on PyPI
androidtvremote2A Python library for controlling Android TV…
permissive · top 15,000 on PyPI
httpx-wsAdds WebSocket support to HTTPX, enabling sync…
permissive · top 5,000 on PyPI
pysensiboProvides an asyncio-friendly Python API client…
permissive · top 15,000 on PyPI
websockets-proxyEnables WebSocket connections through HTTP and…
permissive · top 15,000 on PyPI
aioshellyAsynchronous Python library for controlling…
permissive · top 15,000 on PyPI
wakeonlanSends wake-on-LAN magic packets to power on…
permissive · top 15,000 on PyPI