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.1.tar.gz (30.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.1.tar.gz.

File metadata

File hashes

Hashes for aio_panasonic_comfort_cloud-2026.6.1.tar.gz
Algorithm Hash digest
SHA256 edadf65610ae3ba3288cd552df62433333e44510f3b282c7a29cca5e14d35d9f
MD5 229ccd4de9673a4c976a6205bc5621d6
BLAKE2b-256 7ed7322b3d516e956b31838970611812b30b5b427ff3c96752270be74225deb2

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for aio_panasonic_comfort_cloud-2026.6.1-py3-none-any.whl
Algorithm Hash digest
SHA256 69b21221966a3d604722be968c90c5c2f712dcd53e8c27de41054db72d15d52a
MD5 1122bf02d1df532d8f56925da509eed6
BLAKE2b-256 56264697bbc26cbf61f282e6f7877a1b51c953cb41aae2209c5ec36136319769

See more details on using hashes here.

Provenance

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