Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PanaAC v2 — Home Assistant custom integration for controlling Panasonic AC via Infrared

hacs_badge

This project is maintained in my free time. A coffee ☕ is always appreciated!

"Buy Me A Coffee"


Together with PanaAC_v2_ESPHome, this custom integration is part of second generation of PanaAC_ESPHome. It addresses the earlier UI limitation of separate fan-level, vertical-swing, and horizontal-swing selects:

  • PanaAC v1 exposes separate fan-level, vertical-swing, and horizontal-swing selects alongside the climate entity in the ESPHome device.

    PanaAC v1
  • PanaAC v2 combines those controls in the climate entity through the PanaAC_v2_HA integration, providing a cleaner climate-card UI. The native (v1) climate and selects remain available by default; in v2 MQTT mode, set hide_legacy_comps: true to hide them from Home Assistant and use only the PanaAC v2 climate entity.

    PanaAC v2 PanaAC v2


This is an MQTT-driven custom integration that exposes a Panasonic AC controller (built with PanaAC_v2_ESPHome) as a native Home Assistant ClimateEntity.

In this workspace, the custom PanaAC v2 repositories now live under panaac_v2/, and the consolidated shared test workspace is ../PanaAC_v2_Testing.

This integration intentionally avoids the ESPHome native API and the limited climate_ir fan/swing enums. Instead it uses plain MQTT topics, so the climate card can show the full Panasonic fan levels (Auto, Level 1..5, Quiet), vertical swing positions (Auto, Highest, High, Middle, Low, Lowest), and a separate horizontal swing axis (Auto, Left Max, Left, Middle, Right, Right Max).

How it works

The ESPHome device publishes:

  • <topic_prefix>/availabilityonline / offline (retained)
  • <topic_prefix>/traits — supported modes, ranges, temp step (retained)
  • <topic_prefix>/state — current mode, target temp, fan, swing, horizontal swing (retained)

The integration subscribes to those topics and publishes commands to:

  • <topic_prefix>/set

Command payloads are partial JSON, e.g. {"fan_mode": "Level 2"}. The device applies only the supplied fields.

Installation

Option 1: HACS (recommended)

  1. Ensure HACS is installed.
  2. Open HACS and go to Integrations.
  3. Click the menu (⋮) and select Custom repositories.
  4. Add https://github.com/hoangminh1109/PanaAC_v2_HA with category Integration.
  5. Install PanaAC v2 (MQTT).
  6. Restart Home Assistant.
  7. Add the integration via Settings → Devices & Services → Add Integration → PanaAC v2 (MQTT).
  8. Enter the MQTT topic prefix configured in the ESPHome YAML (panaac_v2/esphome-panaac-v2 by default).

Option 2: Manual

  1. Make sure the Home Assistant MQTT integration is configured and pointed at the same broker used by the ESPHome device.
  2. Copy or symlink custom_components/panaac_v2/ into your Home Assistant config/custom_components/ directory.
  3. Restart Home Assistant.
  4. Add the integration via Settings → Devices & Services → Add Integration → PanaAC v2 (MQTT).
  5. Enter the MQTT topic prefix configured in the ESPHome YAML (panaac_v2/esphome-panaac-v2 by default).

Files

custom_components/panaac_v2/
  __init__.py      — entry setup, forwards to climate platform
  climate.py       — the ClimateEntity + MQTT subscriptions
  config_flow.py   — config flow (topic prefix)
  const.py         — domain and config keys
  manifest.json    — integration metadata
  strings.json     — UI strings
  translations/en.json

Notes

  • The integration depends on the built-in mqtt integration ("dependencies": ["mqtt"]).
  • Trait messages are retained, so the climate card gets the correct supported modes shortly after HA starts even if the device is currently quiet on the state topic.

Automation examples

The entity exposes hvac_action, so the climate building-block triggers and conditions work (started_cooling, is_cooling, …). These follow the current Home Assistant YAML style — triggers:/conditions:/actions: lists with trigger:/condition:/action: keys (the modern names for the legacy platform:/service:). Replace climate.living_room with your entity id.

Trigger — thermostat started cooling

triggers:
  - trigger: climate.started_cooling
    target:
      entity_id: climate.living_room
    options:
      behavior: each        # each | first | all (default each)
      for: "00:00:00"        # fires immediately by default

Condition — thermostat is cooling (gated behind a state change)

triggers:
  - trigger: state
    entity_id: climate.living_room
    attribute: hvac_action
    to: cooling
conditions:
  - condition: climate.is_cooling
    target:
      entity_id: climate.living_room
    options:
      behavior: any          # any | all (default any)

Actions — set mode, target temperature, fan, swing

actions:
  - action: climate.set_hvac_mode
    target:
      entity_id: climate.living_room
    data:
      hvac_mode: cool        # off | cool | heat | fan_only | dry | auto

  - action: climate.set_temperature
    target:
      entity_id: climate.living_room
    data:
      temperature: 24
      hvac_mode: cool        # optional; keeps the current mode if omitted

  - action: climate.set_fan_mode
    target:
      entity_id: climate.living_room
    data:
      fan_mode: "Level 2"    # Auto | Level 1..5 | Quiet | Powerful

  - action: climate.set_swing_mode
    target:
      entity_id: climate.living_room
    data:
      swing_mode: Middle     # Auto | Highest | High | Middle | Low | Lowest

  - action: climate.set_swing_horizontal_mode
    target:
      entity_id: climate.living_room
    data:
      swing_horizontal_mode: Left   # Auto | Left Max | Left | Middle | Right | Right Max

turn_on / turn_off / toggle take only target: (no data:) and appear once the device advertises more than one HVAC mode that includes off.

More documentation

  • DESIGN.md — architecture, MQTT topic contract, HA entity design.
  • INSTALL.md — step-by-step installation, broker setup and troubleshooting.

AI GENERATED CONTENTS

  • This PanaAC v2 project is vibe coded with the help of AI Agents (Codex & Claude), using various models cross checked each other - gpt 5.5, gpt 5.6, opus 4.6, glm 5.2, minimax-m3, kimi-k2.7-code).

About

Home Assistant custom integration for controlling Panasonic AC via IR, coupling with ESPHome device PanaAC_v2_ESPHome.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages