SteffeyDev / homebridge-hyundai-bluelink

Homebridge plugin for Hyundai BlueLink
Apache License 2.0
26 stars 13 forks source link

Does not work currently with EU Ioniq 5 #197

Open tvand opened 2 years ago

tvand commented 2 years ago

Describe The Bug: Error message on sign-in attempt (see logs)

To Reproduce: Configure EU vehicle with brand Hyundai

Expected behavior: Regular sign-in without error

Logs:

[6/10/2022, 2:32:36 PM] [Hyundai] Client Error R [ManagedBluelinkyError]: @EuropeController.login: [400] Bad Request on [POST] https://prd.eu-ccapi.hyundai.com:8080/api/v1/user/signin - {"errId":"6f0f511a-079d-4d58-8e54-031a2d7d3b00","errCode":"4003","errMsg":"Invalid values","errBody":{"userId":"","remainCount":4,"remainTime":300}}
    at U (/usr/local/lib/node_modules/homebridge-hyundai-bluelink/node_modules/bluelinky/dist/index.js:17:11700)
    at ne.<anonymous> (/usr/local/lib/node_modules/homebridge-hyundai-bluelink/node_modules/bluelinky/dist/index.js:17:39834)
    at Generator.throw (<anonymous>)
    at a (/usr/local/lib/node_modules/homebridge-hyundai-bluelink/node_modules/bluelinky/dist/index.js:17:136)
    at processTicksAndRejections (node:internal/process/task_queues:96:5) {
  source: GotError [HTTPError]: Response code 400 (Bad Request)
      at EventEmitter.<anonymous> (/usr/local/lib/node_modules/homebridge-hyundai-bluelink/node_modules/got/source/as-promise.js:74:19)
      at processTicksAndRejections (node:internal/process/task_queues:96:5) {
    host: 'prd.eu-ccapi.hyundai.com:8080',
    hostname: 'prd.eu-ccapi.hyundai.com',
    method: 'POST',
    path: '/api/v1/user/signin',
    socketPath: undefined,
    protocol: 'https:',
    url: 'https://prd.eu-ccapi.hyundai.com:8080/api/v1/user/signin',
    gotOptions: {
      path: '/api/v1/user/signin',
      protocol: 'https:',
      slashes: true,
      auth: null,
      host: 'prd.eu-ccapi.hyundai.com:8080',
      port: '8080',
      hostname: 'prd.eu-ccapi.hyundai.com',
      hash: null,
      search: null,
      query: null,
      pathname: '/api/v1/user/signin',
      href: 'https://prd.eu-ccapi.hyundai.com:8080/api/v1/user/signin',
      retry: [Object],
      headers: [Object],
      hooks: [Object],
      decompress: true,
      throwHttpErrors: true,
      followRedirect: true,
      stream: false,
      form: false,
      json: true,
      cache: false,
      useElectronNet: false,
      method: 'POST',
      body: '{"email":"xxxxxx","password":"yyyyyy"}',
      cookieJar: [CookieJar]
    },
    statusCode: 400,
    statusMessage: 'Bad Request',
    headers: {
      'ccsp-request-id': '6f0f511a-079d-4d58-8e54-031a2d7d3b00',
      'ccsp-span-id': '4',
      'content-length': '149',
      'content-type': 'application/json',
      date: 'Fri, 10 Jun 2022 12:32:36 GMT',
      vary: 'Origin',
      'x-ratelimit-limit': '0',
      'x-ratelimit-remaining': '0',
      'x-ratelimit-reset': '0',
      connection: 'close'
    },
    body: {
      errId: '6f0f511a-079d-4d58-8e54-031a2d7d3b00',
      errCode: '4003',
      errMsg: 'Invalid values',
      errBody: [Object]
    }
  }
}

Plugin Config:

        {
            "credentials": {
                "username": "xxxxxx",
                "password": "yyyyyy",
                "region": "EU",
                "brand": "hyundai"
            },
            "vehicles": [
                {
                    "vin": "KMHzzzzzzzz",
                    "maxRange": 460
                }
            ],
            "remoteStart": {
                "airCtrl": true,
                "heating1": true,
                "defrost": true,
                "igniOnDuration": 15
            },
            "platform": "Hyundai"
        }

Screenshots: none.

Environment:

DMW506 commented 2 years ago

Canadian Ioniq 5

[18/06/2022, 11:25:12] [Hyundai] Client Ready [18/06/2022, 11:25:12] [Hyundai] Fetching vehicle: XXXXXXXXXXXXXXXXXX [18/06/2022, 11:25:12] [Hyundai] Vehicle found { nickname: 'ioniq 5', name: 'ioniq 5', vin: 'XXXXXXXXXXXXXXXXXX', regDate: undefined, brandIndicator: undefined, regId: undefined, id: 'XXXXXXXXXXXXUp89KNLb+Q==', generation: 'G3' } [18/06/2022, 11:25:12] [Hyundai] Restoring existing accessory from cache: ioniq 5 [18/06/2022, 11:25:13] [Hyundai] Status fetch error Cannot read properties of undefined (reading 'result')