SteffeyDev / homebridge-hyundai-bluelink

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

Remote start error Tucson NX4 HEV - [400] Bad Request / Undefined Error - Vehicle is not EV #292

Closed MchlLyn closed 1 year ago

MchlLyn commented 1 year ago

Describe The Bug: Using the remote start feature results in error: Start Fail R [ManagedBluelinkyError]: @EuropeVehicle.start: [400] Bad Request and Undefined Error - Vehicle is not EV

To Reproduce: Use the remote start feature using any setting (defrost true/false, heating true/false, etc.)

Expected behavior: Remote start and preheat works when using the smart key, therefore i presume it should also work via the api?

Logs:

Start Fail R [ManagedBluelinkyError]: @EuropeVehicle.start: [400] Bad Request on [POST] https://prd.eu-ccapi.hyundai.com:8080/api/v2/spa/vehicles/<redacted>/control/temperature - {"retCode":"F","resCode":"9999","resMsg":"Undefined Error - Vehicle is not EV (vehicleId: <redacted>)","msgId":"<redacted>"}
    at U (/homebridge/node_modules/homebridge-hyundai-bluelink/node_modules/bluelinky/dist/index.js:17:11700)
    at G.<anonymous> (/homebridge/node_modules/homebridge-hyundai-bluelink/node_modules/bluelinky/dist/index.js:17:16700)
    at Generator.throw (<anonymous>)
    at a (/homebridge/node_modules/homebridge-hyundai-bluelink/node_modules/bluelinky/dist/index.js:17:136)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5) {
  source: GotError [HTTPError]: Response code 400 (Bad Request)
      at EventEmitter.<anonymous> (/homebridge/node_modules/homebridge-hyundai-bluelink/node_modules/got/source/as-promise.js:74:19)
      at runMicrotasks (<anonymous>)
      at processTicksAndRejections (node:internal/process/task_queues:96:5) {
    host: undefined,
    hostname: 'prd.eu-ccapi.hyundai.com',
    method: 'POST',
    path: '/api/v2/spa/vehicles/<redacted>/control/temperature',
    socketPath: undefined,
    protocol: 'https:',
    url: 'https://prd.eu-ccapi.hyundai.com:8080/api/v2/spa/vehicles/<redacted>/control/temperature',
    gotOptions: {
      path: '/api/v2/spa/vehicles/<redacted>/control/temperature',
      protocol: 'https:',
      hostname: 'prd.eu-ccapi.hyundai.com',
      hash: '',
      search: '',
      pathname: '/api/v2/spa/vehicles/<redacted>/control/temperature',
      href: 'https://prd.eu-ccapi.hyundai.com:8080/api/v2/spa/vehicles/<redacted>/control/temperature',
      port: 8080,
      retry: [Object],
      headers: [Object],
      hooks: [Object],
      decompress: true,
      throwHttpErrors: true,
      followRedirect: true,
      stream: false,
      form: false,
      json: true,
      cache: false,
      useElectronNet: false,
      baseUrl: [Getter/Setter],
      body: '{"action":"start","hvacType":0,"options":{"defrost":true,"heating1":0},"tempCode":"-1H"}',
      method: 'POST'
    },
    statusCode: 400,
    statusMessage: 'Bad Request',
    headers: {
      'content-type': 'application/json; charset=utf-8',
      date: 'Mon, 07 Nov 2022 10:43:18 GMT',
      etag: 'W/"<redacted>"',
      'x-ratelimit-limit': '100',
      'x-ratelimit-remaining': '99',
      'x-ratelimit-reset': '1667817858',
      'content-length': '176',
      connection: 'close',
      'set-cookie': [Array]
    },
    body: {
      retCode: 'F',
      resCode: '9999',
      resMsg: 'Undefined Error - Vehicle is not EV (vehicleId: <redacted>)',
      msgId: '<redacted>'
    }
  }
}

Plugin Config:

        {
            "credentials": {
                "username": "<redacted>",
                "password": "<redacted>",
                "region": "EU",
                "brand": "hyundai",
                "pin": "<redacted>"
            },
            "vehicles": [
                {
                    "vin": "<redacted>"
                }
            ],
            "remoteStart": {
                "airCtrl": false,
                "heating1": false,
                "defrost": false,
                "airTempvalue": 72,
                "igniOnDuration": 10
            },
            "platform": "Hyundai",
            "_bridge": {
                "username": "<redacted>",
                "port": <redacted>
            }
        }

Environment: