Mitsubishi MELCLOUD integration with Home Assistant

I’m trying something simpler, but it doesn’t work…

id: '1639920437512'
alias: Test
description: ''
trigger:
  - platform: numeric_state
    entity_id: climate.airco_keuken
    attribute: temperature
    above: '19'
    for:
      hours: 0
      minutes: 0
      seconds: 5
condition:
  - condition: state
    entity_id: climate.airco_keuken
    state: heat
    attribute: hvac_modes
action:
  - device_id: 917d181729d0cf67206e97d1473c741b
    domain: mobile_app
    type: notify
    message: Its more then 19
mode: queued
max: 10

The trigger fires, but the condition returns false, even though by hvac is clearly on heat :frowning:

Did you try the automation with heat between ’ ', so:

state: 'heat'

?

Hi,
Found it. actually the attribute hvac_modes is just what it says, a list of the supported hvac_modes
I changed the condition to simply say

condition:
  - condition: state
    entity_id: climate.airco_keuken
    state: heat
    for:
      hours: 0
      minutes: 0
      seconds: 1

this condition returns true if the airco is turned on and heating.

1 Like

Hello everyone, I’m thinking about getting a Mitsubishi air conditioner, is there any issue or limitation regarding HA I should be aware of?

Are you referring to the ERV devices?

The python lib responsible for the communication already supports those. Someone would have to drag the feature across the finish line tho.

Sorry for the very long time to reply (again) - it took me a while to figure out a test environment to run this PR in, and by the time I did it appears not to work with the head version of HA so I made a local edit to fix that. (The HA specific package for HTTP status codes was removed, I can post more details if helpful).

I’ve been using this setup for a month on a test machine now, and gathered some feedback.
I’m currently just to control the ASHP zone flow temperatures dynamically. (The overall heating system is managed in a Loxone miniserver, which has it’s own flow compensation curve; I’m using HA to relay those target flow temps into MELcloud). This is working really well in the current cold snap, so that’s great!

So a few thoughts/comments:

  1. This works fine for me programmatically, but from a UI point of view in the HA dashboard the 6 heating controls for 2 zones is confusing. So long as I’m running this on a different HA instance, that doesn’t impact me so much, but I imagine if this were in the main release and on my main HA instance I might find it annoying.

  2. Also, in general, I don’t want these controls visible in the UI, as accidentally changing flow target temp while flinging through the UI dashboard on a phone could be dangerous, and result in too hot UFH flow temperature and damage to wood floor finishes. Maybe these internal controls should be marked as hidden by default in the UI and just there for people writing automations and calling services programmatically?
    Having a way to configure a hard-stop min/max on the zones would also help.

  3. I can’t seem to use it to change ASHP mode from heat to cool and back. This is presented as an independent option on both the zone controls, so I’ve tried setting those in the UI and programmatically (in Dev Tools). And also tried turning “on” the cooling specific zone controllers, but none of them result in a mode change on the ASHP itself.
    In the MELcloud app this is a single global setting for the unit, not a per-zone setting, so not sure if that has something to do with it.
    If I recall correctly I had had this working on the experimental fork of the component, so maybe something changed. I can try and re-verify that if helpful (although again I guess that fork will need bringing up to date again).

Let me know what further input would be helpful, and thanks again for all the work on this!

Hi,

I checked in the old topics but didn’t found any info related to Holiday / Vacation mode ?

Is there any option to set the PAC in this mode via HA ?

Thank you

@joth Responses below. Overall this stuff is a bit weird overall because I don’t have an ATW device myself. Although it would be pretty sweet to have one installed if I had the spare cash :thinking:

  1. I have to admit the whole 6 climates thing is a mess. It is just difficult to detect the desired setup from device config.

The idea here is to attach the relevant controls to the dashboards and forget about the rest. I’m thinking the dashboard setup as a configuration step that you’ll have to do some way or another anyways.

This way you don’t see extra modes or have to remember how the modes map.

Another approach would be to add a state property “control mode” concept for thermostat/flow/curve. This approach makes it just a little weird when you want to automate mode change and temperature set at the same time.

To sum it up: modeling an ATW device is a mess and you are going to see 6 things for 2 zones no matter what. It’s more about where those things are, how simple the setup is and how usable the end result will be.

  1. I’m not so sure if the flow controls are actually only internal. Min/max limits were briefly discussed in this topic not so long ago. They don’t fit the entity model and my suggestion is using an automation. There could be an integration providing such limiter for any arbitrary state property as well.

  2. The zone specific controls target the same property. If you set one, both are set to the same value. If something doesn’t work, it’s most likely because I accidentally broke it.

A possibility to avoid the Ecodan curve setting using could be to create an own curve, generated into the integration, and always operate on the flow temperature control.
This is also a way to open to the replacement of the external ambient temperature sensor, the Ecodan sensor is poor, slow and often affected by the machine temperature in the various working conditions.

I updated the password in my MelCloud account for a more secure one. Is there a way to upgrade the password in the HA Integration? If I delete the integration and re-add it with the new password, all the entity names might get messed up…

The integration does not store the password. The password is used to fetch an auth token and only the token is stored.

You don’t need to delete the integration if you want to refresh the token either. You can add a new MELCloud integration with with the same email. If the a MELCloud config with the same email is found, the existing token is updated and the registration process is aborted. The existing entities are not modified. This process can be used to refresh the token if it expires.

2 Likes

@ vilppuvuorinen, have a look here:

or here:

MQTT, no-cloud interfacing to the Mittsubishi heat pumps seems possible.

Yes, it’s possible. Using it already 4 years. https://github.com/SwiCago/HeatPump

Worked like a charm, thank you!

I had initially planned to build something that would bypass the cloud. Wiring into the proprietary connector is not something I am super excited about. The cloud solution works way too good for me. Maybe emulating the an IR remote would be the best non-intrusive middle ground.

Anyways regarding the external curve option, I think the natural approach would be to get the flow control support merged and to build something using automations or appdaemon. Adding this stuff to the integration does not seem natural. I have a temperature curve setup for heating up the cars based on the temperature and it works like a charm.

Getting the flow control / Ecodan entity split PR or something else accomplishing the same goal just not moving too fast. Someone owning an ATW unit would need to help me out here and sort out the bugs and inconsistencies in that branch.

Actually the flow control is all it would need.
If the cooperation you need is only to test the beta, with no code knowing, I can help you.

Hello!
Sorry but it’s not clear to me, so with this integration, can you control the flow temperature on a ATW Mitsubishi Ecodan system?

Thanks a lot!

As this integration uses MELcloud that does not directly belong to the possibilities. You can however indirectly influence the flow temperature adapting the thermostat settings.

I’m still seeing the energy sensors displaying 0 regularly but after some time they are refreshed and are numbers presented. If I look at the history the data should be available:
Screenshot 2022-03-06 at 08.32.03

Screenshot 2022-03-06 at 08.32.41

The temperature sensors have no problems. Does anyone recognise this? I’m using scan_interval: 60 and command_timeout: 20.

If I zoom in at the sensor it looks like a pattern of 1 minute (un)availability:

hey guys, thank you to eveyone that posted here, it was a great big help for me to get my energy consumption imported in home assistant for a air-to-water zubadan/ecodan heat pump. gona post it here just in case it can help anyone else

  - platform: rest
    name: heat_pump_api
    resource: https://app.melcloud.com/Mitsubishi.Wifi.Client/user/ListDevices?id=YOUR_ID&buildingID=YOUR_BUILDING_ID
    method: GET
    headers: 
        X-MitsContextKey: 'YOUR_CONTEXT_KEY'
    value_template: "OK"
    scan_interval: 60
    json_attributes_path: "$..Devices[?(@.DeviceID==YOUR_DEVICE_ID)].Device"
    json_attributes:
      - CurrentEnergyConsumed
      - DailyHeatingEnergyConsumed
      - DailyCoolingEnergyConsumed
      - DailyHotWaterEnergyConsumed
      - DailyEnergyConsumedDate
  - platform: template
    sensors:
      heat_pump_power:
        friendly_name: "Heat Pump Power"
        # availability_template: "{{ is_state('sensor.heat_pump_api', 'OK') }}"
        availability_template: >-
          {{ (states("sensor.heat_pump_api") not in ["unknown", "unavailable"]) and (state_attr('sensor.heat_pump_api', 'CurrentEnergyConsumed') != None) }}
        value_template: "{{ state_attr('sensor.heat_pump_api', 'CurrentEnergyConsumed') }}"
        device_class: power
        unit_of_measurement: "kW"
      heat_pump_daily_heating_energy_consumed:
        friendly_name: "Daily Heating Energy"
        # availability_template: "{{ is_state('sensor.heat_pump_api', 'OK') }}"
        availability_template: >-
          {{ (states("sensor.heat_pump_api") not in ["unknown", "unavailable"]) and (state_attr('sensor.heat_pump_api', 'DailyHeatingEnergyConsumed') != None) }}
        value_template: "{{ state_attr('sensor.heat_pump_api', 'DailyHeatingEnergyConsumed') }}"
        device_class: energy
        unit_of_measurement: "kWh"
      heat_pump_daily_cooling_energy_consumed:
        friendly_name: "Daily Cooling Energy"
        # availability_template: "{{ is_state('sensor.heat_pump_api', 'OK') }}"
        availability_template: >-
          {{ (states("sensor.heat_pump_api") not in ["unknown", "unavailable"]) and (state_attr('sensor.heat_pump_api', 'DailyCoolingEnergyConsumed') != None) }}
        value_template: "{{ state_attr('sensor.heat_pump_api', 'DailyCoolingEnergyConsumed') }}"
        device_class: energy
        unit_of_measurement: "kWh"
      heat_pump_daily_hot_water_energy_consumed:
        friendly_name: "Daily Hot Water Energy"
        # availability_template: "{{ is_state('sensor.heat_pump_api', 'OK') }}"
        availability_template: >-
          {{ (states("sensor.heat_pump_api") not in ["unknown", "unavailable"]) and (state_attr('sensor.heat_pump_api', 'DailyHotWaterEnergyConsumed') != None) }}
        value_template: "{{ state_attr('sensor.heat_pump_api', 'DailyHotWaterEnergyConsumed') }}"
        device_class: energy
        unit_of_measurement: "kWh"
      heat_pump_daily_energy_consumed:
        friendly_name: "Daily Heat Pump Energy"
        availability_template: >-
          {{ (states("sensor.heat_pump_api") not in ["unknown", "unavailable"]) and (state_attr('sensor.heat_pump_api', 'DailyHotWaterEnergyConsumed') != None) }}
        value_template: "{{ state_attr('sensor.heat_pump_api', 'DailyHeatingEnergyConsumed') + state_attr('sensor.heat_pump_api', 'DailyCoolingEnergyConsumed') + state_attr('sensor.heat_pump_api', 'DailyHotWaterEnergyConsumed') }}"
        device_class: energy
        unit_of_measurement: "kWh"
1 Like