Mitsubishi MELCLOUD integration with Home Assistant

Seems he has plans to implement those functions. Maybe after HA integration?

Using swing modes to control the vanes felt like a hack so I just postponed that. I mean setting the swing mode to middle is just weird. I’d like to propose real vane controls to climate platform or they should be modeled as a separate entities.

I picked things out from Home Assistants constants. Auto would sure look better. Thanks for the tip.

Hi @vilppuvuorinen.

When I try add melcloud via the the integration page and add my username/password I get an error message that states ‘aborted’.
melcloud folder is copied to custom_compenents.
I’m not sure how to ‘pull the latest changes’. Help please.

You should check your logs. Home assistant does good job logging errors.

Do a git pull in the cloned hass-melcloud directory and copy the files to custom_components to make sure you are running the latest version.

@vilppuvuorinen Thanks. Do I need to remove the other climate module from configuration.yaml or can the two coexist?

You should be able to have multiple climate platforms configured at the same time without issues.

Have you had any luck getting this integration to work? If you can provide logs detailing the issue I should be able to help.

Thanks. No, I can’t get it to work. It aborts after entering my credentials at the login page.

Sun Feb 09 2020 12:44:15 GMT+1000 (AEST)

Unexpected error creating device
Traceback (most recent call last):
  File "/Users/name/.homeassistant/custom_components/melcloud/config_flow.py", line 56, in _create_client
    client = await client_creator()
  File "/Users/name/.homeassistant/custom_components/melcloud/config_flow.py", line 42, in _init_client
    return await pymelcloud.login(
  File "/Users/name/.homeassistant/deps/lib/python/site-packages/pymelcloud/__init__.py", line 192, in login
    response.get("LoginData").get("ContextKey"),
AttributeError: 'NoneType' object has no attribute 'get'

The MELCloud integration PR has been merged to home-assistant. I assume it will be available in the next release. I’ve renamed my custom component to melcloudexp to make it possible to allow testing experimental features through it.

@uspino, @jorkar, @guidods, @franciscodaspis: https://github.com/vilppuvuorinen/hass-melcloud has experimental Air-to-Water (Ecodan) support that allows controlling the radiator zones as climate devices. I’d appreaciate if you could test it out and let me know if there are any issues.

I’m also hunting for the elusive heat+cool Ecodan. If you happen to have a unit with both heat and cool functions, let me know and I’ll start pestering you about the details of it.

2 Likes

Getting this error when trying to turn the Ecodan on:

Failed to call service climate/set_hvac_mode. Cannot set zone_1_operation_mode, invalid property

PMd you with details

I also think there should be sensors for Water Tank Temperature and for Operation Mode (to know whether the unit it is actively heating the water tank or in stand by mode).

Thanks for the details.

I haven’t had too much time to work on the Ecodan support and I’ve decided to go for an incremental approach. I think I should try to PR the zone support to home-assistant before looking into adding the water heater.

I’ve added vane controls to my custom_component. It is accessible through state_attributes and services.

State attributes:

  • vane_horizontal - current position
  • vane_horizontal_positions - available positions
  • vane_vertical - current position
  • vane_vertical_positions - available positions

Services:

  • melcloudexp.set_vane_horizontal
  • melcloudexp.set_vane_vertical

I’ve added the services.yaml so that things should be discoverable through the Developer Tools.

2 Likes

Improved Ecodan support is upon us with the custom_component.

Available entities:

  • water_heater
  • climate for each zone
  • sensor for outdoor temperature, tank temperature and zone room temperatures

The water_heater supports target tank temperature and auto/force hot water modes. Zones support only target temperature. Outdoor temperature sensor reports temperature with 1°C accuracy and is updated every 1-2 hours.

The system can be turned on/off using an entity button or water_heater.turn_off and water_heater.turn_on services.

I have problem with my automation:

# Prižgi KLIMA - KABINET: Če je temperaturni senzor več kot 23 stopinj
- id: '402'
  alias: KABINET - prižgi KLIMA
  trigger:
#    platform: numeric_state
#    entity_id: sensor.kabinet_t
#    above: '23'
    platform: state
    entity_id: binary_sensor.kabinet_prizgi_klima_boolean
    to: 'on'
    for:
      hours: 0
      minutes: "{{ states('input_number.variable_kabinet_prizgi_klima_minuta') | int }}"
      seconds: 0
  condition:
      - condition: numeric_state
        entity_id: sensor.zunaj_t
        above: '4'
      - condition: state
        entity_id: binary_sensor.kabinet_ugasni_klima_boolean
        state: 'off'
  action:
    - service: climate.set_temperature
      entity_id: climate.kabinet
      data:
        temperature: '19'
    - service: climate.set_fan_mode
      entity_id: climate.kabinet
      data:
        fan_mode: 'Speed Auto'
    - service: climate.set_hvac_mode
      data:
        entity_id: climate.kabinet
        hvac_mode: 'cool'
    - service: climate.set_swing_mode
      entity_id: climate.kabinet
      data:
        swing_mode: 'Swing'
    - service: notify.simon
      data:
        message: "KABINET - vklop klime (hlajenje). Trenutna temperatura kabineta {{states('sensor.kabinet_t') | float }}°C. Trenutna temperatura SCHRACK omare {{states('sensor.schrack_t') | float }}°C."
        title: "KLIMA VKLOP"

Before with custom component was working…

I get error:
Logger: homeassistant.components.automation
Integration: Avtomatizacija (documentation, issues)
First occured: 16:29:49 (1 occurences)
Last logged: 16:29:49

Error while executing automation automation.kabinet_prizgi_klima. Unknown error for call_service at pos 2:

Traceback (most recent call last): File “/usr/src/homeassistant/homeassistant/components/automation/init.py”, line 397, in async_trigger await self.action_script.async_run(variables, trigger_context) File “/usr/src/homeassistant/homeassistant/helpers/script.py”, line 247, in async_run await self._handle_action(action, variables, context) File “/usr/src/homeassistant/homeassistant/helpers/script.py”, line 331, in _handle_action await self._actions[_determine_action(action)](action, variables, context) File “/usr/src/homeassistant/homeassistant/helpers/script.py”, line 413, in _async_call_service context=context, File “/usr/src/homeassistant/homeassistant/helpers/service.py”, line 101, in async_call_from_config domain, service_name, service_data, blocking=blocking, context=context File “/usr/src/homeassistant/homeassistant/core.py”, line 1230, in async_call await asyncio.shield(self._execute_service(handler, service_call)) File “/usr/src/homeassistant/homeassistant/core.py”, line 1253, in _execute_service await handler.func(service_call) File “/usr/src/homeassistant/homeassistant/helpers/entity_component.py”, line 198, in handle_service self._platforms.values(), func, call, required_features File “/usr/src/homeassistant/homeassistant/helpers/service.py”, line 402, in entity_service_call future.result() # pop exception if have File “/usr/src/homeassistant/homeassistant/helpers/entity.py”, line 590, in async_request_call await coro File “/usr/src/homeassistant/homeassistant/helpers/service.py”, line 433, in _handle_entity_call await result File “/usr/src/homeassistant/homeassistant/components/melcloud/climate.py”, line 131, in async_set_fan_mode await self._device.set({“fan_speed”: fan_mode}) File “/usr/local/lib/python3.7/site-packages/pymelcloud/device.py”, line 72, in set self.apply_write({}, k, value) File “/usr/local/lib/python3.7/site-packages/pymelcloud/ata_device.py”, line 153, in apply_write state[“SetFanSpeed”] = _fan_speed_to(value) File “/usr/local/lib/python3.7/site-packages/pymelcloud/ata_device.py”, line 77, in _fan_speed_to return int(speed) ValueError: invalid literal for int() with base 10: ‘Speed Auto’

Anybody know what would be the problem?

Thank you…

It looks like you have been using oOZz’s custom_component. The MELCloud integration available in home-assistant 0.106 is not a drop-in replacement for oOZz’s work. It’s written from scratch with a slightly different approach. Mainly the hvac_modes and fan_modes are different. Additionally swing_mode was dropped in favor of complete vane control through services. Unfortunately the service approach is not yet available in 0.106.

You have three options going forward:

  1. Rollback to oOZz’s custom_component.
  2. Rewrite the automation to work with 0.106 and lose vane control until the support makes it to upstream home-assistant.
  3. Rewrite the automation to work with my custom_component linked above. This way you can get things working with the service oriented vane control before it makes it to the upstream home-assistant.

Sorry for the inconvenience.

1 Like

Thank you… will go back to oOZz and wait until official HA Melcloud component is finished and polished…

Found the answer to this myself, I’ve forgot to remove the custom_components/melcloud that I’ve used so far :slight_smile:

Hi, I’ve upgraded to hassio 0.106 and tried to include the melcloud integration. When selecting melcloud from the list in hassio, a white box with a “please wait wheel” appears a millisec and then returns to the please select integration list. Any tips on how to get this working, I assume it should open melcloud login page to get a token?

Hi,

I made some mod to the new standard MELCloud component, adding also swing modes.
It’s a custom component that use the same library used by standard.
It can be found here

N.B. I just make this as excercise, if vilppuvuorinen of any other want to use part or all of this modded code is welcome.

Hi,

Have added the integration of Melcloud through the UI as well as from the configuration with the token. The integration shows up in the list on HA, but no entities are assigned.

Am i doing something wrong? I have an ecodan system set-up in Melcloud which functions normally from the Melcloud app.

Would appreciate any help.

Read this :

and this:

The documentation information [The required authentication token can be found in X-MitsContextKey header when logged into the MELCloud] - is totally useless to me… How on earth do one do this. In the browser, by terminal, how and where do i find that stupid token ? - please stop with the requirement for implicit knowledge.
I have gotten the custom version from this link working, any reason to figure all this out instead ?