dlarrick / hass-kumo

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

Invalid Credentials, Wrong user or password #109

Closed jimmykyle closed 8 months ago

jimmykyle commented 1 year ago

I have searched to no avail. Maybe i am doing something silly but I can not get past log in. I have reset my password as well as just updating my password in the Kumo app and the integration will not recognize my credentials.

dlarrick commented 1 year ago

Try following the instructions at https://github.com/dlarrick/pykumo#interactive-use -- do your credentials work there? If so, there's something wrong on the Home Assistant side. If not, well, you may be able to pick apart what's going on if you have any Python skills.

RandyTidd commented 1 year ago

Hi @dlarrick,

I'm having the same symptoms as @jimmykyle. I have no Python skills, but I tried the interactive use anyway. :)

I think my issue is this code does not handle the absence of the address field for a unit, and mine do not have the field: Pass On Missing Address

Config flow calls validate_input, which calls account.try_setup, and this fails because it returns False when it finds the unit count is zero and InvalidAuth is raised as a result.

I see that missing ip addresses are handled with custom parsing here. It seems if we add this handling to _parse_unit in pykumo, my problem might be solved, It looks like there is also an opportunity to remove this custom code and use the pykumo's get_all_units() instead, but maybe there are other reasons this is done this way?

RandyTidd commented 1 year ago

I tried modifying /usr/lib/python3.10/site-packages/pykumo/py_kumo_cloud_account.py. This allowed me to call account.get_outdoor_units() to get the serial number keys in the interactive use way. Now account.try_setup() now returns True, but that didn't fix my login problem in the integration like I suspected above. Is there anything else I have to do to get the integration to pick up the code change?

I can dig into this further, but I'm ignorant on how to get logging working for the integration. Any tips or instructions for getting that working would be of great help.

Edit: It seems there is another copy in the home assistant docker container, but modifying this also doesn't seem to have any effect on the integration. Any tips on how to update pykumo locally to experiment and debut when installing the integration appreciated.

thomashillyer commented 10 months ago

I’m seeing this issue too. I’m wondering if you still see this?

do you have a mini split system or an indoor outdoor system? I’m wondering if this integration is tightly designed for mini splits only and doesn’t work for my with a PVA indoor air handler. I’ll try and look into it more this weekend for my specific fail

RandyTidd commented 10 months ago

I came back to this after a month or so to take another pass at messing with the code, but the issue had gone away and I was able to log in. The plugin has been working fairly well since. I did the option to cache things during setup, and I don't think the plugin tries to login again after that (but I don't really know).

I think it's called a mini-split: I have an indoor air handler and an additional head unit in the living room all served by a single outdoor unit. FWIW, the air handler has the wireless adapter and an MHK2 while the head unit has the wireless adapter and a remote temp. sensor. I can control both units with the plugin.

thomashillyer commented 10 months ago

Hmm ok thanks for clarifying. Mine only has the air handler with wireless adapter and MHK2 (plus kumo cloud adapter). It still won't login when I try to add this integration. Same user and pass works to login to web kumo and the app version.

I did once see a log that said "no json returned" but now I don't see any logs from this integration when I try (and fail) to set it up.

thomashillyer commented 10 months ago

@RandyTidd your comment about trying to edit the kumo_cloud_account.py put me onto a fix it seems.

And for logging, I was not able to get great logs from the integration but I found that I could turn on the logging by editing home assistant/configuration.yaml like so:

logger:
  default: info
  logs:
    custom_components.hacs: debug # for hacs
    aiogithubapi: debug # also for hacs
    custom_components.kumo: debug
thomashillyer commented 10 months ago

I tried to add logs to kumo_cloud_setup.py by doing kumo.log.debug() instead of the print()s but that didn't seem to work. Might have better luck to do _LOGGER.debug("foobar") where _LOGGER is set as logging.getLogger(__name__)

bbordelon commented 10 months ago

I'm also getting stuck at the initial setup of this integration. I can log into the iOS app and the app.kumocloud.com website, but using the same credentials in HA results in the "Invalid Credentials, Wrong user or password" error. I also followed the instructions at https://github.com/dlarrick/pykumo#interactive-use and was able to log in and list my interior units. Repeated attempts yield the same result, with nothing appearing in the logs.

dlarrick commented 10 months ago

If it works in pykumo interactive use the issue has to be in core HomeAssistant, We're not doing anything special, just prompting for the password and storing it in the config.

These credentials appear to be stored by HA in plain text in {your HA directory}/.storage/core.config_entries. Search for kumo. Is the username / password listed correctly there?

bbordelon commented 10 months ago

It doesn't appear that the config flow gets to the point where it stores the credentials in core.config_entries. Searched for kumo and nothing's there (yet?). Tried another config setup and the username/password still aren't in there.

EDIT: I've also run account.try_setup() in the virtual environment for the interactive pykumo library and it returns "True".

EDIT EDIT: I had added a few lines of debug output to the source code, rebooted HA, and it magically worked. 🤷‍♂️ I've got local cache turned on so hopefully it won't need to authenticate again.

mt0321 commented 10 months ago

I ran into this too. I was able to work around it by commenting out all the lines in validate_input in config_flow.py except for the return line. (Note: needed to remove the __pycache__ directory and restart HA after making the changes.)

That allowed the logic in async_step_user to proceed, and I was presented with a dialog indicating the Kumo Cloud didn't know the IP address of the unit. I entered the device's local IP address, and setup completed successfully.

Using pykumo interactive around a similar time period, this is what I saw. My get_raw_json() output is included below with the sensitive pieces redacted. Does this help debug the root cause?

pykumo interactive log

``` >>> import pykumo >>> account = pykumo.KumoCloudAccount.Factory() >>> account.try_setup() False >>> account.get_indoor_units() [] >>> account.get_raw_json() [{ 'token': 'REDACTED', 'username': 'redacted@example.com', 'device': None, 'emailIsVerified': True }, { 'lastUpdate': 1694539894361 }, { 'lastScheduleChange': 0, 'zoneTable': {}, 'children': [{ 'lastScheduleChange': 0, 'zoneTable': { 'REDACTEDSERIAL1': { 'serial': 'REDACTEDSERIAL1', 'mac': '24:99:99:99:99:99', 'label': 'Main', 'port': 80, '_isNew': True, 'unitType': 'mvz', 'reportedCondition': { 'more': { 'fan_speed_text': 'Auto', 'air_direction_text': 'Position 5', 'power_on': True }, '_created': 1694583239550, 'id': '2222222222222222', 'record_time': '2023-09-13T05:33:37.664Z', 'device_serial': 'REDACTEDSERIAL1', 'it_status': None, 'rssi': -60, 'power': 1, 'operation_mode': 33, 'set_temp': None, 'set_temp_a': None, 'fan_speed': 0, 'air_direction': 5, 'prohibit_local_remote_control': None, 'room_temp': 24.5, 'room_temp_beyond': None, 'room_temp_a': None, 'out_of_use': None, 'unusual_figures': 32768, 'two_figures_code': 'A0', 'status_display': { 'filter': False, 'standby': False, 'hot_adjust': False, 'defrost': False }, 'actual_fan_speed': None, 'sp_cool': 25.5, 'sp_heat': 22, 'sp_auto': -1, 'raw_frames': None, 'run_test': 0, 'active_thermistor': None, 'temp_source': None, 'seconds_since_contact': 22 }, 'desiredConditionStack': [], 'lastUpdate': 1694583179487, '_requestRescan': 3, '_isRespondingLocally': None, 'overrideSettings': { 'dryMode': True, 'heatMode': True }, 'forceCloudUpdates': False, 'errorHandler': None, 'equipmentControllerSettings': {}, 'eqcStageThreeBacksupChannels': { '1': 0, '2': 0, '3': 0, '4': 0 }, 'eqcUpdatedLocally': { '1': False, '2': False, '3': False, '4': False }, 'mhk2Settings': { 'auto': { 'owner': 'adapter', 'status': 'active', 'heatSetpoint': 22, 'coolSetpoint': 25.5 }, 'connected': { 'thermostat': True, 'thermostatBattery': 'ok', 'outdoorAir': False, 'outdoorAirBattery': 'unset', 'indoorAir': False, 'indoorAirBattery': 'unset' }, 'dr': { 'override': False, 'event': 'none' }, 'hold': { 'adapter': { 'cancelMHK2': False, 'endTime': 0 }, 'mhk2': { 'cancelAdapter': False, 'endTime': 0 } }, 'info': { 'model': 'MHK2', 'serial': 'REDACTED', 'firmware': '1.1.1' }, 'schedule': { 'owner': 'adapter', 'enabled': 'disabled' }, 'status': { 'outdoorTemp': 0, 'outdoorHumid': None, 'indoorHumid': 52 } }, 'acoilSettings': { 'isAcoil': False, 'inputs': { 'humidistat': False, 'ervSwitch': False, 'floatSwitchWet': False }, 'outputs': { 'w1': False, 'w2': False, 'y': False, 'g': False, 'erv': False, 'humidifer': False, 'heartbeat': False }, 'humidifier': { 'targetPcr': 0, 'source': None, 'enable': False }, 'erv': { 'mode': 'classic' }, 'ytoo': { 'fan': False, 'humidifier': False, 'erv': False }, 'cbp': 0, 'oat': 0, 'bpcr': 'off', 'ebp': False, 'fDelay': 0 }, 'autoDrySettings': { 'isAutoDry': True, 'enable': False, 'targetHumid': 60, 'overcool': 1.5, 'offset': 4, 'active': False, 'lastUpdated': 1694581524879, 'hasUpdated': True, 'overcoolShow': 3, 'offsetShow': 8 }, 'kumoSensorSettings': { 'battery': None, 'humidity': None, 'rssi': None, 'temperature': None, 'txPower': None, 'uuid': None, 'lastUpdated': '2023-09-13T05:00:13.630Z' }, 'systemChangeoverSettings': { 'masterZone': { 'minRuntime': 20, 'maxStandby': 180, 'disable': 'notset', 'activeMode': None, 'durActive': None, 'durInactive': None }, 'priority': 1 }, 'programEventSettings': { '1': { 'inUse': False, 'optimalStart': None, 'day': '', 'time': '0000', 'active': False, 'lastUpdated': '2023-09-13 04:49:37.079381', 'settings': { 'spCool': None, 'spHeat': None, 'vaneDir': 'auto', 'fanSpeed': 'auto', 'mode': 'heat' } }, '2': { 'inUse': False, 'optimalStart': None, 'day': '', 'time': '0000', 'active': False, 'lastUpdated': '2023-09-13 04:49:37.079381', 'settings': { 'spCool': None, 'spHeat': None, 'vaneDir': 'auto', 'fanSpeed': 'auto', 'mode': 'heat' } }, '3': { 'inUse': False, 'optimalStart': None, 'day': '', 'time': '0000', 'active': False, 'lastUpdated': '2023-09-13 04:49:37.079381', 'settings': { 'spCool': None, 'spHeat': None, 'vaneDir': 'auto', 'fanSpeed': 'auto', 'mode': 'heat' } }, '4': { 'inUse': False, 'optimalStart': None, 'day': '', 'time': '0000', 'active': False, 'lastUpdated': '2023-09-13 04:49:37.079381', 'settings': { 'spCool': None, 'spHeat': None, 'vaneDir': 'auto', 'fanSpeed': 'auto', 'mode': 'heat' } }, '5': { 'inUse': False, 'optimalStart': None, 'day': '', 'time': '0000', 'active': False, 'lastUpdated': '2023-09-13 04:49:37.079381', 'settings': { 'spCool': None, 'spHeat': None, 'vaneDir': 'auto', 'fanSpeed': 'auto', 'mode': 'heat' } }, '6': { 'inUse': False, 'optimalStart': None, 'day': '', 'time': '0000', 'active': False, 'lastUpdated': '2023-09-13 04:49:37.079381', 'settings': { 'spCool': None, 'spHeat': None, 'vaneDir': 'auto', 'fanSpeed': 'auto', 'mode': 'heat' } }, '7': { 'inUse': False, 'optimalStart': None, 'day': '', 'time': '0000', 'active': False, 'lastUpdated': '2023-09-13 04:49:37.079381', 'settings': { 'spCool': None, 'spHeat': None, 'vaneDir': 'auto', 'fanSpeed': 'auto', 'mode': 'heat' } }, '8': { 'inUse': False, 'optimalStart': None, 'day': '', 'time': '0000', 'active': False, 'lastUpdated': '2023-09-13 04:49:34.793584', 'settings': { 'spCool': None, 'spHeat': None, 'vaneDir': 'auto', 'fanSpeed': 'auto', 'mode': 'heat' } }, '9': { 'inUse': False, 'optimalStart': None, 'day': '', 'time': '0000', 'active': False, 'lastUpdated': '2023-09-13 04:49:34.793584', 'settings': { 'spCool': None, 'spHeat': None, 'vaneDir': 'auto', 'fanSpeed': 'auto', 'mode': 'heat' } }, '10': { 'inUse': False, 'optimalStart': None, 'day': '', 'time': '0000', 'active': False, 'lastUpdated': '2023-09-13 04:49:34.793584', 'settings': { 'spCool': None, 'spHeat': None, 'vaneDir': 'auto', 'fanSpeed': 'auto', 'mode': 'heat' } }, '11': { 'inUse': False, 'optimalStart': None, 'day': '', 'time': '0000', 'active': False, 'lastUpdated': '2023-09-13 04:49:34.793584', 'settings': { 'spCool': None, 'spHeat': None, 'vaneDir': 'auto', 'fanSpeed': 'auto', 'mode': 'heat' } }, '12': { 'inUse': False, 'optimalStart': None, 'day': '', 'time': '0000', 'active': False, 'lastUpdated': '2023-09-13 04:49:34.793584', 'settings': { 'spCool': None, 'spHeat': None, 'vaneDir': 'auto', 'fanSpeed': 'auto', 'mode': 'heat' } }, '13': { 'inUse': False, 'optimalStart': None, 'day': '', 'time': '0000', 'active': False, 'lastUpdated': '2023-09-13 04:49:34.793584', 'settings': { 'spCool': None, 'spHeat': None, 'vaneDir': 'auto', 'fanSpeed': 'auto', 'mode': 'heat' } }, '14': { 'inUse': False, 'optimalStart': None, 'day': '', 'time': '0000', 'active': False, 'lastUpdated': '2023-09-13 04:49:34.793584', 'settings': { 'spCool': None, 'spHeat': None, 'vaneDir': 'auto', 'fanSpeed': 'auto', 'mode': 'heat' } }, '15': { 'inUse': False, 'optimalStart': None, 'day': '', 'time': '0000', 'active': False, 'lastUpdated': '2023-09-13 04:49:36.468428', 'settings': { 'spCool': None, 'spHeat': None, 'vaneDir': 'auto', 'fanSpeed': 'auto', 'mode': 'heat' } }, '16': { 'inUse': False, 'optimalStart': None, 'day': '', 'time': '0000', 'active': False, 'lastUpdated': '2023-09-13 04:49:36.468428', 'settings': { 'spCool': None, 'spHeat': None, 'vaneDir': 'auto', 'fanSpeed': 'auto', 'mode': 'heat' } }, '17': { 'inUse': False, 'optimalStart': None, 'day': '', 'time': '0000', 'active': False, 'lastUpdated': '2023-09-13 04:49:36.468428', 'settings': { 'spCool': None, 'spHeat': None, 'vaneDir': 'auto', 'fanSpeed': 'auto', 'mode': 'heat' } }, '18': { 'inUse': False, 'optimalStart': None, 'day': '', 'time': '0000', 'active': False, 'lastUpdated': '2023-09-13 04:49:36.468428', 'settings': { 'spCool': None, 'spHeat': None, 'vaneDir': 'auto', 'fanSpeed': 'auto', 'mode': 'heat' } }, '19': { 'inUse': False, 'optimalStart': None, 'day': '', 'time': '0000', 'active': False, 'lastUpdated': '2023-09-13 04:49:36.468428', 'settings': { 'spCool': None, 'spHeat': None, 'vaneDir': 'auto', 'fanSpeed': 'auto', 'mode': 'heat' } }, '20': { 'inUse': False, 'optimalStart': None, 'day': '', 'time': '0000', 'active': False, 'lastUpdated': '2023-09-13 04:49:36.468428', 'settings': { 'spCool': None, 'spHeat': None, 'vaneDir': 'auto', 'fanSpeed': 'auto', 'mode': 'heat' } }, '21': { 'inUse': False, 'optimalStart': None, 'day': '', 'time': '0000', 'active': False, 'lastUpdated': '2023-09-13 04:49:36.468428', 'settings': { 'spCool': None, 'spHeat': None, 'vaneDir': 'auto', 'fanSpeed': 'auto', 'mode': 'heat' } }, '22': { 'inUse': False, 'optimalStart': None, 'day': '', 'time': '0000', 'active': False, 'lastUpdated': '2023-09-13 04:49:35.398189', 'settings': { 'spCool': None, 'spHeat': None, 'vaneDir': 'auto', 'fanSpeed': 'auto', 'mode': 'heat' } }, '23': { 'inUse': False, 'optimalStart': None, 'day': '', 'time': '0000', 'active': False, 'lastUpdated': '2023-09-13 04:49:35.398189', 'settings': { 'spCool': None, 'spHeat': None, 'vaneDir': 'auto', 'fanSpeed': 'auto', 'mode': 'heat' } }, '24': { 'inUse': False, 'optimalStart': None, 'day': '', 'time': '0000', 'active': False, 'lastUpdated': '2023-09-13 04:49:35.398189', 'settings': { 'spCool': None, 'spHeat': None, 'vaneDir': 'auto', 'fanSpeed': 'auto', 'mode': 'heat' } }, '25': { 'inUse': False, 'optimalStart': None, 'day': '', 'time': '0000', 'active': False, 'lastUpdated': '2023-09-13 04:49:35.398189', 'settings': { 'spCool': None, 'spHeat': None, 'vaneDir': 'auto', 'fanSpeed': 'auto', 'mode': 'heat' } }, '26': { 'inUse': False, 'optimalStart': None, 'day': '', 'time': '0000', 'active': False, 'lastUpdated': '2023-09-13 04:49:35.398189', 'settings': { 'spCool': None, 'spHeat': None, 'vaneDir': 'auto', 'fanSpeed': 'auto', 'mode': 'heat' } }, '27': { 'inUse': False, 'optimalStart': None, 'day': '', 'time': '0000', 'active': False, 'lastUpdated': '2023-09-13 04:49:35.398189', 'settings': { 'spCool': None, 'spHeat': None, 'vaneDir': 'auto', 'fanSpeed': 'auto', 'mode': 'heat' } }, '28': { 'inUse': False, 'optimalStart': None, 'day': '', 'time': '0000', 'active': False, 'lastUpdated': '2023-09-13 04:49:35.398189', 'settings': { 'spCool': None, 'spHeat': None, 'vaneDir': 'auto', 'fanSpeed': 'auto', 'mode': 'heat' } } }, 'prohibits': { 'global': { 'power': False, 'mode': False, 'setpoint': False }, 'local': { 'power': False, 'mode': False, 'setpoint': False }, 'effective': { 'power': False, 'mode': False, 'setpoint': False } }, 'prohibitsChanged': 0, 'holdChanged': 0, 'hasElectricHeatingOption': False, 'rssi': { 'rssi': -60, 'string': 'Strong', 'image': 'images/signal-strong-ondark-50x50.svg' }, 'ledDisabled': False, 'cryptoSerial': '__REDACTED__', 'cryptoKeySet': 'F', 'timezone': 'America/Los_Angeles', 'lastAdapterUpdate': '2023-09-13 05:33:36.400629', 'firmwareVersion': '02.06.12', 'autoModeEnabled': True, 'roomTempOffset': 0, 'password': '__REDACTED__', 'reportedInitialSettings': { 'assigned_settings': { '1': 2, '2': 1, '3': 1, '4': 1, '5': 2, '7': 3, '8': 1, '10': 1, '11': 1, '12': 1, '13': 2, '15': 1, '16': 1, '17': 1, '23': 1, '24': 1, '25': 1, '26': 1, '27': 1, '28': 2 }, 'restart_after_outage': 2, 'vent_air': 1, 'voltage': 1, 'energy_save': 2, 'filter_alerts': 3, 'auto_fan': 1, 'pla_outlets': 0, 'filter_type': 1, 'frost_temp': 1, 'defrost': 1, 'oscillate': 1, 'heating_offset': 1, 'thermal_off1': 1, 'thermal_off2': 1, 'pressure1': 1, 'pressure2': 1, 'electric_heater1': 1, 'electric_heater2': 1, 'humidifier': 2, 'humidifier_modifier': 1, 'leftovers_settings': { '2': 1, '6': 0, '12': 1, '14': 0, '18': 0, '19': 0, '20': 0, '21': 0, '22': 0, '26': 1, '28': 2, '29': 0, '30': 0, '31': 0 } }, 'reportedProfile': { 'fan_speed_stages': 3, 'has_air_direction': False, 'has_auto_fan_speed': True, 'has_dry_function': True, 'has_extended_temp_range': True, 'has_heat_function': True, 'has_swing_direction': False, 'has_test_run': True, 'has_unit_function_setting': True, 'has_ventilation_function': True, 'maximum_auto_temp': 28, 'maximum_cool_or_dry_temp': 30, 'maximum_heat_temp': 28, 'minimum_auto_temp': 19, 'minimum_cool_or_dry_temp': 19, 'minimum_heat_temp': 10 }, 'unconfigured': True, 'minCoolSetpoint': 19, 'maxHeatSetpoint': 28, 'sendDesiredConditionsPending': True, 'sendDesiredConditionsTime': '2023-09-13T04:50:39.733Z', 'isNewMVZ': False, 'systemChangeoverEnabled': False, '$$hashKey': 'object:1743', 'autoChangeoverEnabled': True, 'mvzType': 'vert', 'autoDryModeCapable': 1 } }, 'children': [], 'level': 2, 'label': 'Home', 'v1.2+': 1, 'id': '1694532222222-2222222222', 'lastUpdate': 1694539384297, 'network': { 'name': '__REDACTED__', 'password': '' }, '$$hashKey': 'object:2424' } ], 'lastUpdate': 1694670032865, 'level': 1, 'v1.2+': 1, 'id': '1694539894364-1488002267', 'label': 'Home', 'version': 110 }, 'no device token', { 'userDetails': { 'firstName': '__REDACTED__', 'lastName': '__REDACTED__', 'phone': '5555555555', 'email': 'redacted@example.com', 'IsPersonAccount': True }, 'siteDetails': [] } ] ```

Oddly, account.get_indoor_units() returns an empty list, yet: 1) the set up via Home Assistant (on a different computer) worked OK after making the config_flow.py edits I mentioned, 2) my indoor unit is listed in the raw JSON.

I am also finding that, using pykumo interactive, sometimes running this series of commands (and entering the same credentials each time, in new python shells) is resulting in False, and other times True!

import pykumo
account = pykumo.KumoCloudAccount.Factory()
account.try_setup()

(Using pykumo 0.3.7 from PIP.)

dlarrick commented 10 months ago

Thanks for the interactive log. It may well give me a clue of what's going on.

Edit: I think what's happening is that the server response is sometimes missing various fields that we need. Pykumo and the integration's config flow could both benefit from being more robust to these missing fields, though with varying degrees of success in actually making a working config.

gregparsons commented 9 months ago

Same authentication error in HA. pykumo login appears to work fine (with an empty command line after password entry). account.get_indoor_units() returns []. I have four units. Anything else I should try? Also, account.try_setup() returns False.

KazWolfe commented 9 months ago

Just got a newly installed unit, and can report similar behavior. Doing some digging into interactive mode reveals this is likely a problem with the upstream pykumo library getting annoyed with Kumo Cloud:

>>> list(account.get_raw_json()[2]['children'][0]['zoneTable'].values())[0]['label']
'Whole Home'
>>> list(account.get_raw_json()[2]['children'][0]['zoneTable'].values())[0]['address']
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
KeyError: 'address'

As a test, I changed the pass statements in both _parse_unit and _fetch_if_needed to a log warning just to track the exception. Doing this made the library work partially:

>>> import pykumo
>>> account = pykumo.KumoCloudAccount.Factory()
Kumo Cloud username: <REDACTED>
Password: 
>>> account.get_indoor_units()
KeyError in parse_unit: 'address'
KeyError in parse_unit: 'address'
KeyError in parse_unit: 'address'
['<REDACTED>']
>>> account.try_setup()
KeyError in parse_unit: 'address'
True

Swapping the _parse_unit pass back in, and things get more breaky:

>>> import pykumo
>>> account = pykumo.KumoCloudAccount.Factory()
Kumo Cloud username: <REDACTED>
Password: 
>>> account.get_indoor_units()
KeyError in _fetch_if_needed: 'serial'
[]
>>> account.try_setup()
KeyError in _fetch_if_needed: 'serial'
False

I can submit a PR to better handle this case and log instead of pass if that feels like it can help? (Although perhaps it's better to move the try-catch into the _parse_unit for loop? I'm unsure how essential those fields are.)

EDIT: Apparently, trying this later works, even with address still not being set? Weird.

bhaggs commented 8 months ago

Running into the same issue attempting to connect to my ducted unit. Was able to authenticate via the pykumo package in a virtual environment but running into the no IP address for the unit. Also noticing what @mt0321 ran into with authenticating behaving inconsistently between shells despite no changes being done to the code. Happy to help debug but unsure where best to start exploring to track down the issue.

mt0321 commented 8 months ago

@dlarrick I have at least a partial answer. I found a source of nondeterminism between runs that can lead to units randomly failing to parse when a single field (e.g. the IP 'address') is not present. Submitted a pull request to fix: https://github.com/dlarrick/pykumo/pull/47


Sharing a couple additional observations in case they help:

  1. I was tinkering with pykumo a bunch, and never once have I seen an "address" for my unit in account.get_raw_json(). Is it possible the Kumo Cloud API has stopped returning the local IP address for units entirely (given the number of folks experiencing this issue in recent months)? I know the Kumo app is supposed to be able to work offline too, so not sure how that functionality would still work if this is the case. (I am using an SVZ indoor air handler.)
  2. On a newly created zone, the unit's reportedCondition was empty for me until I used the Kumo Cloud app to change the temperature set point for the first time. Just an FYI.
bhaggs commented 8 months ago

@mt0321 I also have an SVZ indoor unit (SVZ-KA30NA2 to be specific) and it's my only unit associated with Kumo so am unsure if possibly this issue is specific to certain unit type classes.

bhaggs commented 8 months ago

Update all works for me now. Used the manual IP assignment. Thanks!