Hacksore / bluelinky

An unofficial nodejs API wrapper for Hyundai bluelink and Kia UVO
https://bluelinky.readme.io
MIT License
328 stars 75 forks source link

remote start fails using bluelinky #277

Open cmorozcogmailcom opened 3 months ago

cmorozcogmailcom commented 3 months ago

remote start fails

use the debug.ts from hacksore/bluelinky **Usefull info

Additional context

debug bluelinky calls - I x'd out the sensitive data.

npm run debug bluelinky@8.3.0 debug ts-node debug.ts

? What Region are you in? US ? Which brand are you using? hyundai { region: 'US', brand: 'hyundai' } Logging in...

**? What you wanna do? start GotError [ParseError]: Unexpected token < in JSON at position 0 in "https://api.telematics.hyundaiusa.com//ac/v2/rcs/rsc/start":

The request / response that are contrary to the W... at EventEmitter. (/Users/carlosorozco/bluelinky/node_modules/got/source/as-promise.js:65:26) at processTicksAndRejections (node:internal/process/task_queues:95:5) { host: 'api.telematics.hyundaiusa.com', hostname: 'api.telematics.hyundaiusa.com', method: 'POST', path: '//ac/v2/rcs/rsc/start', socketPath: undefined, protocol: 'https:', url: 'https://api.telematics.hyundaiusa.com//ac/v2/rcs/rsc/start', gotOptions: { path: '//ac/v2/rcs/rsc/start', protocol: 'https:', slashes: true, auth: null, host: 'api.telematics.hyundaiusa.com', port: null, hostname: 'api.telematics.hyundaiusa.com', hash: null, search: null, query: null, pathname: '//ac/v2/rcs/rsc/start', href: 'https://api.telematics.hyundaiusa.com//ac/v2/rcs/rsc/start', retry: { retries: [Function (anonymous)], methods: [Set], statusCodes: [Set], errorCodes: [Set] }, headers: { 'user-agent': 'okhttp/3.12.0', access_token: 'wdddddd', client_id: 'm66129Bb-em93-SPAHYN-bZ91-am4540zp19920', host: 'api.telematics.hyundaiusa.com', registrationid: 'H00004841122Vxxxxxxxxx7', gen: '2', username: 'xxxxxxxxxgmail.com', vin: 'xxxxxxx' 'appcloud-vin': 'xxxxxxx', language: '0', to: 'ISS', encryptflag: 'false', from: 'SPA', brandindicator: 'H', bluelinkservicepin: '0xxx', offset: '-4', accept: 'application/json', 'accept-encoding': 'gzip, deflate', 'content-type': 'application/json', 'content-length': 188 }, hooks: { beforeRequest: [], beforeRedirect: [], beforeRetry: [], afterResponse: [], beforeError: [], init: [] }, decompress: true, throwHttpErrors: false, followRedirect: true, stream: false, form: false, json: true, cache: false, useElectronNet: false, method: 'POST', body: '{"Ims":0,"airCtrl":0,"airTemp":{"unit":1,"value":"70"},"defrost":false,"heating1":0,"igniOnDuration":10,"seatHeaterVentInfo":null,"username":"xxxxxxx@gmail.com","vin":"Kxxxxxxx7"}', secureOptions: 4 }, statusCode: 200, statusMessage: 'OK' }**

cmorozcogmailcom commented 3 months ago

i fixed it by patching the vehicle code.

bluelinky@8.3.0 debug ts-node debug.ts

? What Region are you in? CN ❯ US ? Which brand are you using? (Use arrow keys) ❯ hyundai What you wanna do? start start : "Vehicle started!"

? What you wanna do? (Use arrow keys) ❯ exit

cmorozcogmailcom commented 3 months ago

american.vehicle.ts.zip

neoPix commented 2 months ago

Can you possibly create a pull request with this fix ?