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.0.tar.gz (91.6 kB view details)

Uploaded Source

Built Distribution

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

File details

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

File metadata

File hashes

Hashes for aio_panasonic_comfort_cloud-2026.6.0.tar.gz
Algorithm Hash digest
SHA256 57c1f32470bb14b3a09c07be5a3a33e11bcaac0c0365ae6e9cbc4a0054c892f0
MD5 8c65fad47b14ed886d132ee2b4b15c2b
BLAKE2b-256 1985e69aea724ccb3fe0a4a557050780c943ce27a0c6d42640bb4d4dc55306d0

See more details on using hashes here.

Provenance

The following attestation bundles were made for aio_panasonic_comfort_cloud-2026.6.0.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.0-py3-none-any.whl.

File metadata

File hashes

Hashes for aio_panasonic_comfort_cloud-2026.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1182176c2b6c6909ef473be296476bcede6f318dc2381d541bfc592ad19a7475
MD5 d3f29fde390b7734de54c9b7f817104a
BLAKE2b-256 19285bda2ec5555ea23519428af533b2fe9d57de5a9b69b3ff99e2a32ca83542

See more details on using hashes here.

Provenance

The following attestation bundles were made for aio_panasonic_comfort_cloud-2026.6.0-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