Skip to main content

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 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.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyscinan 0.1.1
File Size Uploaded Provenance Actions
pyscinan-0.1.1.tar.gz 24.0 kB Without provenance Details for pyscinan-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pyscinan 0.1.1
File Interpreter ABI Platform Actions
pyscinan-0.1.1-py3-none-any.whl Python 3 none any Details for pyscinan-0.1.1-py3-none-any.whl

Total release size: 42.1 kB

Release files / pyscinan-0.1.1.tar.gz

Download URL pyscinan-0.1.1.tar.gz
Size 24.0 kB
Tags Source
SHA-256 checksum
How to use checksums
06d357b3ff60aa2f3464e9e3f0bdb09a95ae5002941bd1ad19de3e522f2dcaad
BLAKE2b-256 checksum
How to use checksums
b972e8af4ae3c5056bd9bbc7e78de2abdc284c687510d4434926437a69587f0b
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.1-py3-none-any.whl

Download URL pyscinan-0.1.1-py3-none-any.whl
Size 18.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
011c6d258d2a22a69cc725841b5ec5425fa66680900c5930dd0cb01a50f30afe
BLAKE2b-256 checksum
How to use checksums
85f65d43e33ca5cdce54fafae34ca7f2254f61ae3d89aea76750bb7e41f9e36a
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.1

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page