Skip to main content

Mysa Client

Unofficial and unaffiliated with Mysa. Use at your own risk.

An asynchronous Python library for Mysa thermostats. It talks to Mysa's cloud, to a thermostat on your network over HomeKit, and optionally to Mysa's MQTT service for live readings on the older models. Your application supplies the credentials and decides when to connect, poll and store anything.

Documentation and task index · Connect a client · Examples · Changelog

Powers Mysa Local for Home Assistant. Use that repository to install it in Home Assistant and for its entities and settings.

Installation

Python 3.11 or newer is required:

python -m pip install mysa-client

Optional transports:

python -m pip install 'mysa-client[homekit,mqtt]'

Import mysa_client.cloud, mysa_client.homekit, or mysa_client.mqtt. Installing extras or importing the package does not start a connection.

Quick start

Sign in, list the account's thermostats and read each one:

import asyncio

import aiohttp

from mysa_client.cloud import MysaAuth, MysaClient

USER_AGENT = "my-app/1.0"


async def main() -> None:
    async with aiohttp.ClientSession() as session:
        auth = MysaAuth(session, user_agent=USER_AGENT)
        await auth.sign_in("account@example.com", "your-password")
        client = MysaClient(session, auth, user_agent=USER_AGENT)

        account = await client.bootstrap()
        for device_id in account.devices:
            state = await client.get_state(device_id)
            print(state.model, state.room_temperature, state.heat_setpoint)


asyncio.run(main())

Temperatures are in °C. To change one, build a Setpoint with SetpointRules, which rounds to the thermostat's step and checks its range; every write requires one. A request the cloud accepts is not proof that the thermostat applied it, so read the state back.

Examples

Runnable scripts are in examples/:

Keep passwords and tokens out of source control.

API support and goals

66.7% of known Mysa API operations fully implemented (74/111)

66.7% of known Mysa API operations fully implemented (74/111).

Cloud & account APIs: 62/89 (69.7%); Local & provisioning APIs: 12/22 (54.5%).

The API inventory measures implemented operation breadth, not hardware validation or test coverage. Hardware observations cover two Baseboard Lites (BB-V2-0-L, firmware 3.17.5.13); other-model mappings remain app-derived or simulated unless stated. See evidence and compatibility.

Public API

The Python API index covers the cloud, HomeKit, MQTT and runtime interfaces, including which submodules are supported imports. Timeouts, error types, retries and closing connections are described per transport, starting with the client lifecycle.

Development and release

git clone https://github.com/SokolskyNikita/mysa-client.git
cd mysa-client
python -m pip install -e '.[homekit,mqtt]' --group test --group lint --group build
tools/check   # formatting, lint, types, docs and tests in a few seconds

tools/check skips the packaging steps that CI runs (build, artifact checks, the installed-wheel tests with coverage, and the cloud-only install). With uv, uv venv and uv pip install in place of pip set up a fresh environment in about a second.

See documentation maintenance for offline checks and releasing for validation and publishing. Licensed under MIT.

Metadata

Release files for mysa-client 0.4.0

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

Source distribution (sdist)

Source distribution for mysa-client 0.4.0
File Size Uploaded Provenance Actions
mysa_client-0.4.0.tar.gz 345.1 kB Without provenance Details for mysa_client-0.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mysa-client 0.4.0
File Interpreter ABI Platform Actions
mysa_client-0.4.0-py3-none-any.whl Python 3 none any Details for mysa_client-0.4.0-py3-none-any.whl

Total release size: 476.5 kB

Release files / mysa_client-0.4.0.tar.gz

Download URL mysa_client-0.4.0.tar.gz
Size 345.1 kB
Tags Source
SHA-256 checksum
How to use checksums
19eafc3cbb4d1aa25bafb3a2de9052f41d754b8e45952929c5bad0335bae8aed
BLAKE2b-256 checksum
How to use checksums
91e5aa65439bad707c80fe511a9e15d04e5c23ef10a5df248517925abea2e266
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.14.10

Release files / mysa_client-0.4.0-py3-none-any.whl

Download URL mysa_client-0.4.0-py3-none-any.whl
Size 131.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2a7c3416e71bd41023f0f7054121a9312ffef320bf5b66f415da3546ac5336e2
BLAKE2b-256 checksum
How to use checksums
190474132fb8689aa520752c93cae15b9df951a3509c7b1680ddacd459b75879
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.14.10

Security for mysa-client 0.4.0

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