Hacksore / bluelinky

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

EU/Hyundai setting heating temperature value not used #209

Closed memed36 closed 2 years ago

memed36 commented 2 years ago

When using start() to trigger hvac heating is started, but temperature value is not used - always defaults to last value set in Bluelink app. I used the code sample from https://bluelinky.readme.io/reference/start to create a js script "start.js" which works (npm run start shows no error, HVAC in my BEV car starts), but the temp value is ignored. I set temp to 17, 25 and 27 (celsius) bit when verifying with debug.ts (npm start debug) "status raw" shows ""value": "10H"" as temperature value and "status fetched from car" shows "temperatureSetpoint": 22 (Celsius). A working config.json exists and is used for start.js and debug.ts .

Usefull info(please complete the following information):

Additional context start.js sample script:

const BlueLinky = require("bluelinky"); config = require('../config.json');

const { username, password, pin, vin, region, brand } = config;

const client = new BlueLinky({ username, password, brand, region, pin });

client.on("ready", async () => { const vehicle = client.getVehicle(vin); const response = await vehicle.start({ airCtrl: true, igniOnDuration: 10, airTempvalue: 25, defrost: false, heating1: false, }); });

client.on('error', async (err) => { // something went wrong with login });

Status output from debug.ts attached for raw and parsed.

fullstatusraw.txt statusfetchedfromcar.txt

PierreLevres commented 2 years ago

For European BEV's, see the bluelinky code: public async start(config: VehicleClimateOptions): Promise { const http = await this.controller.getVehicleHttpService(); try { const response = this.updateRates( await http.post(/api/v2/spa/vehicles/${this.vehicleConfig.id}/control/temperature, { body: { action: 'start', hvacType: 0, options: { defrost: config.defrost, heating1: config.windscreenHeating ? 1 : 0, }, tempCode: celciusToTempCode(REGIONS.EU, config.temperature), unit: config.unit, }, }) ); logger.info(Climate started for vehicle ${this.vehicleConfig.id}); return response.body; } catch (err) { throw manageBluelinkyError(err, 'EuropeVehicle.start'); } } export interface VehicleClimateOptions { defrost: boolean; windscreenHeating: boolean; temperature: number; unit: string; } So use temperature: 25 instead ….

On 21 Feb 2022, at 17:08, memed36 @.***> wrote:

When using start() to trigger hvac heating is started, but temperature value is not used - always defaults to last value set in Bluelink app. I used the code sample from https://bluelinky.readme.io/reference/start https://bluelinky.readme.io/reference/start to create a js script "start.js" which works (npm run start shows no error, HVAC in my BEV car starts), but the temp value is ignored. I set temp to 17, 25 and 27 (celsius) bit when verifying with debug.ts (npm start debug) "status raw" shows ""value": "10H"" as temperature value and "status fetched from car" shows "temperatureSetpoint": 22 (Celsius). A working config.json exists and is used for start.js and debug.ts .

Usefull info(please complete the following information):

OS: Linux (Debian 9, Python 3.7.9, NPM v8.5.0) Bluelinky Version v7.6.6 Region: EU Brand: hyundai Car model: Ioniq 5 AWD Additional context start.js sample script:

const BlueLinky = require("bluelinky"); config = require('../config.json');

const { username, password, pin, vin, region, brand } = config;

const client = new BlueLinky({ username, password, brand, region, pin });

client.on("ready", async () => { const vehicle = client.getVehicle(vin); const response = await vehicle.start({ airCtrl: true, igniOnDuration: 10, airTempvalue: 25, defrost: false, heating1: false, }); });

client.on('error', async (err) => { // something went wrong with login });

Status output from debug.ts attached for raw and parsed.

fullstatusraw.txt https://github.com/Hacksore/bluelinky/files/8110681/fullstatusraw.txt statusfetchedfromcar.txt https://github.com/Hacksore/bluelinky/files/8110682/statusfetchedfromcar.txt — Reply to this email directly, view it on GitHub https://github.com/Hacksore/bluelinky/issues/209, or unsubscribe https://github.com/notifications/unsubscribe-auth/AO7MCG3CM64HH533ZRGTHCTU4JPRFANCNFSM5O7AOWVA. You are receiving this because you are subscribed to this thread.

neoPix commented 2 years ago

As @PierreLevres pointed out, the start arguments changed, now this interface is expected : https://github.com/Hacksore/bluelinky/blob/22c3d8ed505cb26669eaf624e0142ca46745f22a/src/interfaces/common.interfaces.ts#L419

memed36 commented 2 years ago

Thanks, missed that! My bad. Thx for the quick help and the great work!