Mitsubishi Kumo Cloud Integration

Make sure your add-on configuration forwards the kumo service port, you can test it by trying to hit it directly at http://:8084/v0/rooms

1 Like

When I got to:

http://ha_ip:8084/v0/rooms
I see:
[“Office”]

Well that’s a good sign, it means KumoJS is running properly. The next thing would be to verify that the haas-kumo component is working, one thing might be the recent changes to the climate system, there were major changes so make sure you have the latest code from https://github.com/dlarrick/hass-kumo

I do, i am using the latest hassio: 0.97.2
Cloned hass-kumo today.

# cd /config/custom_components
# ls kumo_cloud/
__init__.py    climate.py     manifest.json
# git clone https://github.com/dlarrick/hass-kumo
Cloning into 'hass-kumo'...
remote: Enumerating objects: 46, done.
remote: Counting objects: 100% (46/46), done.
remote: Compressing objects: 100% (35/35), done.
remote: Total 46 (delta 16), reused 29 (delta 8), pack-reused 0
Unpacking objects: 100% (46/46), done.
# diff --brief --recursive kumo_cloud hass-kumo/kumojs
# rm -r hass-kumo

There are no differences in files.

I believe it should be platform: kumojs (all lowercase).

1 Like

Thank you! This was the problem! I am so happy that the last piece of Internet connected equipment in my house is now managed through Home Assistant.

I have this up and running but it seems to be a bit buggy. It looks like maybe because the custom component is only set to work with Celsius? I’m not sure though. Can anyone with better coding skills let me know if this is in fact an issue and if there is a quick way to fix this in the climate.py?

There is some confusion in the node.js component about F vs.c C. It converts back and forth several times. My own HA system uses US units and doesn’t seem to have any specific issues, though I have on occasion noted a current temperature reported that doesn’t seem to have been converted properly. What exactly are you seeing?

The indoor unit’s own API is in Celsius and this is something I hope to straighten out if I ever get the time to convert the whole thing to a native Python library.

It looks like setting the target temp doesn’t work. Looking at the kumojs logs it looks like the temp that’s sent by REST is in farenheit and the unit doesn’t know what to do with it. When I open the actual kumo app after doing that, the temp appears as 2 dashes.

For me, kumojs indeed requires setpoint in F but reports in C. Note in his own documentation example: https://github.com/sushilks/kumojs#change-the-temperature-for-cooling
Is your indoor unit set to F or C?

And as I noted earlier in the thread, if the setpoint winds up with too many decimal places it reports as “–” in KumoCloud.

Indoor is set to Farenheit. I guess that makes sense…I missed the earlier comment about --.

I’ll check again tomorrow, I wonder if the actual ir remote will display the temp if too many decimals…

Also, since it’s a new unit I’m not so sure how it operates when target temp is achieved…i guess the fan continues to run unless the unit is completely off…

Hey all, I’ve got some news.

I was on vacation this week and spent a couple rainy days porting KumoJS and my HA component to native Python, no KumoJS required. This evening I’ve got the basics working. See the ‘native’ branch of my hass-kumo repo here: https://github.com/dlarrick/hass-kumo/tree/native .

This is a bit rough around the edges. You’ll need to download and manually install my matching pykumo.py (from https://github.com/dlarrick/pykumo ), and provide some config values harvested from your KumoJS kumo.cfg file. The docs at the hass-kumo repo should be sufficient.

To be clear: this Python lib and HA component is our path to being natively included in Home Assistant. It’s also a bit more lightweight than running a separate Node.js server.

I’d love for folks to try it out and give me feedback, either here or on GitHub. Since it’s named differently (‘kumo’ vs. ‘kumojs’) the old and new can coexist in the same HA installation for debugging purposes.

This is awesome, I’ll try to find some time to get it up and running in the coming weeks.

Ugh. I was going to get started on testing your integration @parkercat … but I got stuck on build issues with KumoJS which is necessary to generate the config. So first thing is first - NPM does not come with the libraries needed to run KumoJS. I don’t remember what they are, but you have to install two more packages to get the compile to go beyond library problems.

I’m currently stuck on build issues - these look code based to me. Other people seem to have gotten it work though… so I’m wondering if someone more familiar with NPM can work it out for/with me.

Appreciate any help I can get. Thanks.

src/kumojs.ts:60:25 - error TS2345: Argument of type 'unknown[]' is not assignable to parameter of type 'number[]'.
  Type 'unknown' is not assignable to type 'number'.

60                         Array.prototype.map.call(p+dt, function (m2:any) {
                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
61                             return m2.charCodeAt(0)
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
62                         })
   ~~~~~~~~~~~~~~~~~~~~~~~~~~

src/kumojs.ts:75:43 - error TS2345: Argument of type 'number[]' is not assignable to parameter of type '[number, number, ...any[]]'.
  Type 'number[]' is missing the following properties from type '[number, number, ...any[]]': 0, 1

75         Array.prototype.splice.apply(dt3, [32, 32].concat(dt1_l));
                                             ~~~~~~~~~~~~~~~~~~~~~~

src/kumojs.ts:87:43 - error TS2345: Argument of type 'number[]' is not assignable to parameter of type '[number, number, ...any[]]'.

87         Array.prototype.splice.apply(dt3, [0, 32].concat(W))
                                             ~~~~~~~~~~~~~~~~~

src/kumojs.ts:124:57 - error TS2769: No overload matches this call.
  Overload 1 of 2, '(callback: (...args: any[]) => void, ms: number, ...args: any[]): Timeout', gave the following error.
    Argument of type 'Number' is not assignable to parameter of type 'number'.
      'number' is a primitive, but 'Number' is a wrapper object. Prefer using 'number' when possible.
  Overload 2 of 2, '(handler: TimerHandler, timeout?: number | undefined, ...arguments: any[]): number', gave the following error.
    Argument of type 'Number' is not assignable to parameter of type 'number'.
      'number' is a primitive, but 'Number' is a wrapper object. Prefer using 'number' when possible.

124       return new Promise(resolve => setTimeout(resolve, ms));
                                                            ~~



Found 4 errors.

npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! [email protected] build: `tsc`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\jhuan\AppData\Roaming\npm-cache\_logs\2019-09-06T04_45_34_776Z-debug.log
npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\jhuan\Downloads\node-v10.16.3-win-x64\package.json'
npm WARN node-v10.16.3-win-x64 No description
npm WARN node-v10.16.3-win-x64 No repository field.
npm WARN node-v10.16.3-win-x64 No README data
npm WARN node-v10.16.3-win-x64 No license field.

npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! [email protected] postinstall: `npm run build`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\jhuan\AppData\Roaming\npm-cache\_logs\2019-09-06T04_45_35_259Z-debug.log

Also - one more side question… is KumoJS an attempt to replace KumoCloud servers?.. or does it simply facilitate communications to/from KumoCloud? Ultimately, it would be ideal if I were able to communicate to my Kumo devices on the intranet without having to involve the KumoCloud at all. That thing is a dog at times and takes forever to communicate down.

You can get the info you need by downloading a file from KumoCloud using your credentials.
I don’t have a lot of time this morning so this reply will be pretty skeletal.

Use:
curl -d '{"username":"<kumocloud-username>","password":"<kumocloud-password>","appVersion":"2.2.0"}' -H "Accept: application/json, text/plain, */*" -H "Accept-Encoding: gzip, deflate, br" -H "Content-Type: application/json" https://geo-c.kumocloud.com/login > kumocloud.json

Substitute in your own kumocloud username and password. In the resulting kumocloud.json file, search for params as follows for each indoor unit:

  • search for "address" for the IP address of the indoor unit(s)
  • search for "password" for the password param
  • search for "cryptoSerial" for the crypto_serial param

w_param and s_param are constants, always "w_param": "44c73283b498d432ff25f5c8e06a016aef931e68f0a00ea710e36e6338fb22db", "s_param": 0,
I’ll pull those into the pykumo library next time I’m making changes.

Clearly, gathering this info via code is pretty straightforward and that’s a next step. In fact, this file has all we need to do autodiscovery & auto-creation of the climate entities (and also some sensor entities; more on that later). Doing re-discovery on HA restart would help out people whose indoor units get a different DHCP lease (IP address), too.

Also: yes, you’re correct. This code (as well as kumojs) are communicating with your indoor units over your local LAN, no need to involve the KumoCloud service (though they are phoning home to keep the app up to date). The only time we need to talk to KumoCloud is to retrieve the above configuration file.

Thanks for that. I’m stuck now on trying to get HASS.IO to recognize and use the python scripts. I tried dropping it in the /configuration folder without luck. Is this supposed to go into the master python install? I haven’t found any documentation on where that even is in the HASS.IO install. Any help/thoughts would be appreciated. Thanks.

A little bit more research and I’m going to take myself out of this test. Apparently the only way to get the .py scripts installed is to write it write into my HASS.IO docker image. I’m not really sure I’m comfortable doing that at this point. Installing custom python packages edits

Anyhow, @parkercat - would appreciate an update in this thread when you are able to submit the library to PyPI and this automagically resolves itself. Thanks.

I’ve made a couple minor improvements:

  • w_param and s_param are no longer configuration params since they’re constants
  • A new script to fetch the required configuration from your KumoCloud account. It spits out the required configuration.yaml lines. No need to install KumoJS at all anymore!

Be sure to fetch the latest from both repos to try it out.

@James_Huang I’ve never used HASS.IO myself so I have no advice for you. I suspect we’re quite a ways from pykumo being ready to be an actual PyPI module – principally because I’ve never done it before, but also because it’s still in flux.

@Sean_Hollister KumoJS is no longer needed, if you’re still interested in giving this a try.