Closed NellicusLabs closed 4 years ago
What version of the node red lib are you using?
Node-Red: 1.0.6 Bluelinky: 0.0.6-alpha
Thanks, are you able to read out the logs from node-red? And are you able to log into the app at this moment?
I was able to login via the mobile app and website and issue commands. I have Node-Red set to debug log. Below is the output:
Started Node-RED graphical event wiring tool. 14 May 11:58:27 - [info] Welcome to Node-RED 14 May 11:58:27 - [info] Node-RED version: v1.0.6 14 May 11:58:27 - [info] Node.js version: v10.20.1 14 May 11:58:27 - [info] Linux 4.15.0-99-generic x64 LE 14 May 11:58:27 - [info] Loading palette nodes 14 May 11:58:28 - [debug] Module: node-red-contrib-bigtimer 2.3.1 14 May 11:58:28 - [debug] /home/homeassistant/.node-red/node_modules/node-red-contrib-bigtimer 14 May 11:58:28 - [debug] Module: node-red-contrib-bluelinky 0.0.6-alpha 14 May 11:58:28 - [debug] /home/homeassistant/.node-red/node_modules/node-red-contrib-bluelinky 14 May 11:58:28 - [debug] Module: node-red-contrib-home-assistant-websocket 0.22.3 14 May 11:58:28 - [debug] /home/homeassistant/.node-red/node_modules/node-red-contrib-home-assistant-websocket 14 May 11:58:28 - [debug] Module: node-red-contrib-light-scheduler 0.0.15 14 May 11:58:28 - [debug] /home/homeassistant/.node-red/node_modules/node-red-contrib-light-scheduler 14 May 11:58:28 - [debug] Module: node-red-node-rbe 0.2.8 14 May 11:58:28 - [debug] /usr/lib/node_modules/node-red/node_modules/node-red-node-rbe 14 May 11:58:28 - [debug] Module: node-red-node-tail 0.1.1 14 May 11:58:28 - [debug] /usr/lib/node_modules/node-red/node_modules/node-red-node-tail 14 May 11:58:30 - [info] Settings file : /home/homeassistant/.node-red/settings.js 14 May 11:58:30 - [info] Context store : 'default' [module=memory] 14 May 11:58:30 - [info] User directory : /home/homeassistant/.node-red 14 May 11:58:30 - [warn] Projects disabled : editorTheme.projects.enabled=false 14 May 11:58:30 - [info] Flows file : /home/homeassistant/.node-red/flows_homeassistant.json 14 May 11:58:30 - [debug] loaded flow revision: 39367f5c637e8cc150741b7de2962c69 14 May 11:58:30 - [debug] red/runtime/nodes/credentials.load : user provided key 14 May 11:58:30 - [debug] red/runtime/nodes/credentials.load : keyType=user 14 May 11:58:30 - [info] Starting flows 14 May 11:58:30 - [debug] red/nodes/flows.start : starting flow : global 14 May 11:58:30 - [debug] red/nodes/flows.start : starting flow : 9895e5bc.3041a8 14 May 11:58:30 - [debug] red/nodes/flows.start : starting flow : ac4c6aa6.2a2fd8 14 May 11:58:30 - [debug] red/nodes/flows.start : starting flow : ad453f81.1940f8 14 May 11:58:30 - [debug] red/nodes/flows.start : starting flow : e6281f27.bac418 14 May 11:58:30 - [debug] red/nodes/flows.start : starting flow : da25b803.d7c14 14 May 11:58:30 - [debug] red/nodes/flows.start : starting flow : 5d3f7d5e.c70e34 14 May 11:58:30 - [debug] red/nodes/flows.start : starting flow : 91619d6f.570d78 14 May 11:58:30 - [debug] [server:Home Assistant] instantiated node, name: Home Assistant [2020-05-14 11:58:30] info: US Controller created [2020-05-14 11:58:30] info: Bluelinky is loging in automatically, to disable use autoLogin: false 14 May 11:58:30 - [info] Started flows 14 May 11:58:30 - [info] Server now running at http://127.0.0.1:1880/ [2020-05-14 11:58:32] info: US Vehicle {REDACTEDVIN} created [2020-05-14 11:58:32] info: US Vehicle {REDACTEDVIN} created
Thanks. So from here i have to talk to @Hacksore , as I live in EU and the code is quite diffrent.
[2020-05-14 11:58:32] info: US Vehicle {REDACTEDVIN} created
[2020-05-14 11:58:32] info: US Vehicle {REDACTEDVIN} created
Are these 2 diffrent cars or does it log the same car twice?
They are two different vehicles on my account. Each show the unique vin for each vehicle.
Cool! I think you are the first person to have multiple cars testing Bluelinky. So maybe that has something to do with the issues. (Note to @Hacksore )
Maybe we can have @justinoreilly try and use the debug.js feature of bluelinky to isolate the issue outside of node-red.
What you need to do:
npm run build
{
"username": "",
"password": "",
"pin": "",
"vin": ""
}
node debug.js
Here is the output:
{"errorSubCode":"IDM_401_4","functionName":"remoteVehicleStatus","errorSubMessage":"Feature disabled as it is not part of subscription.","errorMessage":"Feature disabled as it is not part of subscription.","errorCode":401}
I have 2 vehicles on my account. One of them has an inactive BlueLink subscription (first one ever added to my account) and the second one has an active BlueLink subscription. Based on this error, It looks like it is trying to use the opposite VIN from which I am specifying in the config file but rather the first vehicle in the account which does not have an active subscription.
@justinoreilly If you edit debug.js
you can do this to select the second vehicle, we are not using the config vin to pull the correct vehicle.
That worked in debug. I was able to get the status of the correct vehicle. Any idea how/when this could be integrated to work with the flows?
The issue might be this function;
With the debug.js tests above, you go around that function.
you can edit the line in onReadyHandler to;
vehicle = client.getVehicle('YOUR VIN');
That is a more accurate test
I am not quite sure I follow. Edit my copy of bluelinky.js?
/home/homeassistant/.node-red/node_modules/node-red-contrib-bluelinky/bluelinky.js
Change (line 12)
const car = await client.getVehicle(this.bluelinkyConfig.vin);
to
let car = await client.getVehicle('XXXXXMYVINXXXXXXX');
And this should for now manually select the correct vehicle?
No, sorry, poor explanation, i only refrenced that to show what i was thinking.
The edit should be done in debug.js, the same line you edited from [0] to [1] should be (the whole line)
vehicle = client.getVehicle('YOUR VIN');
No need to change anything on the bluelinky lib
Changing that line in debug.js resulted in the following:
vehicle = vehicles[1];
to vehicle = client.getVehicle('YOUR VIN');
(node:2602) UnhandledPromiseRejectionWarning: ReferenceError: client is not defined
at e.onReadyHandler (/home/homeassistant/.node-red/bluelinky/debug.js:24:3)
at emit (events.js:198:13)
at e.
Change
https://github.com/Hacksore/bluelinky/blob/029efe5aa2aadaa4cdc29226763edc61562bba63/debug.js#L53
to
client = new BlueLinky({
and add
let client = null;
To line 8
Here is what I have for debug.js so far. https://gist.github.com/justinoreilly/3cacaef9cc37e9f3e5e91766a1206275
Perfect, now run that for both cars
This issue was in Bluelinky, and was resolved in 4.2.1. Lib was updated in release 0.0.8-alpha
I am getting this error often as well as well and it seems that the only fix to it is to reDeploy or restart my flows. The error occurs immediately when the car-location node is enabled. It seems to fail when I'm not currently displaying node-red and then when I return the only way to get it to work again is to restart the flow. I'm trying to update my vehicle position every hour and then also when I arrive at home but. I'm currently using node-red-contrib-bluelinky v0.0.15.
Attempting to configure a flow to get status and receive "HTTPError: Response code 401 (Authorization Required)" as a debug output. This is the US region.