Giter Club home page Giter Club logo

heatpump's Introduction

Join the chat at https://gitter.im/Mitsubishi-Heat-Pump

HeatPump

Arduino library to control Mitsubishi Heat Pumps via connector CN105.

Quick start

Controlling the heat pump

HeatPump hp;
hp.connect(&Serial);

heatpumpSettings settings = {
    "ON",  /* ON/OFF */
    "FAN", /* HEAT/COOL/FAN/DRY/AUTO */
    26,    /* Between 16 and 31 */
    "4",   /* Fan speed: 1-4, AUTO, or QUIET */
    "3",   /* Air direction (vertical): 1-5, SWING, or AUTO */
    "|"    /* Air direction (horizontal): <<, <, |, >, >>, <>, or SWING */
}; 

hp.setSettings(settings);
// OR individual settings
// hp.setModeSetting("COOL");

hp.update();

See heatPump_test.ino

You can make the library automatically send new settings to the heat pump by calling enableAutoUpdate(). When auto update is enabled the call to update() in the above example is not necessary, the new settings will be sent to the heat pump on the next call to sync() in loop().

Getting updates from the heat pump

void setup() {
  HeatPump hp;
  hp.connect(&Serial);
}

void loop() {
  hp.sync();

  /* get settings from heatpump, including room temperature in settings.roomTemperature */
  heatpumpSettings settings = hp.getSettings();
}

By default the library ignores changes made from other sources (usually, the IR remote) and reverts them the next time sync() is called. This is the intendend behavior when the heat pump is fully controlled by automation.

If you want to also allow manual control and allow the library to update its settings from the current state of the heat pump you need to call enableExternalUpdate(). This will also enable automatic updates.

Callbacks

Instead of manually checking settings changes on each loop, you can set callback functions to be called when the current heat pump status or settings change:

void hpSettingsChanged() {
  // ...
}

void hpStatusChanged(heatpumpStatus currentStatus) {
  // ...
}

void setup() {
  hp.setSettingsChangedCallback(hpSettingsChanged);
  hp.setStatusChangedCallback(hpStatusChanged);

  hp.connect(&Serial);
}

The callbacks will be called as necessary by the sync() method.

You can see this in use in the MQTT example.

Contents

  • sources
  • sample usage code
  • Demo circuit using ESP-01

Installation

Notes

  • Tested with ESP8266
  • Tested with Arduino Micro Pro / Arduino Nano
  • Tested with Mitsubishi HeatPump MSZ-FH/GE(wall units) and SEZ-KD (ducted units) complete list

Demo Circuit

Parts

Parts required to make a CN105 female connector

Other part suggestions

Special thanks

... to Hadley in New Zealand. His blog post, describing baud rate and details of cn105, Raspberry Pi Python code:

https://nicegear.co.nz/blog/hacking-a-mitsubishi-heat-pump-air-conditioner/

Wayback machine link as the site no longer exists: https://web.archive.org/web/20171007190023/https://nicegear.co.nz/blog/hacking-a-mitsubishi-heat-pump-air-conditioner/

License

Licensed under the GNU Lesser General Public License. https://www.gnu.org/licenses/lgpl-3.0.txt

heatpump's People

Contributors

alekslyse avatar alexholman avatar berg avatar claybar avatar cmacnichol avatar david-yam avatar dgoodlad avatar dzungpv avatar emaijala avatar f43ry avatar geoffdavis avatar hawkefly avatar janjoh avatar jlynx avatar kayno avatar lekobob avatar micampe avatar miguelangel-nubla avatar moxified avatar nebukadneza avatar noblekangaroo avatar notlaforge avatar relevante avatar schotime avatar shampeon avatar swicago avatar unixko avatar unreality avatar uronito avatar yellowsub avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.