Async client for old Samsung air conditioners using the DPLUG/AC14K protocol (TLS, port 2878)
Project description
pysamsung-dplug
Async Python client for old Samsung air conditioners that speak the legacy
DPLUG / AC14K protocol over TLS on port 2878 (Wi-Fi modules such as
SWL-B70F, used by the AR**HSFS generation, ~2013–2015).
These units were dropped by SmartThings. This library lets you control them
locally again — no cloud. It is the protocol layer used by the
samsung_ac_dplug Home Assistant
integration, but works standalone.
Features
- Mutual-TLS handshake with the bundled Samsung client certificate (legacy TLS 1.0 / weak ciphers handled for you).
- Token acquisition (
GetToken), authentication (AuthToken). - Read full device state (
DeviceState) and send commands (DeviceControl). - Auto-discover the device id (
DeviceList) and a passiveasync_probe().
Install
pip install pysamsung-dplug
Usage
import asyncio
from samsung_dplug import SamsungAcClient, build_ssl_context
async def main():
ctx = build_ssl_context() # uses the bundled certificate
client = SamsungAcClient("192.168.1.53", token="xxxxxxxx-....", ssl_context=ctx)
state = await client.async_get_state()
print("Power:", state["AC_FUN_POWER"], "Room:", state["AC_FUN_TEMPNOW"])
await client.async_set("AC_FUN_POWER", "On")
asyncio.run(main())
Getting a token
The unit only issues a token at power-on (a physical proof-of-access step):
client = SamsungAcClient("192.168.1.53", ssl_context=ctx)
# turn the unit OFF, call this, then turn it ON within ~30 s:
token = await client.async_get_token()
build_ssl_context()does blocking file I/O; inside async frameworks run it in an executor (e.g. Home Assistant:await hass.async_add_executor_job(build_ssl_context)).
Protocol notes
Reverse-engineered from the official Smart Air Conditioner app and live
devices. The unit greets with DPLUG-1.x, requires mutual TLS, and uses an
XML request/response protocol. The DUID equals the Wi-Fi module MAC without
separators. See the Home Assistant integration repo for the full write-up,
including the undocumented APConnectionConfig Wi-Fi provisioning command.
License
MIT
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 pysamsung_dplug-0.6.0.tar.gz.
File metadata
- Download URL: pysamsung_dplug-0.6.0.tar.gz
- Upload date:
- Size: 14.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
74738687acf1894559b47b0e7cd1dcdddced3142dfe8548a6b829fcefd99d14a
|
|
| MD5 |
d610240147864209175568e8798c13f6
|
|
| BLAKE2b-256 |
0dc9cbbe5e6ca3444cfe70cb1d609415a9f7aa5357698d3b9834630e0bb91f8a
|
Provenance
The following attestation bundles were made for pysamsung_dplug-0.6.0.tar.gz:
Publisher:
publish.yml on porech/pysamsung-dplug
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pysamsung_dplug-0.6.0.tar.gz -
Subject digest:
74738687acf1894559b47b0e7cd1dcdddced3142dfe8548a6b829fcefd99d14a - Sigstore transparency entry: 1822331938
- Sigstore integration time:
-
Permalink:
porech/pysamsung-dplug@8b9706ab85e2e044ba0f19567cd437a9ad1f4d9c -
Branch / Tag:
refs/tags/v0.6.0 - Owner: https://github.com/porech
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@8b9706ab85e2e044ba0f19567cd437a9ad1f4d9c -
Trigger Event:
push
-
Statement type:
File details
Details for the file pysamsung_dplug-0.6.0-py3-none-any.whl.
File metadata
- Download URL: pysamsung_dplug-0.6.0-py3-none-any.whl
- Upload date:
- Size: 16.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
af15187b18a6b46af877051ca08ab2017a0d9b8523eacfed35bbbf59ad3b0e4a
|
|
| MD5 |
958e69cd3d3d6b09adb227af303cbd9c
|
|
| BLAKE2b-256 |
13c0d837fc0ebf6719da009fca9dcd8b950bab4b7c106b0374d17589ee5f47ca
|
Provenance
The following attestation bundles were made for pysamsung_dplug-0.6.0-py3-none-any.whl:
Publisher:
publish.yml on porech/pysamsung-dplug
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pysamsung_dplug-0.6.0-py3-none-any.whl -
Subject digest:
af15187b18a6b46af877051ca08ab2017a0d9b8523eacfed35bbbf59ad3b0e4a - Sigstore transparency entry: 1822331958
- Sigstore integration time:
-
Permalink:
porech/pysamsung-dplug@8b9706ab85e2e044ba0f19567cd437a9ad1f4d9c -
Branch / Tag:
refs/tags/v0.6.0 - Owner: https://github.com/porech
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@8b9706ab85e2e044ba0f19567cd437a9ad1f4d9c -
Trigger Event:
push
-
Statement type: