Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Invalid request body - Invalid deviceId" after a write command #267

Open
cr0ste opened this issue Oct 4, 2023 · 2 comments
Open

"Invalid request body - Invalid deviceId" after a write command #267

cr0ste opened this issue Oct 4, 2023 · 2 comments

Comments

@cr0ste
Copy link

cr0ste commented Oct 4, 2023

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
@cdnninja
Copy link

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.

@cr0ste
Copy link
Author

cr0ste commented Feb 9, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants