dlarrick / hass-kumo

Home Assistant module interfacing with Mitsubishi mini-split units
MIT License
94 stars 20 forks source link

Unable to log into kumo cloud for new installation #104

Closed mgulick closed 1 year ago

mgulick commented 1 year ago

I've tried the 0.3.3 release as well as the 0.3.4 beta, and in both versions my login credentials are not accepted. I tried changing my password to not include any special characters (after reading #75), but that did not help.

I noticed that https://app.kumocloud.com/login and https://geo-c.kumocloud.com/login both return "404 Not Found" in my browser. I can however log into the kumo cloud web site at https://app.kumocloud.com/#/login.

I looked at the request headers via chromium's debugger when logging into https://app.kumocloud.com, and I can see that it's sending a POST request to https://geo-c.kumocloud.com/login, which returns 200 OK, so I'm not sure exactly what's going wrong. I'm entering the password correctly (copied from my password manager).

dlarrick commented 1 year ago

The 404 from your browser accessing the 2 login URLs is normal. The request the API wants is a POST, not a GET like a browser uses.

If you're OK with a little Python, you can cut out the Home Assistant overhead for debug purposes by following the interactive use instructions at https://github.com/dlarrick/pykumo#interactive-use . If that works it's possible HomeAssistant's forms are mangling your username or password. This worked for me just this morning so I know those instructions are up to date.

But first I'd advise you to just try again. The Kumo Cloud service is not known to be all that reliable.

mgulick commented 1 year ago

Thanks. That did help determine why it was failing. I could see that I was authenticating correctly, but account.get_indoor_units() was returning an empty list. Digging into this a little further, I could see that the raw json dictionaries for the units were missing the 'address' field. I'm not sure why this would be. Here's a list of the fields for one of the indoor units:

>>> account.get_raw_json()[2]['children'][0]['zoneTable']['2834P008A100007F'].keys()
dict_keys(['serial', 'mac', 'label', 'port', '_isNew', 'unitType', 'reportedCondition', 'desiredConditionStack', 'lastUpdate', '_requestRescan', '_isRespondingLocally', 'overrideSettings', 'forceCloudUpdates', 'errorHandler', 'equipmentControllerSettings', 'eqcStageThreeBacksupChannels', 'eqcUpdatedLocally', 'mhk2Settings', 'acoilSettings', 'systemChangeoverSettings', 'programEventSettings', 'prohibits', 'prohibitsChanged', 'holdChanged', 'hasElectricHeatingOption', 'rssi', 'ledDisabled', 'cryptoSerial', 'cryptoKeySet', 'timezone', 'lastAdapterUpdate', 'firmwareVersion', 'autoModeEnabled', 'roomTempOffset', 'password', 'reportedInitialSettings', 'reportedProfile', 'sendDesiredConditionsPending', 'sendDesiredConditionsTime', 'isNewMVZ', 'mvzType', 'systemChangeoverEnabled', 'minCoolSetpoint', 'maxHeatSetpoint', 'kumoSensorSettings', '$$hashKey', 'autoChangeoverEnabled', 'optimalStart'])

I tried refreshing the settings via the kumo cloud app, but it didn't help. I did assign the units a fixed IP in my DHCP server, and I'm pretty sure they're using that IP address now, although an nmap port scan on those IPs shows no ports open.

Maybe I'll try turning the units completely off and back on again (at some point in the next day or two, when it is warmer out).

Also strange is that one of the two indoor units reports itself as ductless, and the other reports as ducted. Both of my indoor units are ducted air handlers. I wonder if the installer somehow messed up the initial setup in kumo cloud. The install was just completed 2 days ago, so I might give them a call about that.

dlarrick commented 1 year ago

I tried refreshing the settings via the kumo cloud app

As in https://github.com/dlarrick/hass-kumo#ip-addresses ? If not, try that. The installer-mode PIN is hardcoded to 9999. Otherwise:

mgulick commented 1 year ago

Thanks for the help! This definitely seems to be an issue specific to my configuration, not a pykumo issue. After manually setting the unit ip addresses in the raw data before calling account.make_pykumos(), I was able to make this work:

>>> import pykumo
>>> account = pykumo.KumoCloudAccount.Factory()
>>> account.try_setup()
False
>>> account._kumo_dict[2]["children"][0]["zoneTable"]["2834P008A100007F"]["address"]="192.168.30.10"
>>> account._kumo_dict[2]["children"][0]["zoneTable"]["2834P0084100066F"]["address"]="192.168.30.11"
>>> account._kumo_dict[2]["children"][0]["zoneTable"]["2834P0084100054F"]["address"]="192.168.30.12"
>>> kumos = account.make_pykumos()
>>> kumos
{'2nd Floor': <pykumo.py_kumo.PyKumo object at 0x7f98da183250>, '1st Floor': <pykumo.py_kumo.PyKumo object at 0x7f98d9b8cf10>, 'Kumo Station': <pykumo.py_kumo_station.PyKumoStation object at 0x7f98d9b8dfd0>}
>>> fir=kumos['1st Floor']
>>> fir.get_status()
{'roomTemp': 17.5, 'mode': 'heat', 'spCool': 22, 'spHeat': 17.5, 'vaneDir': 'auto', 'fanSpeed': 'powerful', 'tempSource': 'sensor0', 'activeThermistor': 'sensor0', 'filterDirty': False, 'hotAdjust': False, 'defrost': False, 'standby': False, 'runTest': 0}

I still struggled for a lot longer than I should have because I kept being unable to communicate with the units after configuring the IP addresses (i.e. account.make_pykumos() failed with network timeout errors. The kumo wifi interfaces are on a separate IOT VLAN and subnet. It turned out (after a few hours of messing with my router's firewall settings) that the docker bridge running on my local system happened to be configured with an overlapping with the IP range of that IOT subnet, which caused all packets to that subnet to be routed to the docker bridge instead of the physical IOT VLAN. Live and learn...

Thanks for the help. I'll close this issue now.