Skip to content

[mitsubishi_cn105] Add climate component for Mitsubishi A/C units with CN105 connector#14979

Closed
crnjan wants to merge 24 commits intoesphome:devfrom
crnjan:feature/mitsubishi_cn105
Closed

[mitsubishi_cn105] Add climate component for Mitsubishi A/C units with CN105 connector#14979
crnjan wants to merge 24 commits intoesphome:devfrom
crnjan:feature/mitsubishi_cn105

Conversation

@crnjan
Copy link
Copy Markdown
Contributor

@crnjan crnjan commented Mar 19, 2026

Description

Adds support for Mitsubishi A/C units using the CN105 connector.

It is an independent implementation of the protocol used in i.e. the SwiCago HeatPump project, developed from scratch, while supporting the same devices. The driver is designed to be non-blocking, with a focus on performance and reliability.

The initial version was originally developed for ESPEasy (PR) and has since been adapted and refactored for ESPHome.

Supported features (initial version)

  • Target temperature control
  • Current temperature reporting
  • HVAC modes (heat/cool/auto/dry/fan_only/off)
  • Fan modes:
    • auto
    • quiet
    • low
    • medium
    • middle
    • high

Notes

  • Communication is done over UART (CN105 connector).
  • Supported baud rates are 2400 or 9600, depending on the A/C unit.
  • This PR focuses on a minimal, stable feature set; some functionality (such as vane and wide vane control) has been intentionally omitted and may be added in follow-up PRs.
  • Mitsubishi units expose multiple intermediate fan speed levels. These are mapped to ESPHome fan modes, including both medium and middle, which represent distinct speeds.
  • The update interval determines how quickly the UI reflects external changes (e.g. when operating the unit via IR remote). It can be set as low as needed; the default is 1s. During testing, a 500ms update interval provided near-instant feedback and remained stable over several days.
  • While several community implementations and approaches for CN105 exist, ESPHome currently does not provide an official integration.

Testing

Tested on:

  • ESP8266

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected) — policy
  • Developer breaking change (an API change that could break external components) — policy
  • Undocumented C++ API change (removal or change of undocumented public methods that lambda users may depend on) — policy
  • Code quality improvements to existing code or addition of tests
  • Other

Pull request in esphome-docs with documentation:

Test Environment

  • ESP32
  • ESP32 IDF
  • ESP8266
  • RP2040/RP2350
  • BK72xx
  • RTL87xx
  • LN882x
  • nRF52840

Example entry for config.yaml:

uart:
  id: ac_uart
  tx_pin: GPIO1
  rx_pin: GPIO3
  baud_rate: 2400
  parity: EVEN

climate:
  - platform: mitsubishi_cn105
    name: "Air Condition"
    uart_id: ac_uart
    update_interval: 1s

Checklist:

  • The code change is tested and works locally.
  • Tests have been added to verify that the new code works (under tests/ folder).

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

@github-actions
Copy link
Copy Markdown
Contributor

To use the changes from this PR as an external component, add the following to your ESPHome configuration YAML file:

external_components:
  - source: github://pr#14979
    components: [mitsubishi_cn105]
    refresh: 1h

(Added by the PR bot)

esphome[bot]
esphome bot previously requested changes Mar 19, 2026
Copy link
Copy Markdown

@esphome esphome bot left a comment

Choose a reason for hiding this comment

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

📦 Pull Request Size

This PR is too large with 1202 line changes (excluding tests). Please consider breaking it down into smaller, focused PRs to make review easier and reduce the risk of conflicts.

For guidance on breaking down large PRs, see: https://developers.esphome.io/contributing/submitting-your-work/#how-to-approach-large-submissions

@esphome
Copy link
Copy Markdown

esphome bot commented Mar 19, 2026

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.

@esphome esphome bot marked this pull request as draft March 19, 2026 19:45
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Mar 19, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.44%. Comparing base (a3913b9) to head (824f2d6).

Additional details and impacted files
@@           Coverage Diff           @@
##              dev   #14979   +/-   ##
=======================================
  Coverage   75.44%   75.44%           
=======================================
  Files          55       55           
  Lines       12166    12166           
  Branches     1683     1683           
=======================================
  Hits         9179     9179           
  Misses       2568     2568           
  Partials      419      419           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@crnjan crnjan marked this pull request as ready for review March 19, 2026 21:55
@esphome esphome bot dismissed their stale review March 19, 2026 21:55

Stale

@crnjan crnjan marked this pull request as draft March 20, 2026 07:14
esphome[bot]
esphome bot previously requested changes Mar 20, 2026
Copy link
Copy Markdown

@esphome esphome bot left a comment

Choose a reason for hiding this comment

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

📦 Pull Request Size

This PR is too large with 1058 line changes (excluding tests). Please consider breaking it down into smaller, focused PRs to make review easier and reduce the risk of conflicts.

For guidance on breaking down large PRs, see: https://developers.esphome.io/contributing/submitting-your-work/#how-to-approach-large-submissions

@esphome esphome bot dismissed their stale review March 20, 2026 08:15

Review dismissed: All requirements have been met

@esphome esphome bot removed the too-big label Mar 20, 2026
@crnjan crnjan changed the title [mitsubishi_cp105] Add climate component for Mitsubishi A/C units with CN105 connector [mitsubishi_cn105] Add climate component for Mitsubishi A/C units with CN105 connector Mar 20, 2026
@crnjan crnjan marked this pull request as ready for review March 20, 2026 16:41
@esphome esphome bot removed the needs-docs label Mar 20, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 16 out of 16 changed files in this pull request and generated 4 comments.

@crnjan
Copy link
Copy Markdown
Contributor Author

crnjan commented Mar 30, 2026

I’m splitting the PR into smaller chunks to simplify review — leaving this here for completeness. Also marked as draft so it’s not reviewed twice.

@j9brown
Copy link
Copy Markdown
Contributor

j9brown commented Mar 30, 2026

Splitting it sounds like a good idea. I can imagine the first patch would just connect to the device and perform some basic enumeration of its capabilities, for example. And later patched can layer on the control functions.

@nagyrobi
Copy link
Copy Markdown
Member

Place a link here to the new PR for the ones arriving here to know where to go

@crnjan
Copy link
Copy Markdown
Contributor Author

crnjan commented Mar 31, 2026

The split PRs do not yet provide meaningful functionality, so for anyone who wants to test, please use this PR. I’ll share updates here as well.

Copy link
Copy Markdown

@esphome esphome bot left a comment

Choose a reason for hiding this comment

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

📦 Pull Request Size

This PR is too large with 1006 line changes (excluding tests). Please consider breaking it down into smaller, focused PRs to make review easier and reduce the risk of conflicts.

For guidance on breaking down large PRs, see: https://developers.esphome.io/contributing/submitting-your-work/#how-to-approach-large-submissions

@esphome esphome bot added the too-big label Mar 31, 2026
@crnjan
Copy link
Copy Markdown
Contributor Author

crnjan commented Mar 31, 2026

@mdegat01 — I’ve added a use_fahrenheit_conversion option. Feel free to give it a try and let me know how it works for you. I don’t use Fahrenheit myself, so it hasn’t been tested in a real setup. Removing it or setting it to false should restore the previous behavior.

As always, testing bleeding-edge changes can occasionally lead to issues (e.g. I recently hit an infinite boot loop with VERY_VERBOSE logging), so a manual reflash might be needed in the worst case — which can be a bit annoying when the device is mounted inside the AC.

@nagyrobi
Copy link
Copy Markdown
Member

nagyrobi commented Apr 5, 2026

With Part3 merged, is it all in? Or any more to submit?

@crnjan
Copy link
Copy Markdown
Contributor Author

crnjan commented Apr 5, 2026

With Part3 merged, is it all in? Or any more to submit?

Part 3 includes reading of temp (room & current), part 4 will add mode and fan (read only) and part 5 set operations.

If anybody can confirm if use_fahrenheit_conversion works (included in this PR) I would include that as well in the "offical" PRs.

@crnjan
Copy link
Copy Markdown
Contributor Author

crnjan commented Apr 6, 2026

Aside from use_fahrenheit_conversion, the current dev branch now contains the same functionality as this PR, so I’m closing it.

@crnjan crnjan closed this Apr 6, 2026
@nagyrobi
Copy link
Copy Markdown
Member

nagyrobi commented Apr 7, 2026

Since this PR will soon be locked to comments as it was closed, here's a discussions topic as follow up: https://github.com/orgs/esphome/discussions/3609

@esphome esphome bot added the by-code-owner label Apr 7, 2026
@github-actions github-actions bot locked and limited conversation to collaborators Apr 8, 2026
@crnjan crnjan deleted the feature/mitsubishi_cn105 branch April 8, 2026 10:42
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants