Mitsubishi MELCLOUD integration with Home Assistant

Wow! I pay for my climate 1300eur (which is quite expensive),and then you tell me that those guys are saving money? :smiley:

Same 1300ā‚¬ you were paying 2 years ago without wifiā€¦ Itā€™s a hvac, who cares If It takes 1 min, as it already takes few minutes to start heating or cooling. It works smooth, which is more important.

Hi,

Iā€™ve just got a new system installed and found melcloud. So far so amazing! I had a read of the problem with the power attribute. My system is small, only one zone, so I wonder if it would be practical to enable the power for such a system. At the moment it is 21Ā°C outside, the heating set point is 10Ā°C and Iā€™m not a big user of hot water. I want to be able to control when the unit is heating water (to make use of solar PV, reduce carbon intensity, not heat water when Iā€™m not around) but the only way to do that is using the MELcloud app. I cannot control the power on the climate entity, as described above.

How likely is it that a PR would be accepted which enables the power button when there is only one zone? My last HA PR was pretty painful (unresponsive maintainer and attempts to improve the code outside the scope of my bug fix) so Iā€™m asking firstā€¦

Thanks!
Bruce

Do you want to power off the whole unit? You should be able to do that by adding a button for the entity. It should work for both the zones and the water heater.

1 Like

Yes the whole unit. Ah, I see! I think I have got it: An input_boolean and four automations: two to switch the heat pump on/off when the button is toggled, two to update the state of the input_boolean when the state of the heat pump changes. Will test it tomorrow when the sun is shining (just kidding the sun doesnā€™t shine in Scotland apparentlyā€¦) Thanks! :smiley:

Hi,

I have Ecodan Air-To-Water Heatpump as well as two Air-To-Air pumps. There seems to be somekind of problem with updating the values of the temperature sensors from MelCloud. Currently values of Zone1 Flow temp is ā€œstuckā€ while in Melcloud own apps hourly graph you can see that they are changing. Zone 1 Flow temp is also showing incorrect 24 temperature while in Melcloud app it hasnā€™t gone so low at any point. Is there a way to debug MelCloud sensor retrieval somehow to be able to continue the debugging.

I thought I had already fixed this issue, but apparently I had not. The temperature is read from a wrong field and it therefore appears to be stuck. Iā€™ll try to get around to it this time.

2 Likes

@jakoleh Thereā€™s a PR open to fix this issue. Edit: The PR is merged. It will take a while until it gets cherry-picked and released tho.

In other news I (finally) managed to create a PR for adding ATW flow temperature control: https://github.com/home-assistant/core/pull/56099 Iā€™d really appreciate it if anyone with access to an ATW device could clone the PR and try running it from source. The dev env setup guide is a good resource for getting things running locally: Set up Development Environment | Home Assistant Developer Docs

And as always: Please donā€™t comment on the PR unless doing code review :pray:

@joth You might be interested in the above :point_up_2:

1 Like

I was able to setup development environment and MelCloud integration. What should be now tested?There is now two new heat flow entities (I have two zones). Is this intented? The new entities are somehow not usable. The information is duplicate and the temperature is not possible to set or change.

Other odd thing is that both zones are showing same temperature all the time for flow and flow return temps. Edit: both zones are now showing the internal flow and return temperature, instead of Flow/Flow return temperature Zone 1/2. Edit2: It would be nice to have those temperatures also visible, cause one can see that atw is working by looking those values.

This is intentional. The thermostats are duplicated for different control modes because the way MELCloud manages these makes it convenient to manage them as separate entities. Additionally it does not look like a device would transition between control modes too often in regular use. The reasoning here is that you should use only the climate entity of the control mode you are actually using and remove everything else form these dashboards. In your case Iā€™d assume it is heat flow versions that you want to keep around. The climate entity of the disabled control mode is presented as being turned off.

This whole setup is a bit weird, but I did try to put some thought into it. For example, any automations that would toggle a ATW devide between heat and cool could accidentally target the set point of the previous mode unless caution is taken. With the separate entities thereā€™s no chance for these weird race conditions and the targets of the actions are always clear.

The responses contain fields for zone specific flow temperatures, but they do not seem to be updated. The upstream version of home-assistant used to use these fields pymelcloud/tests/samples/atw_2zone_listdevice.json at 75c8aff664d6aad31e15f8bce1a626fb291ae3cc Ā· vilppuvuorinen/pymelcloud Ā· GitHub without much success. You can scroll the thread up to find the recent workarounds that use the internal flow temp.

You can compare the API responses in MELCloud and see if you can find the corresponding values.

Thereā€™s one curious detail in your screencap. Both of the upstairs climates appear to be off. This thing looks like a bug to me.

@vilppuvuorinen: The upstream version of home-assistant used to use these fields

It seems that in my system the upstream version values look quite the same as in MelCloud. It may be so, that my earlier comment about the values being wrong was, wrong.

image image

image
image

It seems that the new zone flow temp and return temp correspond to internal flow value.
image
image

I have the two zone kit installed to my system.

Anyone who wants to add the Mitsubishi to the energy dashboard. My device gives a (estimate) about the used energy after a day. I already had these code in sensor.yaml:

    dailyhotwaterenergyconsumed:
      value_template: "{{ state_attr('sensor.ecodan_cmd', 'DailyHotWaterEnergyConsumed') }}"
      unit_of_measurement: "kWh"
      unique_id: "ecodan_cmd_DailyHotWaterEnergyConsumed"
    dailyheatingenergyconsumed:
      value_template: "{{ state_attr('sensor.ecodan_cmd', 'DailyHeatingEnergyConsumed') }}"
      unit_of_measurement: "kWh"
      unique_id: "ecodan_cmd_DailyHeatingEnergyConsumed"

I added these code to customize.yaml to make it able to be in the energy dashboard. I gave it a 1 day offset so it appears on the right day (yesterday):
</s> <s>sensor.dailyhotwaterenergyconsumed:</s> <s> state_class: total_increasing</s> <s> device_class: energy</s> <s> friendly_name: "SWW energie"</s> <s> cycle: daily</s> <s> offset:</s> <s> days: 1</s> <s>sensor.dailyheatingenergyconsumed:</s> <s> state_class: total_increasing</s> <s> device_class: energy</s> <s> friendly_name: "Verwarmingsenergie"</s> <s> cycle: daily</s> <s> offset:</s> <s> days: 1</s> <s>
Now these sensors can be selected in the energy dashboard as individual devices:


Had my legionella run yesterday, thatā€™s why it used so much :wink:

Edit:
To be honest it works half. Sometimes the difference between days is shown, sometimes the correct stateā€¦?

Actually I had some help with this on tweakers.net and it works correctly now so I post it here as well to help others:
template.yaml:

- trigger:
    - platform: state
      entity_id: sensor.dailyhotwaterenergyconsumed
    - platform: homeassistant
      event: start
    - platform: event
      event_type: event_template_reloaded
  sensor:
    - name: dailyhotwaterenergyconsumed sum
      unique_id: 2a25a8ee-42e7-47c8-9abd-2144a125d086
      state: >
        {{ [ state_attr('sensor.stats', 'max_value') | float, states('sensor.dailyhotwaterenergyconsumed_sum') | float + states('sensor.dailyhotwaterenergyconsumed') | float] | max }}
      state_class: total_increasing
      device_class: energy
      unit_of_measurement: kWh
      icon: mdi:chart-line

- trigger:
    - platform: state
      entity_id: sensor.dailyheatingenergyconsumed
    - platform: homeassistant
      event: start
    - platform: event
      event_type: event_template_reloaded
  sensor:
    - name: dailyheatingenergyconsumed sum
      unique_id: 2a25a8ee-42e7-47c8-9abd-2144a125d886
      state: >
        {{ [ state_attr('sensor.stats', 'max_value') | float, states('sensor.dailyheatingenergyconsumed_sum') | float + states('sensor.dailyheatingenergyconsumed') | float] | max }}
      state_class: total_increasing
      device_class: energy
      unit_of_measurement: kWh
      icon: mdi:chart-line

sensor.yaml:

- platform: statistics
  entity_id: sensor.dailyhotwaterenergyconsumed_sum
- platform: statistics
  entity_id: sensor.dailyheatingenergyconsumed_sum

customise.yaml:

sensor.dailyhotwaterenergyconsumed_sum:
  friendly_name: "SWW energie"
sensor.dailyheatingenergyconsumed_sum:
  friendly_name: "Verwarming energie"
2 Likes

great to see that, I was just looking for a Dutch HA fellow with Mitsubishi Airco experience. Could you please indicate which device you have, and how you integrated it in HA?

I want to buy a split airco unit, and operate is via HA, but dont know if thats possible at all. Ofc course preferably localā€¦ thats why I stumbled on Mitsubishi AirCon - #4 by nickrout

That code is now available in esphome as a custom component too. https://github.com/geoffdavis/esphome-mitsubishiheatpump

thanks, thats mighty impressive. Requires some old school handwork though, I am afraid thats not my forteā€¦But, thereā€™s always a first, and never having used Esphome yet, this might be as good as ever a reason to consider. Cool.

I donā€™t have an airco but a heatpump (PUHZ-SHW112YAA+ERSC-VM2D). The unit is connected to internet via a MAC-567IF-E. In the MELcloud online version I was able to look up the required contextkey, device- and building idā€™s. Via curl on my HA server I was able to lookup stuff. You might have to play with the exact command depending on your model, see various configurations in this topic. You pick out the usefull information you see in the curl output and put that in the json attributes to integrate those reading in HA.

There is not much to control for me, I can control the temperature setting and thatā€™s it. But thatā€™s te same I can do from my Mitsubishi thermostat. I would like to switch between cooling and heating but that doesnā€™t seem to be an option on my unit.

However, I use home assistant to lookup varius temperature readings that I can only access in the MELcloud app or on the inner unit otherwise. So I use it to be able to check if something might be wrong and I calculate the coefficient of performance (cop) daily:

3 Likes

@breinonline Could you consider creating PRs for these sensors to https://github.com/vilppuvuorinen/pymelcloud :pray:

Having everyone configure their own rest sensors with arbitrary poll rates adds to the load originating from HA instances. I donā€™t want go back to the half-baked feature set my ATA unit offers :sweat_smile:

What is the best way to derive power (watts) from the reported energy consumption (kWh)? Iā€™m having trouble - possibly because Melcloud seems to report every time 0.1 kWh has been consumed, which is like anything between 5 min and a day.

1 Like

Iā€™m afraid those are the best numbers you can get. At least you donā€™t have one of those Ecodan units that reports power consumption in 1 kWh increments.

MELCloud connected devices seem to send sampled values once a minute. Thatā€™s the best case. IIRC the ATW devices report outdoor temperature with 1Ā°C accuracy and once every 10 minutes.

If you want to go to extremes you could get one of those zigbee clip-on current probes and measure the current draw externally.

1 Like