"Invalid request body - Invalid deviceId" after a write command
Hi,
I know that this error message was there during login and solved rather soon. Login is also working fine for me, as well as reading the vehicle status.
An extract of my code:
client = new BlueLinky({
username: kiaConfig.username,
password: kiaConfig.password,
brand: niroEVConfig.brand,
region: kiaConfig.region,
pin: niroEVConfig.pin,
autoLogin: false
});
await client.login();
vehicle = await client.getVehicle(niroEVConfig.vin);
await vehicle.status({ refresh: false, parsed: false });
Now If lock the car via
await req.vehicle.lock();
this also works fine.
But if I now try to read status again:
await vehicle.status({ refresh: false, parsed: false });
it fails with "Invalid request body - Invalid deviceId. "
Perhaps I'm doing something wrong? Do I need a fresh login after the lock command?
- OS: Docker container based on node:current-alpine
- Bluelinky Version: 8.2.1
- Region: EU
- Brand: Kia
In our python version we solved this by adding a new device call within our actions to refresh the device ID. Most likely not the right way to do it but it works.
I solved it by creating a new BlueLinky instance (client) after each writing request (e.g. startaircond, lock, etc.). Also not sure if this is really a solution, but works for me.
Just reading the vehicle status does not require a new instance.