Mitsubishi MELCLOUD integration with Home Assistant

Hi o0Zz,

Thank you so much for this, really appreated. A friend and I are installing in our homes a Mitsubishi AC just because this custom component exists.

Any news on having it integrated as an official component in HA?

Thank you in advance.
Best regards,

Marcos.

Probably for start it would be great if Melcloud would be integrated into HACS, so that future updating would be easier


1 Like

Thanks for this integration wounderful job !!! thank you to you you are a genius !!

The melcloud app lets you get energy usage, is it possible to obtain this info through the integration?

On my Ecodan system I can only get an estimate in Melcloud, as the HP is not fitted with energy meters. In case electrical meters are fitted, their values are passed through the API.
As I am more than a newbie, it took me literally weeks to figure out the right syntax to get all the parameters out of the JSON
 :smiley:

What I do:

  - platform: rest
    name: Ecodan_FlowTemperature
#    friendly_name: "Flow Temp"
    unit_of_measurement: '°C'
    resource: https://app.melcloud.com/Mitsubishi.Wifi.Client/user/ListDevices?id=**yourdeviceID**&buildingID=**yourbuildingID**
    method: GET
    headers: 
        X-MitsContextKey: '**yourcontextkeyhere**'
    value_template: '{{ value_json[0].Structure.Devices[0]["Device"]["FlowTemperature"]}}' 
    scan_interval: 30          

By replacing “FlowTemperature” by “CurrentEnergyConsumed” you would get the energy consumption.

My problem is that I can’t get the template properly working so I am using a list of rest sensors and I call the API every time
 Some help would be appreciated! :slight_smile:

Did you try my approach in post #194? I can get any value from the Ecodan json with just one call to the API


Hi - yes, initially I copied your post #194 but then I found out that I could get more data by making another call (https://app.melcloud.com/Mitsubishi.Wifi.Client/user/ListDevices). For example I can get the compressor speed! The response though is much more complicated and I am not able to write myself a better code than calling the API several times. If I try something similar to your code, I get either “unknown” or other error codes for the sensors I defined through templating
 probably due to the length of the API answer and my inability to use the right syntax to parse the json.

Yes, it’s all on the parsing of the json. With the right syntax you can extract any data you want with just one call. You can maybe try and post the json in the general help forum, see if someone there can help you point at the values you need.

Finally I could make it work: I used “jq” to eliminate the brackets from the json coming out from the API and now I can use attributes and through templating it’s quite straightforward to extract all values I want from a single call.
Reference here: RESTful Sensor with json result as array values?

My call is now looking like:
command: ‘curl -v -H “X-MitsContextKey: yourkeyhere” “https://app.melcloud.com/Mitsubishi.Wifi.Client/user/ListDevices?id=yourID&buildingID=buildingID”| jq “.[].Structure.Devices[].Device”’

1 Like

Hello everybody,

This is an amazing job @o0Zz!
I have some questions though.
Through MEL I can see the below screenshot for my unit.

On my HA, after inserting your code, I can see this.

My questions are:

  • Swing mode refers (I guess) to vane vertical positions. Is there any possibility to add another option for vane horizontal positions?
  • Is it possible to add the presets as well? It is really handy to adjust the whole unit with one click.

bonjour,
je suis nouveau dans cet univers, je possĂšde depuis peu 1 PAC Mitsubishi ECODAN et j’utilise MELCLOUD depuis que j’ai installĂ© le MAC-5671F-E (trĂšs rapidement aprĂšs la pose de ma PAC dĂ©but octobre 2019).
J’utilise aussi Hassio aprĂšs m’ĂȘtre Ă©quipĂ© d’un Raspberry et je cherche Ă  intĂ©grer MELCloud. Je commençais Ă  dĂ©sespĂ©rer et j’ai dĂ©couvert votre communautĂ© et les gens formidables qui sont Ă  l’oeuvre

Par contre je ne parviens pas à réaliserc ce que vous décrivez.
Mes connaissances en informatique sont trĂšs limitĂ©es et en gĂ©nĂ©ral j’arrive Ă  faire les choses en regardant et en copiant ce qui fonctionne mais cette fois la barre est un peu haute, ce qui me manque c’est le dĂ©marrage. Pourriez vous m’indiquer comment utiliser le code que vous donnez dans le post #194? Je n’ai pas compris non plus comment faire un compte invité  je n’ai donc pas obtenu la clĂ© de contexte, la liste des bĂątiments ni les pĂ©riphĂ©riques liĂ©s Ă  mon compte.
Un grand merci d’avance
franciscodaspis

I’ve got the same, but at this point it’s only the vertical you can control.

Regarding presets, there I would suggest that you either look for automations or scripts. I myself is using of course automations based on criterias, but I’ve also assigned a few scripts to buttons in Lovelace so that I can have some presets (run cool or heat for a few hours with highest fan speed).

Anglais s’I’ll vous plait.

Hello,
I’m new to this world, I recently Cap 1 Mitsubishi ECODAN and I use MELCLOUD since I installed the MAC-5671F-E (very soon after the installation of the CAP in early October 2019).
I also use Hassio after having equipped myself with a raspberry and I try to integrate it with MELCloud. I was beginning to despair and I discovered your community and the great people who are at work 

By cons I can not achieve what you describe.
My computer skills are very limited and in general I can do things by looking and copying what works but this time the bar is a little high, what I miss is the start. Could you tell me how to use the code you give in post # 194? I also did not understand how to make a guest account 
 so I did not get the context key, the list of buildings or devices related to my account.
A big thank you in advance
franciscodaspis

Just wanted to say a big thank you for this plugin. My installer recommended us to run the fan of our air heater at max speed during the cold winters in Sweden to get the most value out of our investment. It works really well, but it sounds like a
 Big fan


But using this plugin can adjust the speed of the fan during our TV sessions.

  - alias: "Shield off climate on"
    trigger:
      - platform: state
        entity_id: media_player.shieldtv
        to: 'off'
    action:
      - service: climate.set_fan_mode
        data:
          entity_id: climate.melcloud_kallaren_181404
          fan_mode: 'Speed 5 (Max)'
          
  - alias: "Shield on climate off"
    trigger:
      - platform: state
        entity_id: media_player.shieldtv
        from: 'off'
    action:
      - service: climate.set_fan_mode
        data:
          entity_id: climate.melcloud_kallaren_181404
          fan_mode: 'Speed 4'

It works really well and the wife is really pleased. Happy wife, happy life


Thanks again.

2 Likes

Did you ever move forward with this idea? I want to do the same

It’s a shameless plug but here’s my take on integrating MELCloud and Home Assistant: https://github.com/vilppuvuorinen/hass-melcloud

It’s basically a copy of the Daikin integration without the switch platform. It’s 100% async and configured using Config Flow. Only the ContextKey token from MELCloud is stored to the Config Entry. Once I’ve solved the authentication, the it should be possible to PR the whole thing to Home Assistant.

I haven’t yet implemented vane control or swing modes and there’s only support for DeviceType 0 devices.

2 Likes

Not all heroes wear capes
 Thanks!

1 Like

I did some further digging into the MELCloud API and it looks like they have an Oauth provider and some sort of a grant management scheme integrated to the service.

I tried to email the MELCloud support to check if it is possible to provision some sort of developer client ids. It would be pretty neat to get the integration working with the OAuth2 Control Flow. Let’s see whether it will be a friendly reply or a cease and desist letter.

3 Likes

Simple thermostat option:
image

Code:

cards:
  - control:
      _names: false
    entity: climate.melcloud_kabinet_XXXXXX
    hide:
      state: false
      temperature: true
    name: Klima
    sensors:
      - entity: sensor.kabinet_klima_temperatura
        name: Klima
      - entity: sensor.kabinet_t
        name: Kabinet
    step_size: 1
    type: 'custom:simple-thermostat'
type: vertical-stack

On name click you still get “old” and more detailed options menu


BR,
Simon