Skip to main content

pywfrac

PyPI CI

Async Python client library for Mitsubishi Heavy Industries air conditioners that use the WF-RAC WiFi module and the Smart M-Air app. Talks the module's local HTTP(S) API and decodes/encodes the airconStat protocol carried over it.

Not for Mitsubishi Electric systems (e.g. a MAC-577IF2-E interface) or MELCloud — different manufacturer, different protocol.

This library is the protocol layer extracted from the mitsubishi_wf_rac Home Assistant integration, which stays the reference for field notes and supported devices. pywfrac has no dependency on Home Assistant — it only needs an aiohttp.ClientSession.

Install

pip install pywfrac

Usage

import aiohttp
from pywfrac import AirconCommands, Repository


async def main() -> None:
    async with aiohttp.ClientSession() as session:
        repo = Repository(
            session,
            hostname="192.168.1.50",
            port=51443,
            operator_id="my-operator-id",
            device_id="my-device-id",
        )
        airco_id = await repo.get_airco_id()
        await repo.async_register(airco_id, "Europe/Berlin")
        status = await repo.async_get_status(airco_id)
        print(status.aircon.PresetTemp, status.firmware, status.expires)

        # Changed fields on top of the last known state; waits out another
        # client's write lock and re-registers on its own.
        aircon = await repo.async_send_command(
            airco_id, status.aircon, {AirconCommands.PresetTemp: 22.0}
        )

async_get_status, async_register, async_unregister and async_send_command raise only WfRacError subclasses (WfRacConnectionError, WfRacMalformedResponseError, WfRacRegistrationError, WfRacAccountTableFullError, WfRacCommandError, WfRacWriteRefusedError). The older get_aircon_stats, update_account_info and send_airco_command return the module's answer unchanged and stay available.

Repository discovers whether the module speaks plain HTTP or HTTPS on the first request and remembers the result; construct it with method="http" or method="https" to skip discovery if you already know. Pass cert_path to use a captured module certificate instead of the permissive fallback context — see Repository._get_ssl_context for how to capture one. A stored method that stops answering is retried on the other protocol within the same call. Pass time_zone to let async_send_command register again by itself.

RacParser turns a raw getAirconStat response into an Aircon/AirconStat object and back; see the protocol reference linked below for the field layout. ModelCapabilities.setpoint_range(mode) gives the setpoint limits for a mode. Aircon.operation_mode, air_flow, wind_direction_ud and wind_direction_lr give the raw fields as enums, or None where the unit sent a value without a member (e.g. an unknown airflow).

Protocol reference

The airconStat wire format, error codes, and per-model capability tables are documented in the integration's module reference.

Used by

Versioning

This library follows SemVer, independent of the integration's own CalVer release scheme — pin an exact version.

License

MIT, see LICENSE. Extracted from code originally by @jeatheak, maintained since by @blues-sechseck.

Metadata

Release files for pywfrac 0.1.20

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

Source distribution (sdist)

Source distribution for pywfrac 0.1.20
File Size Uploaded Provenance Actions
pywfrac-0.1.20.tar.gz 78.1 kB With provenance Details for pywfrac-0.1.20.tar.gz

Built distribution (wheel)

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

Total release size: 130.7 kB

Release files / pywfrac-0.1.20.tar.gz

Download URL pywfrac-0.1.20.tar.gz
Size 78.1 kB
Tags Source
SHA-256 checksum
How to use checksums
4af638a6c8edfc5c0e4be2b7992eb87c4bda2f8a5d9f5fb65eab20e248d68e9e
BLAKE2b-256 checksum
How to use checksums
6a658d9c5516352ab7cf03159a7c81f1616a9ce77b7e77750974a1798818d28c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 3, 2026.

Transparency log

Release files / pywfrac-0.1.20-py3-none-any.whl

Download URL pywfrac-0.1.20-py3-none-any.whl
Size 52.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4f4965d3e4a859311e11685ac48decb6390d62db2a604f907e84cefb961a9530
BLAKE2b-256 checksum
How to use checksums
1dc57dc2bd7a31bc1578b1631dd3857bd55f53f40f8bea1fde5e5e3d360887f2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 3, 2026.

Transparency log

Security for pywfrac 0.1.20

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pywfrac-0.1.20.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 3, 2026.

Transparency log

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