Skip to main content

Asynchronous Python library for Panasonic Comfort Cloud API

Project description

aio-panasonic-comfort-cloud

aio-panasonic-comfort-cloud: Asynchronous Python library for Panasonic Comfort Cloud API

This library provides asynchronous access to the Panasonic Comfort Cloud API, enabling developers to interact with Panasonic air conditioning units.

Installation

pip install aio-panasonic-comfort-cloud

Quick Start

Basic Usage

import asyncio
import aiohttp
from aio_panasonic_comfort_cloud import ApiClient

async def main():
    async with aiohttp.ClientSession() as session:
        client = ApiClient("your_email@example.com", "your_password", session)
        
        # Start the session (authenticate and fetch devices)
        await client.start_session()
        
        # Get list of devices
        devices = client.get_devices()
        
        for device_info in devices:
            print(f"Device: {device_info.name}")
            
            # Get full device status
            device = await client.get_device(device_info)
            params = device.parameters
            
            print(f"  Power:       {params.power.name}")
            print(f"  Mode:        {params.mode.name}")
            print(f"  Fan Speed:   {params.fan_speed.name}")
            print(f"  Target Temp: {params.target_temperature}°C")
            print(f"  Inside Temp: {params.inside_temperature}°C")
        
        # Clean up the session
        await client.stop_session()

asyncio.run(main())

Controlling a Device

Use ChangeRequestBuilder for a fluent API to build and apply changes:

from aio_panasonic_comfort_cloud import ApiClient, ChangeRequestBuilder, constants

# ... (start session as above)

device = await client.get_device(devices[0])

builder = ChangeRequestBuilder(device)
builder.set_power_mode(constants.Power.On)
builder.set_hvac_mode(constants.OperationMode.Cool)
builder.set_target_temperature(24)
builder.set_fan_speed(constants.FanSpeed.Auto)

if builder.has_changes:
    await client.set_device_raw(device, builder.build())

Available Enums

Category Values
Power Off, On
OperationMode Auto, Dry, Cool, Heat, Fan
FanSpeed Auto, Low, LowMid, Mid, HighMid, High
EcoMode Auto, Powerful, Quiet
AirSwingUD Auto, Up, UpMid, Mid, DownMid, Down, Swing
AirSwingLR Auto, Left, LeftMid, Mid, RightMid, Right, Unavailable
NanoeMode Unavailable, Off, On, ModeG, All

ChangeRequestBuilder Methods

  • set_power_mode(value) — Set power on/off
  • set_hvac_mode(value) — Set operation mode (cool, heat, etc.)
  • set_target_temperature(value) — Set target temperature in °C
  • set_fan_speed(value) — Set fan speed
  • set_eco_mode(value) — Set eco mode
  • set_horizontal_swing(value) — Set horizontal air swing
  • set_vertical_swing(value) — Set vertical air swing
  • set_nanoe_mode(value) — Set Nanoe mode
  • set_eco_navi_mode(value) — Set EcoNavi mode
  • set_eco_function_mode(value) — Set EcoFunction mode

Getting Energy History

from datetime import date
from aio_panasonic_comfort_cloud import constants

today = date.today().strftime("%Y%m%d")
history = await client.history(device_info.id, constants.DataMode.Day, today)

2FA / MFA Support

If your account has two-factor authentication enabled, pass the OTP code:

await client.start_session(otp_code="123456")

Full Example

See example.py for a complete working example.

License

MIT

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

aio_panasonic_comfort_cloud-2026.6.2.tar.gz (32.3 kB view details)

Uploaded Source

Built Distribution

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

aio_panasonic_comfort_cloud-2026.6.2-py3-none-any.whl (33.4 kB view details)

Uploaded Python 3

File details

Details for the file aio_panasonic_comfort_cloud-2026.6.2.tar.gz.

File metadata

File hashes

Hashes for aio_panasonic_comfort_cloud-2026.6.2.tar.gz
Algorithm Hash digest
SHA256 f1dfa7b305aaad6f73cb37a466686035201be46ae0af8c3851a6303ad2f237f9
MD5 70448088c658e4ccee8c2648a1e4809b
BLAKE2b-256 05e3a296f9081e10d735b035447863900780cc841c86a524a3ace994faedbf1b

See more details on using hashes here.

Provenance

The following attestation bundles were made for aio_panasonic_comfort_cloud-2026.6.2.tar.gz:

Publisher: python-publish.yml on sockless-coding/aio-panasonic-comfort-cloud

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file aio_panasonic_comfort_cloud-2026.6.2-py3-none-any.whl.

File metadata

File hashes

Hashes for aio_panasonic_comfort_cloud-2026.6.2-py3-none-any.whl
Algorithm Hash digest
SHA256 023817cef0070ea08caeaff2e847b8d146f38910a25fd3407976edea3fc51f48
MD5 7eec3bfcd4131f49b709933b28ecc059
BLAKE2b-256 2e3cdea1ef35260bf9e41058ecc9d21bffe3858ca9fc511ab817c0f11a130632

See more details on using hashes here.

Provenance

The following attestation bundles were made for aio_panasonic_comfort_cloud-2026.6.2-py3-none-any.whl:

Publisher: python-publish.yml on sockless-coding/aio-panasonic-comfort-cloud

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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