Skip to content

Add Panasonic Window Air Conditioner (Hong Kong/Macau) integration#172642

Draft
sam0737 wants to merge 1 commit into
home-assistant:devfrom
sam0737:panasonic_window_ac_hk
Draft

Add Panasonic Window Air Conditioner (Hong Kong/Macau) integration#172642
sam0737 wants to merge 1 commit into
home-assistant:devfrom
sam0737:panasonic_window_ac_hk

Conversation

@sam0737
Copy link
Copy Markdown

@sam0737 sam0737 commented May 31, 2026

Breaking change

Proposed change

Adds a new integration, panasonic_window_ac_hk, to control Panasonic window / through-the-wall air conditioners sold in Hong Kong and Macau (the CW-HU, CW-HZ, CW-SU, and CW-SUL families) over the existing infrared platform.

Product page of Panasonic HK: https://www.panasonic.hk/en/categories/living/ventilation-air-conditioning/window-air-conditioner/

Because infrared is one-way (fire-and-forget, no feedback channel), the integration uses assumed state and restores the last known state across restarts via RestoreEntity. The IR frames are built from a description of the reverse-engineered Panasonic CW protocol (~38 kHz carrier, pulse-distance, LSB-first; 27-byte full state frame plus short Quiet/Powerful frames).

It provides the following entities, grouped under a single device:

  • Climate: power, HVAC mode (off/auto/cool/dry/heat), target temperature (16–30 °C in 0.5 °C steps), fan speed, and swing (auto/fixed).
  • Switch: nanoeX (re-sends the full state frame).
  • Buttons: Quiet and Powerful (momentary short-frame toggles).

The integration requires an existing infrared emitter entity (for example, an ESPHome device with an IR LED) and is configured via the config flow by selecting that emitter. Targets the Bronze quality scale. Reverse-engineered and verified on a CW-HU70ZA controlling a real unit.

Type of change

  • Dependency upgrade
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • I understand the code I am submitting and can explain how it works.
  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • I have followed the perfect PR recommendations
  • The code has been formatted using Ruff (ruff format homeassistant tests)
  • Tests have been added to verify that the new code works.
  • Any generated code has been carefully reviewed for correctness and compliance with project standards.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies a diff between library versions and ideally a link to the changelog/release notes is added to the PR description.

To help with the load of incoming pull requests:

Made with Cursor

New `panasonic_window_ac_hk` integration controlling Panasonic window /
through-the-wall air conditioners sold in Hong Kong and Macau (CW-HU / CW-HZ /
CW-SU / CW-SUL families) over the `infrared` platform.

- Config flow selects an infrared emitter entity and names the unit.
- Climate entity (modes, 0.5 C target temperature, fan, swing), a nanoeX switch,
  and Quiet/Powerful buttons share assumed state via runtime_data.
- Pure-Python protocol encoder (reverse-engineered, verified on a CW-HU70ZA)
  emits infrared_protocols Command timings.
- Bronze quality scale; tests cover the config flow, setup/unload and all platforms.

Co-authored-by: Cursor <cursoragent@cursor.com>
Copilot AI review requested due to automatic review settings May 31, 2026 06:30
Copy link
Copy Markdown
Contributor

@home-assistant home-assistant Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @sam0737

It seems you haven't yet signed a CLA. Please do so here.

Once you do that we will be able to review and accept this pull request.

Thanks!

@home-assistant
Copy link
Copy Markdown
Contributor

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍

Learn more about our pull request process.

Copy link
Copy Markdown
Contributor

@home-assistant home-assistant Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When adding new integrations, limit included platforms to a single platform. Please reduce this PR to a single platform. See the review process for more details.

Copy link
Copy Markdown
Member

@joostlek joostlek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello 👋🏻,

Thank you for opening a PR. A few things to keep in mind:

  1. The initial PR should only have a single platform
  2. Device specific logic should exist on a library hosted on PyPI

@home-assistant home-assistant Bot marked this pull request as draft May 31, 2026 09:28
@sam0737
Copy link
Copy Markdown
Author

sam0737 commented May 31, 2026

Hello 👋🏻,

Thank you for opening a PR. A few things to keep in mind:

  1. The initial PR should only have a single platform
  2. Device specific logic should exist on a library hosted on PyPI

I'm new to home-assistant project, I guess you want me to refactor the IR logic out from here, and create a PR for https://github.com/home-assistant-libs/infrared-protocols, right?

And then I should make 3 separated PR to integrate that into Climate/Switch/Button platform.

Am I right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants