Skip to content

MQTT Bridge for controlling Cooper&Hunter smart air conditioners, e.g. with Home Assistant

License

Notifications You must be signed in to change notification settings

T-REX-XP/cooper_hunter-hvac-mqtt-bridge

 
 

Repository files navigation

Cooper&Hunter HVAC MQTT bridge

Bridge service for communicating with Cooper&Hunter(Ch-s09ftn-e2wf) Nordic evo 2 series air conditioners using MQTT broadcasts. It can also be used as a Hass.io addon.

Features

  • Supporting mqtt discovery
  • Supporting periodicaly retrieving the status of AC
  • Full support Home Assistant Addons ecosystem

Original app

Original Docs

How to Unpack

Requirements

  • NodeJS (>=8.9.3) with NPM
  • An MQTT broker and Cooper&Hunter smart HVAC device on the same network
  • Docker (for building Hass.io addon)

Running addon locally

Create an ./data/options.json file inside the repo with persistent addon configuration.

docker run --rm -v "$PWD/data":/data cooper_hunter-hvac-mqtt-bridge

    {
        "hvac_host": "192.168.107.49",
        "mqtt": {
            "broker_url": "mqtt:https://192.168.1.100",
            "topic_prefix": "home/chhvac"
        }
    }

Running locally

Make sure you have NodeJS (>=8.9.3) installed and run the following (adjust the arguments to match your setup):

npm install
node index.js \
    --hvac-host="192.168.107.49" \
    --mqtt-broker-url="mqtt:https://localhost" \
    --mqtt-topic-prefix="home/chhvac"

Hass.io addon

The service can be used as a 3rd party addon for the Hass.io MQTT climate platform.

  1. Install the addon
  2. Customize addon options (HVAC host, MQTT broker URL, MQTT topic prefix)
  3. Add the following to your configuration.yaml
climate:
  - platform: mqtt

    # Change to whatever you want
    name: CooperHunter HVAC

    # Change MQTT_TOPIC_PREFIX to what you've set in addon options
    current_temperature_topic: "home/chhvac/temperature_in/get"
    temperature_command_topic: "home/chhvac/temperature/set"
    temperature_state_topic: "home/chhvac/temperature/get"

    mode_state_topic: "MQTT_TOPIC_PREFIX/mode/get"
    mode_command_topic: "MQTT_TOPIC_PREFIX/mode/set"
    fan_mode_state_topic: "MQTT_TOPIC_PREFIX/fanspeed/get"
    fan_mode_command_topic: "MQTT_TOPIC_PREFIX/fanspeed/set"
    swing_mode_state_topic: "MQTT_TOPIC_PREFIX/swingvert/get"
    swing_mode_command_topic: "MQTT_TOPIC_PREFIX/swingvert/set"
    power_state_topic: "MQTT_TOPIC_PREFIX/power/get"
    power_command_topic: "MQTT_TOPIC_PREFIX/power/set"

    # Keep the following as is
    payload_off: 0
    payload_on: 1
    modes:
      - "none"
      - "off"
      - "auto"
      - "cool"
      - "heat"
      - "dry"
      - "fan_only"
    swing_modes:
      - "default"
      - "full"
      - "fixedTop"
      - "fixedMidTop"
      - "fixedMid"
      - "fixedMidBottom"
      - "fixedBottom"
      - "swingBottom"
      - "swingMidBottom"
      - "swingMid"
      - "swingMidTop"
      - "swingTop"
    fan_modes:
      - l0
      - l1
      - l2
      - l3
      - l4
      - l5
      - l6

Configuring HVAC WiFi

  1. Make sure your HVAC is running in AP mode. You can reset the WiFi config by pressing WIFI on the AC remote for 5s.
  2. Connect with the AP wifi network (the SSID name should e.g. "SMART_083X"), the passwork should be 88888888.

Changelog

[1.4.0] - added mqtt discovery, fix repository structure for the HA addon compatibility, fixed small isuses [1.2] - refresh sources from origin [1.1.2.1] - Updated sources from orig

[1.0.3] - Fixed power off command

[1.0.2] - Fixed modes and WindModes

[1.0.1] - Initial Cooper&Hunter support. (Read/Write temperature, read indooor temperature, read mode, on/off)

This project is licensed under the GNU GPLv3 - see the LICENSE.md file for details

Acknowledgments

About

MQTT Bridge for controlling Cooper&Hunter smart air conditioners, e.g. with Home Assistant

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 95.9%
  • Shell 3.4%
  • Dockerfile 0.7%