Mitsubishi MelCloud - Lossnay MVHR/ventilation support

Would be great to have support for ventilation (Lossnay VL, RVX).
Specifically I need only on/off and the 4 speed controls.


Would be happy to be a tester

Seems like pymelcloud (GitHub - vilppuvuorinen/pymelcloud: A MELCloud Client Library) does actually have ventilation support (erv_device.py) which should be a good starting point

Hi! I actually took the updated pymelcloud and made some changes to the core melcloud integration to support ERV devices, as I am not a python developer and not yet very into the whole integration development, i just made it available as a HACS custom component:

Here is my lossnay in HA:

I do have to note that is a bit rough around the edges, I get some error about the energy totals trying to be fetched, but i assume this fails because the ERV does not support this report.

Hero!

Thanks for putting your time in on this!
The ERV works for me which is fantastic

However the heat pump control doesn’t work - it always seems to show Off regardless of mode, and is missing the flow & return temp data

And if I use the original Melcloud integration alongside your HACS one, I can control the heatpump as before from the integration’s antities page, but when adding a card only one entity shows up as being compatible and it’s the HACS non-working one. I suspect the working one is being overwritten by the HACS entity as it’s the same name
image

So there’s some success there, if you do have any ideas I would be greatful, but I appreciate you’re not a developer and it was a working prototype :beers:

Edit: just updated to your V1, flow & return are there now :pray:

But the climate card still ‘off’ only

Do you see anything in your logs? As I do not have a heatpump this is very tricky for me to resolve, i think it has something to do because the python script has changed a bit from the one being used originally, so maybe something have been broken. If you have some error logs I can maybe take a look to see what is going wrong.

@ASMD do you have some channel/way i could contact you on, maybe you can help me with debugging this stuff to get it working!

Hi! I’ve tried this cause I need the energy recovery device to add it to homekit through home assistant and when configured I only see the heat pump. Just 1 device. It seems I have some errors in logs but cannot understand what exactly is the issue. Could you help?

I could add the logs here

2024-01-04 00:28:07.230 WARNING (SyncWorker_4) [homeassistant.loader] We found a custom integration hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant

2024-01-04 00:28:07.232 WARNING (SyncWorker_4) [homeassistant.loader] We found a custom integration melcloudwitherv which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant

2024-01-04 00:28:31.211 ERROR (MainThread) [pyhap.characteristic] TargetHeatingCoolingState: value=0 is an invalid value.

2024-01-04 00:30:18.048 ERROR (MainThread) [homeassistant.loader] Unexpected exception importing platform custom_components.melcloudwitherv.climate

Traceback (most recent call last):

File “/usr/src/homeassistant/homeassistant/loader.py”, line 842, in get_platform

cache[full_name] = self._import_platform(platform_name)

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File “/usr/src/homeassistant/homeassistant/loader.py”, line 859, in _import_platform

return importlib.import_module(f"{self.pkg_path}.{platform_name}")

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File “/usr/local/lib/python3.11/importlib/init.py”, line 126, in import_module

return _bootstrap._gcd_import(name[level:], package, level)

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File “”, line 1204, in _gcd_import

File “”, line 1176, in _find_and_load

File “”, line 1147, in _find_and_load_unlocked

File “”, line 690, in _load_unlocked

File “”, line 940, in exec_module

File “”, line 241, in _call_with_frames_removed

File “/config/custom_components/melcloudwitherv/climate.py”, line 59, in

atw.ZONE_OPERATION_MODE_HEAT_FLOW : HVACMode.HEAT,

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

AttributeError: module ‘pymelcloud.atw_device’ has no attribute ‘ZONE_OPERATION_MODE_HEAT_FLOW’

2024-01-04 00:30:18.066 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform ‘melcloudwitherv.climate’: Platform not found (Exception importing custom_components.melcloudwitherv.climate).

2024-01-04 00:30:18.080 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform ‘melcloudwitherv.sensor’: Platform not found (cannot import name ‘DEVICE_TYPE_ERV’ from ‘pymelcloud’ (/usr/local/lib/python3.11/site-packages/pymelcloud/init.py)).

2024-01-04 00:30:18.092 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform ‘melcloudwitherv.select’: Platform not found (cannot import name ‘DEVICE_TYPE_ERV’ from ‘pymelcloud’ (/usr/local/lib/python3.11/site-

Thanks for the logs, it looks like the custom version of pymelcloud is not loaded yet, because the ERV device is a static value that should def be there. Could you maybe restart or reload then integration to see if you get a different result/error

Hi, yes I did it. I get the same result. But I have a question, if I understand correctly, you are saying that is missing something in the installation file. How come others, can use it? I mist admit I did everything through UI cause I didnt know how to manipulate the config file

The custom integration needs my own version of the pymelcloud library that is being used underneath. This is indicated by the manifest file of this integration, and it look like for you it is not loading my pymelcloud library, otherwise afaik that error would not be present. I am not really an expert on this stuff yet so maybe somebody else can chime in why this is happening.

I added a new version that now includes a power button for the ERV device. So you can turn it on/off.

If there is somebody with both an ERV and Heatpump that wants to use this integration, let me know, because i do need an account or take a look with you together to see why it is not working, as i do not have a heatpump there is no way for me to fix these errors.

Hi, thank you very much for creating the ERV Losnay integration, it works perfectly. I also have a heat pump, unfortunately the integration has stopped working there. I would like to work together with you to solve the problem with the heat pump.

Can you try to install melcloud with ERV ( make sure the other one is not installed ), then restart your home assistant fully. I saw something similar happening with my test setup, where i first tryed the original integration and afterwards the other one. this gave the same errors, but resolved when I restarted HA

I have changed some code regarding the ATW device, i rolled back the pymelcloud script to the one that is currently being used by the official one and not the latest one available on github, this seems to at least show a heat pump climate card that can be controlled, I did not do any further testing. But thanks to @jiri for helping me with debugging this.

I also copied over the changed polling rates that where fixed a few days ago in the official addon as it looks like mitsubishi has limitted the polling rate. hope this fixes some problems people are having!

I removed the original version and I have included this one again. Everything seems to work perfectly. Thanks a lot. It’s a huge step for me.

Is there a way to include the level of the energy recovery device in homekit? I’m only able to turn it on or off in homekit although in homeassistant I can play with the speed.

Thanks again

Can I ask what model of wifi interface you guys are using with your lossnay. I see the mac-588 listed on the lossnay docs but curious to know if the 568 or other models would also work.