pyscinan
Async Python library for Saswell (Scinan platform) Wi-Fi thermostats.
- Local: talks directly to the thermostat over your network (TCP port 2000). No cloud, instant push updates, heartbeat and automatic reconnect.
- Cloud: the Saswell v2.0 API used by the Saswell "Thermostat" app.
Both clients fill the same ScinanDevice model. Used by the
Scinan Saswell Thermostat Home Assistant integration.
Tested with the Saswell SAS920FHL-7W-WIFI (electric floor heating). Other thermostats using a Saswell Thermostat app (for example SAS922WHL-7W-S-WIFI, T13FHL-7(EN) WIFI and Prosmart PST50W) are known to work with the cloud API.
Install
pip install pyscinan
Requires Python 3.12 or newer.
Local
The thermostat must already be on your Wi-Fi (set it up with the Thermostat app). Give it a fixed IP address; it can't be discovered automatically.
import asyncio
from pyscinan import DeviceMode, ScinanLocalClient
async def main():
async with ScinanLocalClient("192.168.1.50") as client:
dev = client.device
print(dev.device_id, dev.current_temperature, dev.target_temperature, dev.mode)
client.add_listener(lambda: print("update:", dev.current_temperature, dev.target_temperature))
await client.set_temperature(21.5)
await client.set_mode(DeviceMode.COMFORT)
await client.set_away(True) # "off" on floor heating thermostats
await asyncio.sleep(60) # pushes arrive every 15 s and on every change
asyncio.run(main())
Every command returns the status the thermostat answers with. A command the thermostat ignores (for example power on the SAS920FHL) returns the unchanged status, so compare it with what you asked for.
Cloud
from pyscinan import ScinanCloudClient
async with ScinanCloudClient("email@example.com", "password") as cloud:
devices = await cloud.update_devices()
for dev in devices.values():
print(dev.device_id, dev.name, dev.online, dev.target_temperature)
await cloud.set_temperature(dev.device_id, 21.5)
Pass session= to reuse an aiohttp.ClientSession. Note that the Saswell cloud only supports plain HTTP.
Command line
pyscinan status 192.168.1.50
pyscinan listen 192.168.1.50 --seconds 60
pyscinan settemp 192.168.1.50 21.5
pyscinan away 192.168.1.50 on
pyscinan mode 192.168.1.50 1 # 0 Comfort, 1 Auto (schedule), 2 Day or night
pyscinan cloud-list email@example.com # password from $SCINAN_PASSWORD or a prompt
pyscinan --help
Protocol
See PROTOCOL.md for everything known about the local protocol and the cloud API.
Development
uv sync
uv run pytest
uv run ruff check .
The tests use a fake thermostat (TCP) and a fake cloud server, so no hardware or account is needed.
scripts/hw_settings_test.py runs against a real thermostat and changes its settings (then restores them).
Disclaimer
Not affiliated with Saswell or Scinan. Use at your own risk.
Metadata
Release files for pyscinan 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pyscinan-0.1.3.tar.gz | 24.5 kB | Without provenance | Details for pyscinan-0.1.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pyscinan-0.1.3-py3-none-any.whl | Python 3 | none | any | Details for pyscinan-0.1.3-py3-none-any.whl |
Total release size: 42.7 kB
Release files / pyscinan-0.1.3.tar.gz
| Download URL | pyscinan-0.1.3.tar.gz |
|---|---|
| Size | 24.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c89693e277d318b0a6bcba756a0f33cac7d140cac3576d662572d4c500664354
|
|
BLAKE2b-256 checksum How to use checksums |
965217cdf64678a952719e0abb099afc007430b01d7719dc35df3a3260b20857
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / pyscinan-0.1.3-py3-none-any.whl
| Download URL | pyscinan-0.1.3-py3-none-any.whl |
|---|---|
| Size | 18.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
47fdda97a97ea1feb07c24da478239908452e01424caccbacbc4e7a7bd3b49e0
|
|
BLAKE2b-256 checksum How to use checksums |
476dffd8aa94806d9d48c79e23c83ae844d7f68b07de99317d9efd9dac353b75
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for pyscinan 0.1.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.