Skip to main content

Mysa Client

Unofficial and unaffiliated with Mysa. Use at your own risk. Mysa also has an official Consumer API, which this library doesn't use yet.

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

67.9% of known Mysa API operations fully implemented (76/112)

67.9% of known Mysa API operations fully implemented (76/112).

Cloud & account APIs: 64/89 (71.9%); Local & provisioning APIs: 12/23 (52.2%).

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.5.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.5.0
File Size Uploaded Provenance Actions
mysa_client-0.5.0.tar.gz 385.9 kB Without provenance Details for mysa_client-0.5.0.tar.gz

Built distribution (wheel)

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

Total release size: 524.2 kB

Release files / mysa_client-0.5.0.tar.gz

Download URL mysa_client-0.5.0.tar.gz
Size 385.9 kB
Tags Source
SHA-256 checksum
How to use checksums
a50fd05dafe0a9796f123ffdbac71ff4a354e0905c9040bd328b304611553a69
BLAKE2b-256 checksum
How to use checksums
fa0147b1fe67a7dbdd963aaa275c91d76dc6b9d29815e7efbf153b37ddc18688
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.5.0-py3-none-any.whl

Download URL mysa_client-0.5.0-py3-none-any.whl
Size 138.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3a34c44719c560a74f045fff9466cf29ff0ff05d415e83067bbf911b9d74aa0b
BLAKE2b-256 checksum
How to use checksums
1de23945977d7c2be7a38d829797e4bd89d2c44a75594182413433f9718ff286
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.5.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