Mitsubishi MELCLOUD integration with Home Assistant

To add component to HA I simply install via Community plugin (HACS) or manually:

After HA restart just add this code and restart HA again:

climate:
  - platform: melcloud
    email: [email protected]
    password: PASSWORD

(mail and password need to be the same as used for Melcloud login under website or via phone app)

After restart you will get new climate ID device, then you can use it as I use in previous post.

PS.
So, is that the same repository (@vilppuvuorinen) and copy as from @o0Zz?

Didnā€™t know that @vilppuvuorinen you have copyright of Melcloud component for HA?? :thinking:
image
Wouldnā€™t be fair to make merit also to other people before you make copy/paste of the code?

Dunno man. My integration is registering the entities etc the similar way as the Daikin integration. Maybe that deserves some sort of attribution or not. Otherwise itā€™s not related to o0Zzā€™s Melcloud integration. I didnā€™t like it and wrote my own. Usually writing something gets you the copyright. Is there something Iā€™m missing here?

Sorryā€¦ if you wrote code completly from the strach then OK. But if you use some code from other source then you should mention this in licenseā€¦ But itā€™s your callā€¦

Ao how is your integration different then Daikin or o0Zz integration?

Iā€™m not sure if following best practices using a reference implementation warrants attribution or not. Iā€™m trying to get this thing into a shape that could be PRd to HA so itā€™s not a high prio thing to sort out from that perspective either.

I used Daikin as a reference on how to do multiple platforms for domain and register things in async way. So itā€™s just similar async_setup, async_setup_entry, async_unload_entry and config_flow approach. Just the parts that do setup against HA. The Daikin integration interacts with Daikin products so thereā€™s nothing else of interest for doing integration with Melcloud.

The integration in my repo tries to be more closely compliant with HA integration guidelines. Config flow, asyncio, external pypi package for melcloud client, unloading, etc. It has also multiple platforms. I didnā€™t see it productive to try to PR these changes to something existing.

2 Likes

We really appreciate your work, and I hope that your PR is accepted by HA so it can be integrated officially. Thank you!

Read the code and see. And please donā€™t accuse people of copyright breach without evidence. And you donā€™t have evidence because a brief perusal of the github repos will reveal that there is no similarity between oozzā€™s code and @vilppuvuorinenā€™s.

Iā€™m not accusing anybody nothingā€¦ I just mention it that if code came from other source that they should be mentioned, nothing else.
I fully support what he is doing, and Iā€™m thankful that he try to sort out PR etcā€¦ So if I somehow offend him than I trully apology - because this was never my intend to doā€¦

Enough said. Particularly when you could have looked at the github repos and seen for yourself.

New things available since now:

device_info has the model names from units where the data has been fed in.

image

Energy sensor. The counter does not necessarily start from zero for some reason and the updates are really sparse. This should be compatible with the utility meter integration.

image

4 Likes

It looks like my setup has gone silently to read-only mode. I can observe writes going through to MELCloud but they are reset on the next poll. Only writes originating from MELCloud survive the next poll. Is anyone else experiencing this behavior?

In other news, Iā€™ve got the integration otherwise almost PR ready with config flow tests. Iā€™ll try submitting it once I have figured this read-only thing out. Iā€™ll have to verify the the headers and all.

Next Iā€™m thinking of trying to implement vane positions without using swing mode matrix like o0Zz does.

2 Likes

Hello. Thank you for your effort to have this made official. Currently Iā€™m using o0Zzā€™s implementation and it doesnā€™t go to read only mode.
When this goes PR will it be complicated to replace the community plugin with the official? Iā€™m quite new to HA.

@vilppuvuorinen I tried to install your melcloud integration, but get the following error at startup. Using 0.103.6 of Home Assistant.

Error while setting up platform melcloud
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 148, in _async_setup_platform
    task = async_create_setup_task()
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 104, in async_create_setup_task
    platform.setup_platform,
AttributeError: module 'custom_components.melcloud.climate' has no attribute 'setup_platform'

Have you configured melcloud in your configuration YAML as climate platform? I have tested this only with config_flow through UI. That has been working like a charm.

climate:
  - platform: melcloud
    email: !secret melcloud_email
    password: !secret melcloud_password

Please, try removing platfrom from your config and add the integration via UI. Youā€™ll get a devices, unloading and all that. Your password wonā€™t be stored in the config entry.

If i remove entry in configuration.yaml and use the integration instead i get the following:

2020-01-16 09:53:55 ERROR (MainThread) [custom_components.melcloud.config_flow] Unexpected error creating device
Traceback (most recent call last):
  File "/config/custom_components/melcloud/config_flow.py", line 60, in _create_client
    await client.update_confs()
AttributeError: 'coroutine' object has no attribute 'update_confs'

Could you try pulling the latest data from master. It looks like I broke the integartion with the latest pymelcloud update.

Yes, works @vilppuvuorinen. Thanks.

Howeverā€¦ it seems to think my Ecodan is a HVACā€¦ any idea on that?

You probably canā€™t even control it then. I havenā€™t implemented anything besides the HVAC/heat pump stuff. I could try adding that in based on oOZzā€™s integration later on.

OK, let me know when you need help with testing