Mitsubishi Kumo Cloud Integration

Hey, I installed from HACS and it went well. I’m stuck though on the initialization. In the custom component folder, I found the kumo_cloud_setup.py file and I ran that manually to see what it would produce and it looks like the JSON that I get back from the Kumo Cloud server does not contain an address for a unit that is in a zone (I’ve started testing with just 1 unit named Master bed). Output below:

climate:

  • platform: kumo
    name: “Master bed”
    Traceback (most recent call last):
    File “kumo_cloud_setup.py”, line 38, in
    main()
    File “kumo_cloud_setup.py”, line 33, in main
    print(’ address: “%s”’ % zone[‘address’])
    KeyError: ‘address’

Where have I gone wrong here?

We had another user report being unable to find the IP address in the data returned from the KumoCloud service. You might search up-thread and see if they ever figured it out. A couple things to try:

  1. Does KumoCloud app on your phone work? See just a couple posts above yours for a report that using the app causes a refresh of the IP address.
  2. If you can see the adapter, do you see a blinking blue light? If it’s 4 quick blue flashes the unit is in Bluetooth mode, ready for setup. If it’s three slower flashes (or continuous flashes) it’s connected to WiFi, or thinks it is.
  3. If starting HA got as far as downloading a kumo_cache.json file, does that file contain the word “address” anywhere? You most definitely want the “prefer_cache” setting to be OFF until you have it working.

Hey all,

It’s been a while. But I’ve got some news.

Thanks to @omriasta we have a working Config Flow (GUI setup) for Kumo

If you’d like to help test it, go to HACS and find the “Reinstall” option (in the 3-dot menu) for Kumo. In the resulting dialog select the “Show beta versions” option and choose “beta-0.2.0” tag.

You’ll need to remove the “kumo” section from your config.yaml and re-add Kumo as a component. Be sure to have your KumoCloud credentials handy.

Please report successes & failures here. If all goes well I’ll promote this to release status within a few weeks.

The new beta using config flow will allow you to assign areas to each device. I only have one unit so can’t test how it behaves with multiple units. If you want to give it a go and let us know results?

Version 0.2.0 has been relesaed to HACS. Config Flow is out of beta. As a reminder, you’ll need to re-add Kumo via the GUI. You should clean up your configuration.yaml (and probably secrets.yaml) at the same time.

Adding units to areas of the house also seems to work fine now.

Should configuration.yaml still work? I just updated and left my configuration in place none of my entities showed up. When I roll back to 1.6 they came back. I found this error in the log as well:

2020-06-27 21:11:29 ERROR (MainThread) [homeassistant.setup] Error during setup of component kumo
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 190, in _async_setup_component
    result = await asyncio.wait_for(task, SLOW_SETUP_MAX_WAIT)
  File "/usr/local/lib/python3.7/asyncio/tasks.py", line 442, in wait_for
    return fut.result()
  File "/config/custom_components/kumo/__init__.py", line 131, in async_setup
    hass.data[KUMO_DATA] = KumoData(account, config[DOMAIN])
TypeError: __init__() missing 1 required positional argument: 'domain_options'

Yes, you need to re-add Kumo via the GUI. Configuration page -> Integrations, hit the “+” icon lower right, and search for Kumo. I don’t believe @omriasta made any effort to preserve configuration.yaml ability.

Gotcha, the documentation still implies configuration.yaml should work. @omriasta, can you confirm if this should work or not?

Actually the yaml was working alongside the GUI configuration when I started this. I think this may be caused by the last changes I made to incorporate the options dialog. @gregorymartin can you check the homeassistant log and see if there is an error that shows up there? I’m pretty sure it is probably related to ‘domain_options’ but would be helpful to see where on the code it’s coming from…
Nevermind, just saw the error above…I was right…I’ll see if I can fix this later…

@gregorymartin I added a PR to @parkercat that fixes the error for people still using the yaml configuration. @parkercat not sure if you want to add that in or “force” people onto the config flow (since this adds a device to the registry and conforms to homeassistant more).
THe PR is pretty small, it’s just a couple of things, I commented on what each of the changes are. Let me know if any questions.

I pushed a new version. Let me know how it goes.

That seems to have resolved what I was seeing. I’ll let you know if anything else happens that is unexpected. Thanks!

I updated to the latest build last night. Generally, things look pretty good. There are a couple of warnings spread throughout my log though: 2020-07-02 01:31:21 WARNING (SyncWorker_16) [pykumo.pykumo] Error retrieving status

Any idea what this generic message might mean? Thanks.

Try increasing the Connection Timeout param.

I’m still unable to make this usable. In the custom_components/kumo directory, I run python3 kumo_cloud_setup.py and plug in my authentication details and get:

# Configuration for Kumo units 'Home' for [my_kumo_cloud_login]
climate:
  - platform: kumo
    name: "Master bed"
Traceback (most recent call last):
  File "kumo_cloud_setup.py", line 38, in <module>
    main()
  File "kumo_cloud_setup.py", line 33, in main
    print('    address: "%s"' % zone['address'])
KeyError: 'address'

I am able to use the kumo cloud app on my phone to interact with all of the connected units and they all work fine so that is not really the issue. I know the IP address of all of the hvac units, maybe I can manually get this set up?

edit: in my log, this is what I see:

2020-07-04 07:16:00 ERROR (MainThread) [homeassistant.components.climate] Error while setting up kumo platform for climate
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/entity_platform.py", line 178, in _async_setup_platform
    await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT)
  File "/usr/lib/python3.8/asyncio/tasks.py", line 483, in wait_for
    return fut.result()
  File "/home/homeassistant/.homeassistant/custom_components/kumo/climate.py", line 145, in async_setup_platform
    kumo_api = pykumo.PyKumo(
  File "/srv/homeassistant/lib/python3.8/site-packages/pykumo/pykumo.py", line 35, in __init__
    'password': base64.b64decode(cfg_json["password"]),
TypeError: 'NoneType' object is not subscriptable

I note that (on restart) the kumo_cache.json file does get created with all of the details about each unit (including MAC address) but there is no IP address in that file?

To reply to myself, I did a packet capture on my router to see what traffic showed up to/from the device in question (reserved IP address) and turned the device on then off.

The only traffic that I saw was between the device and an AWS address. That traffic was all encrypted so I’m not really sure what to make of it.

I did one other test (to eliminate bluetooth). I turned bluetooth on my phone off and then turned on/off the unit and it all worked as expected.

I’m stumped

Stupid question: when you use the KumoCloud app, your phone is on WiFi, on the same network as the indoor unit(s), right?

The error you are seeing from kumo_cloud_setup.py is an indication there is no IP address in the data returned from the KumoCloud service.

You should see unencrypted traffic between your phone and the unit(s) when using the KumoCloud app. If you have multiple access points you might need to run packet capture on the phone to see it. If you don’t see this traffic, that’s an indication the service indeed has not learned of your units’ IP addresses for some reason.

duh. I should have figured that one out (regarding the wifi packet capture). I do have multiple APs so that packet capture wouldn’t show me anything.

Yes, everything is one the same network and from my HA box I can ping the address of the HVAC unit.

Should I do a packet capture on the phone?

Having trouble adding the configuration/integration. Get the following error after entering credentials:

[%key:common::config_flow::error::unknown%]

Logs show:

2020-07-09 13:44:55 ERROR (MainThread) [custom_components.kumo.config_flow] Unexpected exception
Traceback (most recent call last):
  File "/config/custom_components/kumo/config_flow.py", line 63, in async_step_user
    "prefer_cache": user_input["prefer_cache"],
KeyError: ‘prefer_cache’

Using release 0.2.1.

used the check box, [prefer cache]. this seems to allow the integration too proceed.