merdok / homebridge-miot

Homebridge plugin for devices supporting the Xiaomi miot protocol
MIT License
399 stars 64 forks source link

Geting "Log into Mi Cloud!" error, but following 2FA directions doesn't seem to work. #628

Closed Jozer99 closed 1 week ago

Jozer99 commented 2 months ago

Describe the bug Homebridge miot gives a "Log into Mi Cloud!" error and does not get status from devices. Plugin is configured with the correct login information. Using the "Discover Devices" option, I get the 2FA warning, click the button, and complete the 2FA response. The plugin still is not able to connect to Mi Cloud and gives the error/prompt to try 2FA again (which produces the same result). I am able to log into Mi Cloud in my browser and on my phone successfully.

No useful information is provided in the debug log.

Expected behavior The plugin should be able to log into my Mi Cloud account and pull sensor data.

Your config.json

{
            "micloud": {
                "username": "XXXX",
                "password": "XXXX",
                "country": "cn",
                "forceMiCloud": true
            },
            "devices": [
                {
                    "name": "CGS1 Air Quality",
                    "ip": "192.168.XXX.XXX",
                    "token": "XXXX",
                    "model": "cgllc.airmonitor.s1",
                    "pollingInterval": 10,
                    "deepDebugLog": true,
                    "silentLog": false,
                    "deviceEnabled": true,
                    "micloud": {
                        "username": "XXXX",
                        "password": "XXXX",
                        "country": "cn",
                        "forceMiCloud": true
                    },
                    "buzzerControl": false,
                    "ledControl": false,
                    "childLockControl": false,
                    "modeControl": false,
                    "co2AbnormalThreshold": 1000
                }
            ],
            "platform": "miot"
        }

Debug log

`[08/09/2024, 00:46:58] [miot] [CGS1 Air Quality] Using module class for device type AirMonitor, indentified by miot spec! Not all features might work!
[08/09/2024, 00:46:58] [miot] [CGS1 Air Quality] Initializing device services
[08/09/2024, 00:46:58] [miot] [CGS1 Air Quality] Device services: [
  "environment",
  "battery"
]
[08/09/2024, 00:46:58] [miot] [CGS1 Air Quality] Initializing device properties
[08/09/2024, 00:46:58] [miot] [CGS1 Air Quality] Device properties: [
  "environment:relative-humidity",
  "environment:pm2.5-density",
  "environment:temperature",
  "environment:co2-density",
  "environment:tvoc-density",
  "battery:battery-level",
  "battery:charging-state"[08/09/2024, 00:46:58] [miot] [CGS1 Air Quality] Using module class for device type AirMonitor, indentified by miot spec! Not all features might work!
[08/09/2024, 00:46:58] [miot] [CGS1 Air Quality] Initializing device services
[08/09/2024, 00:46:58] [miot] [CGS1 Air Quality] Device services: [
  "environment",
  "battery"
]
[08/09/2024, 00:46:58] [miot] [CGS1 Air Quality] Initializing device properties
[08/09/2024, 00:46:58] [miot] [CGS1 Air Quality] Device properties: [
  "environment:relative-humidity",
  "environment:pm2.5-density",
  "environment:temperature",
  "environment:co2-density",
  "environment:tvoc-density",
  "battery:battery-level",
  "battery:charging-state"
]
[08/09/2024, 00:46:58] [miot] [CGS1 Air Quality] Initializing device actions
[08/09/2024, 00:46:58] [miot] [CGS1 Air Quality] Successfully created a AirMonitor device! It is a Unknown air monitor device.
[08/09/2024, 00:46:58] [miot] [CGS1 Air Quality] Initializing accessory!
[08/09/2024, 00:46:58] [miot] [CGS1 Air Quality] Accessory successfully initialized!
[08/09/2024, 00:46:58] [miot] [CGS1 Air Quality] Registering 1 accessories!
[08/09/2024, 00:46:58] [miot] [CGS1 Air Quality] Everything looks good! Initiating property polling!
[08/09/2024, 00:46:58] [miot] [CGS1 Air Quality] Log in to MiCloud!
]
[08/09/2024, 00:46:58] [miot] [CGS1 Air Quality] Initializing device actions
[08/09/2024, 00:46:58] [miot] [CGS1 Air Quality] Successfully created a AirMonitor device! It is a Unknown air monitor device.
[08/09/2024, 00:46:58] [miot] [CGS1 Air Quality] Initializing accessory!
[08/09/2024, 00:46:58] [miot] [CGS1 Air Quality] Accessory successfully initialized!
[08/09/2024, 00:46:58] [miot] [CGS1 Air Quality] Registering 1 accessories!
[08/09/2024, 00:46:58] [miot] [CGS1 Air Quality] Everything looks good! Initiating property polling!
[08/09/2024, 00:46:58] [miot] [CGS1 Air Quality] Log in to MiCloud!`

Screenshots If applicable, add screenshots to help explain your problem.

Additional context Add any other context about the problem here.

merdok commented 2 months ago

Please try to this method -> https://github.com/merdok/homebridge-miot/issues/618#issuecomment-2287932298

Jozer99 commented 2 months ago

Tried that, no joy.

merdok commented 2 months ago

Then you would need to investigate what works for you. Apparently it seems to vary from account to account...

Dean-negative-69 commented 1 month ago

it works for me, what i did is i login to my xiaomi app on my phone then i change my email address then the new email address i used it to log on to my xiaomi plugin in homebridge then it did not asked for 2FA. try it if will works for you