Registry / devops / samsungtvws

samsungtvws

JSON →
library3.0.5pypypi✓ verified 84d ago

Python library for controlling Samsung Smart TVs via WebSocket and REST APIs. Current version 3.0.5, supports both legacy (2016-2018) and newer (2019+) models. Active development, monthly releases.

pip install samsungtvws
INSTALL
IMPORT
SIG · SAMSUNGTVWS
S
samsungtvws
devopspythonv3.0.5
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

SamsungTVWS
from samsungtvws import SamsungTVWS
from samsungtvws.remote import SamsungTVWS
In v2.x the class was under samsungtvws.remote; in v3.x it's directly under samsungtvws
SamsungTVAsync
from samsungtvws.async_remote import SamsungTVAsync
from samsungtvws import SamsungTVAsync
Async class lives in async_remote module
SamsungTVEncryptedWS
from samsungtvws.encrypted import SamsungTVEncryptedWS
from samsungtvws.remote import SamsungTVEncryptedWS
Encrypted WebSocket class moved to its own module in v3.x

Connect and send a volume up key.

from samsungtvws import SamsungTVWS import os tv = SamsungTVWS(host='192.168.1.100', token=os.environ.get('SAMSUNG_TOKEN', '')) print('Token:', tv.token) tv.send_key('KEY_VOLUP')
Debug
Known issues
breakingv3.0 changed the main import path from samsungtvws.remote.SamsungTVWS to samsungtvws.SamsungTVWS. Old code using direct import will break.
fix
Update imports: 'from samsungtvws import SamsungTVWS' instead of 'from samsungtvws.remote import SamsungTVWS'.
affects: >=3.0.0 <3.0.0
breakingv3.0 removed the 'connection' parameter from SamsungTVWS constructor. Use method_channel='websocket' explicitly.
fix
Replace 'connection=...' with 'method_channel='websocket''.
affects: >=3.0.0
gotchaToken generation requires the TV to be on the same network and prompts user consent on TV screen. The library can generate a token automatically on first connect.
fix
Call tv.start_listening() to initiate token pairing if token is not provided.
affects: all
deprecatedThe get_art() method is deprecated; use get_art_status() instead.
fix
Replace 'tv.get_art()' with 'tv.get_art_status()'.
affects: >=2.6.0
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'samsungtvws.remote'
Trying to import SamsungTVWS from the old module path after upgrading to v3.x.
fix
Use 'from samsungtvws import SamsungTVWS' instead.
samsungtvws.exceptions.ConnectionFailure: Connection to TV failed
TV not powered on or not on same network; token may be invalid.
fix
Ensure TV is on and reachable. Regenerate token by calling tv.start_listening() and accepting on screen.
AttributeError: 'SamsungTVWS' object has no attribute 'send_key'
Using an old version of the library where method was named differently.
fix
Upgrade to latest version: 'pip install --upgrade samsungtvws'
Upgrade
Version history
3.0.5latest on PyPI · released May 28, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
5 hits · last 30 days
node
4
Amazon
1
Resources

No resource links recorded.

samsungtvws — pip install samsungtvws · libregistry