A fully async Python client for the Panasonic Comfort Cloud API, designed to integrate seamlessly into Home Assistant and other asyncio-based applications.
Key Features
Full device control — power, mode (auto / cool / heat / dry / fan), target temperature, fan speed, eco modes, air swing, and Nanoe settings
Fluent
ChangeRequestBuilderAPI for building and applying changes with minimal codeEnergy history queries by day or month
2FA / MFA support — pass an OTP code when starting a session
Built on
aiohttpfor efficient async I/O
Installation
pip install aio-panasonic-comfort-cloudQuick Start
Authenticate, fetch your devices, and inspect their current state:
import asyncio
import aiohttp
from aio_panasonic_comfort_cloud import ApiClient
async def main():
async with aiohttp.ClientSession() as session:
client = ApiClient("you@example.com", "your_password", session)
await client.start_session() # add otp_code="123456" if 2FA is enabled
for device_info in client.get_devices():
print(f"Device: {device_info.name}")
device = await client.get_device(device_info)
params = device.parameters
print(f" Power: {params.power.name}")
print(f" Mode: {params.mode.name}")
print(f" Target Temp: {params.target_temperature}°C")
await client.stop_session()
asyncio.run(main())Controlling a Device
Use the fluent builder to change settings:
from aio_panasonic_comfort_cloud import ChangeRequestBuilder, constants
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())Built for Home Assistant
This library is designed as the foundation for a Panasonic Comfort Cloud integration in Home Assistant. It's lightweight (only aiohttp as a dependency) and provides strongly-typed data classes that map directly to HVAC entity states.
Available Enums
The API exposes typed enums for all controllable parameters:
Power — Off, On
OperationMode — Auto, Dry, Cool, Heat, Fan
FanSpeed — Auto, Low, LowMid, Mid, HighMid, High
EcoMode — Auto, Powerful, Quiet
AirSwingUD — Up / Down swing positions and Swing
AirSwingLR — Left / Right swing positions
NanoeMode — Off, On, ModeG, All