Skip to main content

Control and monitor Mitsubishi Air Conditioners

Project description

PyMitsubishi

PyPI version Python Versions Downloads License: MIT

A Python library for controlling and monitoring Mitsubishi MAC-577IF-2E air conditioners.

Features

  • Device Control: Power, temperature, mode, fan speed, and vane direction control
  • Status Monitoring: Real-time device status, temperatures, and error states
  • Capability Detection: Dynamic detection of device capabilities using ProfileCode analysis
  • Group Code Analysis: Advanced protocol analysis for enhanced device understanding
  • Encryption Support: Full support for Mitsubishi's encryption protocol

Installation

pip install pymitsubishi

Quick Start

from pymitsubishi import MitsubishiAPI, MitsubishiController

# Initialize the API and controller
api = MitsubishiAPI(device_ip="192.168.1.100")
controller = MitsubishiController(api=api)

# Fetch device status
if controller.fetch_status():
    summary = controller.get_status_summary()
    print(f"Power: {summary['power']}")
    print(f"Temperature: {summary['target_temp']}°C")
    print(f"Mode: {summary['mode']}")

# Control the device
controller.set_power(True)
controller.set_temperature(24.0)
controller.set_mode(DriveMode.COOLER)

# Clean up
api.close()

Advanced Usage

Capability Detection

from pymitsubishi import CapabilityDetector

detector = CapabilityDetector(api=api)
capabilities = detector.detect_all_capabilities(debug=True)

# Check specific capabilities
if capabilities.has_capability(CapabilityType.OUTDOOR_TEMPERATURE_SENSOR):
    print("Device has outdoor temperature sensor")

# Save capabilities for later use
detector.save_capabilities("device_capabilities.json")

ProfileCode Analysis

The library automatically analyzes ProfileCode data from device responses to detect capabilities and device characteristics:

# Fetch status with capability detection
controller.fetch_status(detect_capabilities=True)

# Access detected capabilities
summary = controller.get_status_summary()
if 'capabilities' in summary:
    for cap_name, cap_info in summary['capabilities'].items():
        print(f"{cap_name}: {cap_info['supported']}")

API Reference

MitsubishiAPI

Core communication class handling encryption and HTTP requests.

MitsubishiController

High-level control interface for device operations.

CapabilityDetector

Advanced capability detection using ProfileCode and group code analysis.

Data Classes

  • PowerOnOff: Power state enumeration
  • DriveMode: Operating mode enumeration
  • WindSpeed: Fan speed enumeration
  • VerticalWindDirection, HorizontalWindDirection: Vane direction enumerations

Requirements

  • Python 3.12+
  • requests
  • pycryptodome

License

MIT License - see LICENSE file for details.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pymitsubishi-0.1.7.tar.gz (31.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pymitsubishi-0.1.7-py3-none-any.whl (34.9 kB view details)

Uploaded Python 3

File details

Details for the file pymitsubishi-0.1.7.tar.gz.

File metadata

  • Download URL: pymitsubishi-0.1.7.tar.gz
  • Upload date:
  • Size: 31.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pymitsubishi-0.1.7.tar.gz
Algorithm Hash digest
SHA256 ed85af77e62d9839f4d286b703b37c5bf996ca3f78753b1c2ece75f8746f6390
MD5 d5d3c699fd3f93531457be9af9539f9b
BLAKE2b-256 91d28e382cd9c57156872b9dc1cdf8203dc126e449d40e9de4cc269cadd3e1f3

See more details on using hashes here.

File details

Details for the file pymitsubishi-0.1.7-py3-none-any.whl.

File metadata

  • Download URL: pymitsubishi-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 34.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pymitsubishi-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 299010c8a425e3df1dedeef6750d9ed9b99a830428e1b8579f81e9aa396d8b86
MD5 c9d68ecc79092135a6a0843330e5e879
BLAKE2b-256 8b0c76c1aaa9c694af468d0b6111e32886a7196633f89c4c5547783df0ff8fb6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page