Git Product home page Git Product logo

pymelcloud's Introduction

pymelcloud

This is a package for interacting with MELCloud and Mitsubishi Electric devices. It's still a little rough all around and the documentation is a joke.

Supported devices

  • Air-to-air heat pumps (DeviceType=0)
  • [WIP] Air-to-water heat pumps (DeviceType=1)

Read

Reads access only locally cached state. Call device.update() to fetch the latest state.

Available properties:

  • name
  • mac
  • serial
  • units - model info of related units.
  • temp_unit
  • last_seen
  • power

Other properties are available through _ prefixed state objects if one has the time to go through the source.

Air-to-air heat pump properties

  • room_temperature
  • target_temperature
  • target_temperature_step
  • target_temperature_min
  • target_temperature_max
  • operation_mode
  • available operation_modes
  • fan_speed
  • available fan_speeds
  • vane_horizontal
  • available vane_horizontal_positions
  • vane_vertical
  • available vane_vertical_positions
  • total_energy_consumed in kWh. See notes below.

Air-to-water heat pump properties

  • tank_temperature
  • target_tank_temperature
  • tank_temperature_min
  • tank_temperature_max
  • outside_temperature
  • zones
    • name
    • state
    • room_temperature
    • target_temperature
  • state
  • operation_mode
  • available operation_modes

Energy consumption

The energy consumption reading is a little strange. The API returns a value of 1.8e6 for my unit. Judging by the scale the unit is either kJ or Wh. However, neither of them quite fits.

  • Total reading in kJ matches better what I would expect based on the energy reports in MELCloud.
  • In Wh the reading is 3-5 times greater than what I would expect, but the reading is increasing at a rate that seems to match energy reports in MELCloud.

Here are couple of readings with monthly reported usage as reference:

  • 2020-01-04T23:42:00+02:00 - 1820400, 28.5 kWh
  • 2020-01-05T09:44:00+02:00 - 1821300, 29.4 kWh
  • 2020-01-05T10:49:00+02:00 - 1821500, 29.6 kWh

I'd say it's pretty clear that it is Wh and the total reading is not reflective of unit lifetime energy consumption. total_energy_consumed converts Wh to kWh.

Write

Writes are applied after a debounce and update the local state once completed. The physical device does not register the changes immediately due to the 60 second polling interval.

Writable properties are:

  • power

Air-to-air heat pump write

  • target_temperature
  • operation_mode
  • fan_speed
  • vane_horizontal
  • vane_vertical

There's weird behavior associated with the horizontal vane swing. Toggling it on will also toggle vertical swing on and the horizontal swing has to be disabled before vertical vanes can be adjusted to any other position. This behavior can be replicated using the MELCloud user inteface.

Air-to-water heat pump write

  • target_tank_temperature
  • operation_mode
  • zone_1_target_temperature
  • zone_2_target_tempeature

Zone target temperatures can also be set via the Zone object returned by zones property on AtwDevice.

Example usage

>>> import pymelcloud
>>> token = await pymelcloud.login("[email protected]", "password")
>>> devices = await pymelcloud.get_devices(token)
>>> device = devices[pymelcloud.DEVICE_TYPE_ATA][0]
>>> await device.update()
>>> device.name
'Heat Pump 1'
>>> device.target_temperature
21.0
>>> device.set({"target_temperature": 21.5})
>>> >>> device.target_temperature
21.5

pymelcloud's People

Contributors

vilppuvuorinen 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.