MirAIe AC API Client (miraie-ac-in)
A Python client library and CLI tool for controlling Panasonic MirAIe smart air conditioners. It supports direct local UDP control on LAN, cloud MQTT communication, dynamic hardware capability lookup, and telemetry decoding.
Table of Contents
- Features
- Installation
- Python API Quick Start
- Command-Line Interface (CLI)
- My Python Libraries
- Credits & License
Features
- Local UDP Control & Raw Wire Interception: Intercepts and decrypts raw binary TLV telemetry frames (AES-256-CBC) broadcasted on LAN port 5002 directly from the physical AC hardware, providing sub-20 ms local command execution and telemetry without internet access.
- Cloud MQTT State Subscription: Connects as an authenticated client subscribing to live device status topics (
.../status,.../connectionStatus) on Panasonic's AWS IoT Core broker for instant state updates. - Automatic Cloud Fallback: Automatically falls back to cloud MQTT if a local UDP command is dropped or the device is unreachable on LAN.
- Dynamic Hardware Capabilities: Automatically queries official model capabilities (0.5°C vs 1.0°C temperature steps, motorized horizontal swing, night display mode, convertible capacity percentages, Nanoe air purification, and buzzer controls).
- Firmware 3.02+ Temperature Support: Decodes high-resolution ambient room temperature reported by newer firmware versions, while retaining standard decoding for older firmware.
- Server-Side Energy Statistics: Fetches daily and monthly energy consumption (kWh) computed server-side by Panasonic via the HTTP REST API. (Note: AC hardware lacks an onboard power metering IC, so energy is not streamed over MQTT or UDP).
- Convertible Capacity Modes: Supports 4-in-1, 7-in-1, and 8-in-1 compressor profiles (40% to 110%).
- Telemetry & Diagnostics: Parses power state, fan speed, swing modes, Nanoe status, filter cleaning alerts, Wi-Fi RSSI signal strength, error codes, and control sources.
- Resource Lifecycle Management: Provides an async
close()method to clean up network sockets, background tasks, and HTTP client sessions.
Installation
Install the package via pip:
pip install miraie-ac-in
Python API Quick Start
import asyncio
from miraie_ac import MirAIeHub, MirAIeBroker
from miraie_ac.enums import SwingMode, PresetMode, ConvertiMode, DisplayMode
async def main():
broker = MirAIeBroker()
hub = MirAIeHub()
# Sign in using your registered mobile number or email
await hub.init("+919999999999", "your_password", broker)
# Inspect discovered devices and dynamically fetched capabilities
for device in hub.home.devices:
print(f"Device: {device.friendly_name} (ID: {device.id})")
print(f" Model: {getattr(device.details, 'model_number', 'Unknown')}")
print(f" Local UDP Supported: {device.supports_local_udp}")
print(f" Temp Step: {device.target_temperature_step}°C")
print(f" Horizontal Swing: {device.supports_horizontal_swing}")
print(f" Nanoe Air Purification: {device.supports_nanoe}")
print(f" Buzzer Control: {device.supports_buzzer}")
print(f" Convertible Modes: {device.supported_convertible_modes}")
# Control a device using verified capabilities
if hub.home.devices:
device = hub.home.devices[0]
# Basic controls
await device.turn_on()
await device.set_temperature(24.0)
# Horizontal swing (if supported by hardware)
if device.supports_horizontal_swing:
await device.set_horizontal_swing(SwingMode.AUTO)
# Nanoe air purification (if supported by hardware)
if device.supports_nanoe:
await device.set_nanoe(True)
# Convertible capacity limit (e.g. 70% or 80%)
if device.supports_convertible:
await device.set_converti_mode(ConvertiMode.C70)
# Display mode (e.g. night mode or off)
if device.supports_night_display:
await device.set_display_mode(DisplayMode.NIGHT)
# Clean up network sessions and tasks
await hub.close()
asyncio.run(main())
Command-Line Interface (CLI)
miraie-ac-in includes a command-line tool miraie-ac for managing, testing, and controlling your ACs.
Account Authentication & Discovery
# Verify cloud credentials
miraie-ac auth --user +919999999999
# List registered ACs and print their verified hardware capabilities
miraie-ac devices --user +919999999999
# Export local UDP encryption keys, IVs, MAC addresses, and device IDs in JSON
miraie-ac dump-keys --user +919999999999
# Discover Panasonic ACs broadcasting on the local network via UDP
miraie-ac discover
Telemetry Streaming & Diagnostics
# Ping an AC on UDP port 5001 and measure round-trip latency
miraie-ac ping --ip 192.168.1.100 --device-id 0123456789ab --key "$MIRAIE_KEY" --iv "$MIRAIE_IV"
# Intercept and decrypt raw telemetry frames directly from the local UDP socket (port 5002)
miraie-ac listen --transport udp --device-id 0123456789ab --key "$MIRAIE_KEY" --iv "$MIRAIE_IV"
# Stream live status updates subscribed from Cloud MQTT
miraie-ac listen --transport cloud --user +919999999999 --device-id 0123456789ab
Device Control
Send commands over Local UDP (offline, fast) or Cloud MQTT:
# Basic Local UDP control (Power, Temperature, Mode)
miraie-ac control --transport udp --ip 192.168.1.100 --device-id 0123456789ab \
--key "$MIRAIE_KEY" --iv "$MIRAIE_IV" --power on --temp 24 --mode cool
# Advanced feature control via Local UDP (Nanoe, Convertible Capacity, Horizontal Swing)
miraie-ac control --transport udp --ip 192.168.1.100 --device-id 0123456789ab \
--key "$MIRAIE_KEY" --iv "$MIRAIE_IV" \
--nanoe on --converti 70 --swing-h auto --display night --buzzer off
# Basic Cloud MQTT control
miraie-ac control --transport cloud --user +919999999999 --device-id 0123456789ab --power off
# Preset mode via Cloud MQTT (Eco, Boost, Clean)
miraie-ac control --transport cloud --user +919999999999 --device-id 0123456789ab --preset eco
My Python Libraries
| Library | PyPI Package | Description | Status |
|---|---|---|---|
| Panasonic AC Models | panasonic-ac-models |
Hardware profiles, capability lookup & IR protocol generator for Indian Panasonic ACs | Stable |
| IFB Washer Models | ifb-washer-models |
Unified hardware database, model lookup & cycle capability gating for IFB smart washers | Stable |
| MirAIe AC API Client | miraie-ac-in |
Async MQTT & REST API client for Panasonic MirAIe-connected Air Conditioners | Stable |
| Qubopy | qubopy |
Async client & CLI for Hero Qubo cameras, smart locks, air purifiers & smart home devices | Stable |
| PyAtomberg | pyatomberg |
Async client for Atomberg smart locks (BLE/Wi-Fi), ceiling fans & home appliances | Stable |
Credits & License
Contributors & Protocol Research
- Protocol Research & Initial Library: @rkzofficial, @deCodeIt, @gutpull, and @ankitduseja.
- Local UDP Protocol: @dtechterminal (ha-panasonic-miraie-local) for the initial reverse engineering of the local AES-256-CBC UDP protocol.
Maintenance & Development
- Lead Architecture & Hardware Testing: @selvakk2k — physical device telemetry capture, protocol analysis, and hardware verification.
- Code Implementation & Engineering: Antigravity (Google DeepMind) — asyncio local UDP transport, dynamic capabilities, resource management, and test suite.
- Automated Code Review: CodeRabbit (@coderabbitai) — automated pull request and pre-commit code reviews.
- Code Review & Auditing: Claude (Anthropic) — code auditing and verification.
Licensed under the MIT License. See the LICENSE file for details.
Metadata
Release files for miraie-ac-in 1.6.0
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 |
|---|---|---|---|---|
| miraie_ac_in-1.6.0.tar.gz | 37.0 kB | With provenance | Details for miraie_ac_in-1.6.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| miraie_ac_in-1.6.0-py3-none-any.whl | Python 3 | none | any | Details for miraie_ac_in-1.6.0-py3-none-any.whl |
Total release size: 75.9 kB
Release files / miraie_ac_in-1.6.0.tar.gz
| Download URL | miraie_ac_in-1.6.0.tar.gz |
|---|---|
| Size | 37.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
27efdd10f895d351c3b92a1894722e02a1720e37d3313179d3e7e7e5d1d5bd39
|
|
BLAKE2b-256 checksum How to use checksums |
8bb5d03902831c882f16c0547a7a5d028b36d762b20b6a7d4e537690a9ded534
|
| 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 Nov 27, 2026.
Transparency logRelease files / miraie_ac_in-1.6.0-py3-none-any.whl
| Download URL | miraie_ac_in-1.6.0-py3-none-any.whl |
|---|---|
| Size | 38.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
06e390a8d6443a1fb7d519bf42cb57210c2afac734469ecaf74c60a883e08af9
|
|
BLAKE2b-256 checksum How to use checksums |
e3e0a214ec6fb2021e1a0b8a90df95d114c06547fc5a3b2dca24daa6045a6000
|
| 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 Nov 27, 2026.
Transparency logSecurity for miraie-ac-in 1.6.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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for miraie_ac_in-1.6.0.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 Nov 27, 2026.
Transparency logA 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.