Mitsubishi MELCLOUD integration with Home Assistant

Great… and thank you again for everything…

Thank you for the update, it helped me get rolling. I’m fairly well versed in Python, but very new to HA, and wanted to take a stab at improving this module.

For example, I want to expose the energy meter as a sensor component. The Daikin module looks like a good starting point, but first step would be to properly separate the API and HA code.

2 Likes

Yes the Daikin component should be a very good starting point. Maybe the Sensibo component also.
Maybe we can work together to make a official HA component? :slight_smile:

If you need any help in any other way then programing (python is not my native language / c# .net is) then just tell me… I’m also willing to help if somehow I can…

The energy meter would be really cool to get!

Would you be able to take a look at why if I add an Ecodan Heater to MELCloud, the component brakes? According to this post the control functions are slightly different from a regular A/C, so it would be a matter of adding those to the component. Thanks!

I think that firstly this component must become officially before adding other stuff / the main goal is to support climate…

I agree, the most important is making it official and supporting 0.87. I wish i could help, but i can’t really program to any reasonable degree.

The first thing that need to be done is abstracting the code for the api into a separate pypi package.

I’ve come a fair way of separating it. Having a busy week but will post changes this weekend I hope. Next will be to rewrite the HA specific parts.

1 Like

After updating to 89.2 I have problems with melcloud… Maybe something to my settings related, but anyway I’m publishing it so that you can find here…

I have the same problem.

Still working here after updating to 89.2. Try to delete the pycache folder and restart.

Just tried that, it did not help. I get this error instead of the controls:

Entity not available: climate.melcloud_bedroom_58597

I’m running Homeassistant in Docker. Everything worked in 89.1 but not 89.2

Same problem for me now after restart. Maybe Melcloud server maintenance or they have done some changes to the connection settings.

I think it must be something else. As the entity is not even activated to homeassistant from the configuration. So it dosn’t seem to be about the Melcloud service.

My logs:

Log Details (ERROR)
Thu Mar 14 2019 18:10:36 GMT+0100 (Central European Standard Time)
Error while setting up platform melcloud
Traceback (most recent call last):
File “/usr/local/lib/python3.7/site-packages/urllib3/connection.py”, line 159, in _new_conn
(self._dns_host, self.port), self.timeout, **extra_kw)
File “/usr/local/lib/python3.7/site-packages/urllib3/util/connection.py”, line 80, in create_connection
raise err
File “/usr/local/lib/python3.7/site-packages/urllib3/util/connection.py”, line 70, in create_connection
sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py”, line 600, in urlopen
chunked=chunked)
File “/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py”, line 343, in _make_request
self._validate_conn(conn)
File “/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py”, line 839, in _validate_conn
conn.connect()
File “/usr/local/lib/python3.7/site-packages/urllib3/connection.py”, line 301, in connect
conn = self._new_conn()
File “/usr/local/lib/python3.7/site-packages/urllib3/connection.py”, line 168, in _new_conn
self, “Failed to establish a new connection: %s” % e)
urllib3.exceptions.NewConnectionError: <urllib3.connection.VerifiedHTTPSConnection object at 0x6e543690>: Failed to establish a new connection: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/usr/local/lib/python3.7/site-packages/requests/adapters.py”, line 449, in send
timeout=timeout
File “/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py”, line 638, in urlopen
_stacktrace=sys.exc_info()[2])
File “/usr/local/lib/python3.7/site-packages/urllib3/util/retry.py”, line 398, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host=‘app.melcloud.com’, port=443): Max retries exceeded with url: /Mitsubishi.Wifi.Client/Device/Get (Caused by NewConnectionError(’<urllib3.connection.VerifiedHTTPSConnection object at 0x6e543690>: Failed to establish a new connection: [Errno 111] Connection refused’))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/usr/local/lib/python3.7/site-packages/homeassistant/helpers/entity_platform.py”, line 128, in _async_setup_platform
SLOW_SETUP_MAX_WAIT, loop=hass.loop)
File “/usr/local/lib/python3.7/asyncio/tasks.py”, line 416, in wait_for
return fut.result()
File “/usr/local/lib/python3.7/concurrent/futures/thread.py”, line 57, in run
result = self.fn(*self.args, **self.kwargs)
File “/config/custom_components/melcloud/climate.py”, line 499, in setup_platform
devices = mc.getDevicesList()
File “/config/custom_components/melcloud/climate.py”, line 300, in getDevicesList
devices.append( MelCloudDevice(device[“DeviceID”], device[“BuildingID”], device[“DeviceName”], self._authentication) )
File “/config/custom_components/melcloud/climate.py”, line 93, in init
self._refresh_device_info()
File “/config/custom_components/melcloud/climate.py”, line 107, in _refresh_device_info
req = requests.get(“https://app.melcloud.com/Mitsubishi.Wifi.Client/Device/Get”, headers = {‘X-MitsContextKey’: self._authentication.getContextKey()}, data = {‘id’: self._deviceid, ‘buildingID’: self._buildingid})
File “/usr/local/lib/python3.7/site-packages/requests/api.py”, line 75, in get
return request(‘get’, url, params=params, **kwargs)
File “/usr/local/lib/python3.7/site-packages/requests/api.py”, line 60, in request
return session.request(method=method, url=url, **kwargs)
File “/usr/local/lib/python3.7/site-packages/requests/sessions.py”, line 533, in request
resp = self.send(prep, **send_kwargs)
File “/usr/local/lib/python3.7/site-packages/requests/sessions.py”, line 646, in send
r = adapter.send(request, **kwargs)
File “/usr/local/lib/python3.7/site-packages/requests/adapters.py”, line 516, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host=‘app.melcloud.com’, port=443): Max retries exceeded with url: /Mitsubishi.Wifi.Client/Device/Get (Caused by NewConnectionError(’<urllib3.connection.VerifiedHTTPSConnection object at 0x6e543690>: Failed to establish a new connection: [Errno 111] Connection refused’))

For me it seems that there is problem regardin username / password - which I tested and working fine…

Maybe is time so that username / password warning is fixed - maybe something to do with that?

Log Details (WARNING)

Thu Mar 14 2019 18:10:06 GMT+0100 (Central European Standard Time)

Your configuration contains extra keys that the platform does not support. Please remove [email], [password]. (See /config/config/climate.yaml, line 13).

Probably the error is about:
Override http.trusted_networks by auth_provider.trusted_networks (@awarecan - #21844) (http docs)

Nothing else changed about http/https in 89.2

Definitely is not related with trusted networks auth_provider changes.