meross-homeassistant: Integraion stopped working with: mfaLockExpire error

Describe the bug I was able to control the garage MSG100s for years, and it recently stopped working. I deleted and re-added the integration but just receive the mfaLockExpire message.

Your environment HomeAssistant version: 2024.8.1 Hassio Version (if applicable): HAOS 13.0 Hardware environment: intel

Logs taken when the issue happened

Traceback (most recent call last):
  File "/config/custom_components/meross_cloud/config_flow.py", line 283, in async_step_configure_manager
    creds = await self._test_authorization(
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/meross_cloud/config_flow.py", line 383, in _test_authorization
    client = await MerossHttpClient.async_from_user_password(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/meross_iot/http_api.py", line 119, in async_from_user_password
    creds = await cls.async_login(email=email,
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/meross_iot/http_api.py", line 280, in async_login
    mfa_lock_expire=response_data["mfaLockExpire"],
                    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
KeyError: 'mfaLockExpire'

v. 1.3.2 of integration

[custom_components.meross_cloud.config_flow] Unable to connect to Meross HTTP api, ex: ‘mfaLockExpire’

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Comments: 17 (4 by maintainers)

Commits related to this issue

Most upvoted comments

@Pito83 and whomever else sees this, i took a look at the patched issue on the other repo and was able to patch meross-homeassistant using the following steps.

  1. Edit the following files in your custom_components/meross_cloud folder:

manifest.json: update version for meros_iot

{
  "domain": "meross_cloud",
  "name": "Meross Cloud IoT",
  "documentation": "https://www.home-assistant.io/components/meross_cloud",
  "issue_tracker": "https://github.com/albertogeniola/meross-homeassistant",
  "dependencies": ["persistent_notification"],
  "codeowners": ["@albertogeniola"],
  "requirements": ["meross_iot==0.4.7.3"],
  "config_flow": true,
  "quality_scale": "platinum",
  "iot_class": "cloud_push",
  "version": "1.3.2"
}

config_flow.py line 356: remove reference to mfa_lock_expire, since this is a configuration you can leave trailing comma

            CONF_STORED_CREDS: {
                "domain": creds.domain,
                "mqtt_domain": creds.mqtt_domain,
                "token": creds.token,
                "key": creds.key,
                "user_id": creds.user_id,
                "user_email": creds.user_email,
                "issued_on": creds.issued_on.isoformat(),
            },

init.py line 391: remove reference to mfa_lock_expire, since this is a constructor you do need remove preceding comma.

    creds = MerossCloudCreds(
        domain=str_creds.get("domain", MEROSS_DEFAULT_CLOUD_API_URL),
        mqtt_domain=str_creds.get("mqtt_domain"),
        token=str_creds.get("token"),
        key=str_creds.get("key"),
        user_id=str_creds.get("user_id"),
        user_email=str_creds.get("user_email"),
        issued_on=issued_on
    )
  1. remove everything from the pycache folder
 jason on jason-hyprland at …/__pycache__   sudo rm * -r
  1. restart home assistant and retry setup, you should notice a longer load time to get to configuration menu while new lib being downloaded and precompilation.

This worked for me, glhf.

Can you please try latest v1.3.3 and report if it’s now working as expected?

Thanks @jasonwitty. I opened a merge request for this (#514). Lets hope @albertogeniola finds time to merge this. :]