Mitsubishi WF-RAC - (Smart M-Air)

Dedicated topic for the WF-RAC (Smartt M-Air) integration.
Please post questions and or remarks in here.

The integration adds the aircos to homeassistant that are using the WF-RAC Wifi module.

Intallation
Ther are 2 ways to install the integration:

  1. Install using HACS In HACS go to the three dots int the upper right corner choose add custom repository and add https://github.com/jeatheak/Mitsubishi-WF-RAC-Integration to the list.
  2. download the latest release from and unpack it. Than copy the mitsubishi-wf-rac folder to custom_components/

info

Device entities:
image

Climate control:
image

Support development:
Buy Me A Coffee

12 Likes

Wow, this is really really cool (phun intended) and works like a charm!

I’ve been tracking your work closely since i found out there was no integration availbable but you were making one.
I just integrated my three MHI’s into HA and its 1000x better than the Smart M-air app.

Thanks!

1 Like

Same here, awsome work :smiley: Thanks so much! Got my 3 units in HA runnig great. Looking forward to also add the Energy sensors once they are available.

Just got an issue with number 4. My 4 units worked using v0.0.1 and I deleted all devices before upgrading to v0.0.3. Now HA tells me one of the IP’s is already in use when I try to add this unit. The other 3 added without any issue.

Ow ok that’s weird. You are sure the 3 airco’s you configured have different IP’s than the airco you are trying to add?

On the next realease I will try to add the connection information so you can see which IP are configured.

1 Like

Yes, weird indeed. They all have IP reservations in my router so I know what devices are online. I can switch this unit to a free IP to resolve the issue. But then I still have that faulty one stuck somewhere in the config.

Would it be possible to create a “This IP is already was already added, do you want to reconfigure it?” or something like that?

Hi,

Thanks for your great wok on this. However, I seem to be unable to get it to work. I installed the latest version from HACS. Then went to add the integration and fill in the required fields:
image

When I then click submit I get this:
image

I checked on the command line and my HA is able to reach the airco on port 51443:
image

In the HA log I found this:

Traceback (most recent call last):
  File "/config/custom_components/mitsubishi-wf-rac/config_flow.py", line 194, in async_step_user
    info = await self._async_validate_input(self.hass, user_input)
  File "/config/custom_components/mitsubishi-wf-rac/config_flow.py", line 71, in _async_validate_input
    airco_id = await hass.async_add_executor_job(repository.get_details)
  File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/mitsubishi-wf-rac/wfrac/repository.py", line 31, in get_details
    return post(url, json=myobj).json()["contents"]["airconId"]
  File "/usr/local/lib/python3.10/site-packages/requests/api.py", line 115, in post
    return request("post", url, data=data, json=json, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/requests/api.py", line 59, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/requests/sessions.py", line 587, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python3.10/site-packages/requests/sessions.py", line 701, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/requests/adapters.py", line 547, in send
    raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))
2022-08-08 19:31:31.028 ERROR (MainThread) [custom_components.mitsubishi-wf-rac.config_flow] Unexpected exception
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 703, in urlopen
    httplib_response = self._make_request(
  File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 449, in _make_request
    six.raise_from(e, None)
  File "<string>", line 3, in raise_from
  File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 444, in _make_request
    httplib_response = conn.getresponse()
  File "/usr/local/lib/python3.10/http/client.py", line 1374, in getresponse
    response.begin()
  File "/usr/local/lib/python3.10/http/client.py", line 318, in begin
    version, status, reason = self._read_status()
  File "/usr/local/lib/python3.10/http/client.py", line 279, in _read_status
    line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
  File "/usr/local/lib/python3.10/socket.py", line 705, in readinto
    return self._sock.recv_into(b)
ConnectionResetError: [Errno 104] Connection reset by peer

Now I believe that “Connection reset by peer” means my airco may be doing something nasty but I can’t seem to find what the issue is. It’s working nicely from the Smart-M-Air app on my phone.

@lpwevers Ok that’s a pity to hear.

When I look at your problem it looks like it can’t connect to that airco. You are really sure it is the correct IP address? And that Hass can access that subnet? a open port won’t always tell everything. What does the phone count say in the app? (open airco → options → bottom page)

Could you try to run the following curl commando at hass core and see if you get a JSON response back?

curl -XPOST -H "Content-type: application/json" -d '{"apiVer": "1.0","command": "getDeviceInfo","deviceId": "1", "operatorId":"1","timestamp": 1659984520 }' 'http://10.1.0.123:51443/beaver/command/getDeviceInfo'

@jeatheak, thanks for the quick response. If I run this command on the HA server I get this:
curl: (56) Recv failure: Connection reset by peer

If I take the URL and put it in a browser I do get some JSON response back, though it seems invalid:
image

image

So maybe this is not the airco? Though I don’t think I’ve anything else that listens on port 51443.

In the app, phone count says 1.

I’ll go double check my network. See if it is some other device after all.

Double checked the network. That’s the only device on the WiFi that has port 51443 open. So I guess it must be the airco.

Ok it look indeed that it is a different device.

What does the Raw Data tab say in the browser? I did post to soon. You did put the raw data there.

If you put the url in the browser it does a GET request. and it seems like it is the airco. because that response is normal when you do a GET request instead of POST

I don’t think it’s a different device. Only thing in the WiFi network listening on this port. The Raw Data tab says:
Not supported this command

Yea I did post to soon haha.

That is indeed the response of the Airco.
But you get a Connection reset by peer from hass core and therefore I think it has something to do with network of your homeassistant.

Because it looks like your Hass OS is in a different subnet (172.16.0.61)
You are sure it can connect to the 10.1.0.123 subnet?
I’m not very good at network issues but that is to only thing I can think of.
When I google I did find one thread that stated to disable ipv6 but I don’t know why.

If the curl does not work the integration also wont work.

Hey @Noto

I did a update on Hacs.
If you add the airco now it will give a error message with the already configured airco name in it.

Hope that helps otherwise let me know

Thanks for the help. It is a network issue. You got me thinking, so I ran the command directly on my firewall (That has a direct connection to the WiFi).

That gives back this:


{"command":"getDeviceInfo","apiVer":"1.0","deviceId":"1","operatorId":"1","timestamp": 165998452,"result":0,"contents": {"airconId":"a043b05adbc1","macAddress":"a043b05adbc1","apMode":0}}

So I guess I’ll have to sort this out then. Guess the WiFi router is (again) doing something nasty.

1 Like

The correct unit is showing when I enter the IP. But as you can see from the developer tools, it’s no longer visible as an entity.

@Noto hat’s very weird.
What I should do is delete every airco in the integrations panel and register them again. If you use the same names the history will be kept.

But if you still want to force add the airco you can install the main branch from HACS. I did a temporary config fix that adds a checkbox to override the check when configuring the airco.

You can install the main branch when you click Redownload when you open this repository in hacs:
image

Then choose main from the dropdown menu:
image

after a restart the config flow has been updated.

I already removed everything and added it back in yesterday. The checkbox did the trick. Thanks :grin::grin:

Also noticed the energy sensor. I believe if you add the attribute:

last_reset: '1970-01-01T00:00:00+00:00'

The sensors will show up as individual devices in energy management

Ah, so many thanks for this. Just thought I let you know I got it working. Changed the WiFi network of the airco to one that’s directly connected to the firewall. Now HA can reach it and it’s working beautifully.

Only now it doesn’t work in the Smart M-Air app anymore, but I don’t care about that too much anyway. I prefer that I don’t have to rely on the internet connection being available for controlling any local device.

Let me know if you’re in the neighborhood some time and I’ll buy you a beer.

Cheers,
Louis

hi there,
im new to hoemassistant but got all setup on my esxi server…
now i installed this great plugin for my 3 air units.
2 of t eunits got detected right away from the server but 1 is missing.
how can i manually add the 3rd unit to the server?
Thx for this great work

Hi @jeatheak,

I’m using your integration since friday and am very happy with it. Me and my partner have stopped using the Smart M-Air app and replaced it with HA on our phones.

We have three Mitsubishi hvac’s and they where found by the integration. The last couple of days I’ve seen sometimes one of the units not responding to commands from the integration or updating the internal temperature sensors in HA. A restart of HA resolves this.

At the moment this is happening with the airco unit in our bedroom. Is there something I can do to help you debug this problem if you want to do this?

Hi,

Great that you are using Homeassistant on ESXI server. (I also use ESXI, with an intel NUC)
How did you install it? With Hacs or did you clone the repo?

You can setup the integration manually by clicking on the + Add integration button in the lower right corner of Settings->Devices&Services in the search bar type mits and select the integration. (see picture)

after that fill in the airco details:

image

Hope that helps.
Let me know if you need anymore help.