node-red-contrib-cardata 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -25,32 +25,20 @@ position, since CarData itself keeps no trip history.
|
|
|
25
25
|
| `cardata-target` | Polls the charge target through the REST API (not every vehicle streams it) — hourly by default. |
|
|
26
26
|
| `cardata-trips` | Builds trips (distance, duration, pauses) from `cardata-stream`'s state output. Optional; wire it in only if you want trip history. |
|
|
27
27
|
|
|
28
|
-
##
|
|
28
|
+
## Set up CarData first
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
`node-red-contrib-cardata`. Restart Node-RED afterwards; the nodes appear under
|
|
32
|
-
**cardata** in the palette.
|
|
33
|
-
2. In the CarData portal: create a client and subscribe it to "stream" — note the client
|
|
34
|
-
ID.
|
|
35
|
-
3. In Node-RED: **Import → Examples → node-red-contrib-cardata → cardata-victron**: the
|
|
36
|
-
complete flow, with the virtual EV device already wired up (it needs
|
|
37
|
-
`@victronenergy/node-red-contrib-victron`; without Victron use `cardata-basic`, which ends in debug
|
|
38
|
-
nodes). Open the `cardata-account` node, fill in the client ID and VIN, and deploy
|
|
39
|
-
once.
|
|
40
|
-
4. Click **Log in** on the account node: it shows a link and a code — open the link,
|
|
41
|
-
enter the code, confirm with your MINI/BMW account. The node polls automatically and
|
|
42
|
-
shows "logged in" once done.
|
|
43
|
-
5. Click **Create container** (needed for the charge target) — fills in the container ID
|
|
44
|
-
itself, or paste one you already created with the CarData API.
|
|
45
|
-
6. Open the **Electric vehicle** node (`victron-virtual`) and fill in the same VIN and the
|
|
46
|
-
battery capacity in kWh — CarData has no capacity field. Check the brand, and pick your
|
|
47
|
-
**EV Charger** if you have one on the same system (that links the car to the charger,
|
|
48
|
-
so Dynamic ESS knows which charger charges which car; it's the one setting the example
|
|
49
|
-
can't pre-fill, because the instance differs per installation). The device then shows
|
|
50
|
-
up in VRM as an EV, fed by `cardata-stream` (state) and `cardata-target` (charge target).
|
|
30
|
+
Do this **before** installing the nodes, otherwise there is nothing for them to connect to:
|
|
51
31
|
|
|
52
|
-
|
|
53
|
-
|
|
32
|
+
1. In the MyBMW / MyMINI web portal (not the app), create a CarData client
|
|
33
|
+
("Create CarData Client"), authorize both scopes `cardata:api:read` and
|
|
34
|
+
`cardata:streaming:read`, and switch on **CarData API** and **CarData Stream**. Note the
|
|
35
|
+
client ID.
|
|
36
|
+
2. Tick the data points below and save the selection.
|
|
37
|
+
|
|
38
|
+
Official pages: [BMW Group CarData](https://www.bmwgroup.com/en/innovation/connected-car/cardata.html)
|
|
39
|
+
and [MINI CarData FAQ](https://www.mini.co.uk/en-gb/utilities/mini/api/assets/cardata/CarDataFAQ_mini_gb_en.pdf)
|
|
40
|
+
(UK; menu names differ per market). A step-by-step guide by the community:
|
|
41
|
+
[BavarianData portal setup](https://github.com/JustChr/BavarianData/wiki/Getting-Started-1-BMW-Portal-Setup).
|
|
54
42
|
|
|
55
43
|
## Data points to enable in the CarData portal
|
|
56
44
|
|
|
@@ -83,6 +71,31 @@ hourly default uses 24 of those — and allows only **one streaming connection p
|
|
|
83
71
|
account** at a time, regardless of which client/app opens it (so `cardata-stream` and,
|
|
84
72
|
say, the CarData app or another tool can't both hold the stream at once).
|
|
85
73
|
|
|
74
|
+
## Install
|
|
75
|
+
|
|
76
|
+
1. From the Node-RED editor: **Menu → Manage palette → Install**, search for
|
|
77
|
+
`node-red-contrib-cardata`. Restart Node-RED afterwards; the nodes appear under
|
|
78
|
+
**cardata** in the palette.
|
|
79
|
+
2. In Node-RED: **Import → Examples → node-red-contrib-cardata → cardata-victron**: the
|
|
80
|
+
complete flow, with the virtual EV device already wired up (it needs
|
|
81
|
+
`@victronenergy/node-red-contrib-victron`; without Victron use `cardata-basic`, which ends in debug
|
|
82
|
+
nodes). Open the `cardata-account` node, fill in the client ID and VIN, and deploy
|
|
83
|
+
once.
|
|
84
|
+
3. Click **Log in** on the account node: it shows a link and a code. The link goes to the BMW or MINI
|
|
85
|
+
login page, whichever belongs to your account. Open it, enter the code, confirm with your MINI/BMW account. The node polls automatically and
|
|
86
|
+
shows "logged in" once done.
|
|
87
|
+
4. Click **Create container** (needed for the charge target) — fills in the container ID
|
|
88
|
+
itself, or paste one you already created with the CarData API.
|
|
89
|
+
5. Open the **Electric vehicle** node (`victron-virtual`) and fill in the same VIN and the
|
|
90
|
+
battery capacity in kWh — CarData has no capacity field. Check the brand, and pick your
|
|
91
|
+
**EV Charger** if you have one on the same system (that links the car to the charger,
|
|
92
|
+
so Dynamic ESS knows which charger charges which car; it's the one setting the example
|
|
93
|
+
can't pre-fill, because the instance differs per installation). The device then shows
|
|
94
|
+
up in VRM as an EV, fed by `cardata-stream` (state) and `cardata-target` (charge target).
|
|
95
|
+
|
|
96
|
+
The virtual device's node ID is kept stable in the example: a Victron virtual device's
|
|
97
|
+
instance is tied to that ID, so a new ID means a second device in VRM.
|
|
98
|
+
|
|
86
99
|
## MQTT settings: tuned on the actual hardware, don't change lightly
|
|
87
100
|
|
|
88
101
|
| | | |
|
package/README.nl.md
CHANGED
|
@@ -25,34 +25,20 @@ de auto zelf, want CarData houdt zelf geen ritgeschiedenis bij.
|
|
|
25
25
|
| `cardata-target` | Haalt het laaddoel op via de REST-API (niet elke auto streamt dit) — standaard elk uur. |
|
|
26
26
|
| `cardata-trips` | Bouwt ritten (afstand, duur, pauzes) uit de toestand die `cardata-stream` stuurt. Optioneel; alleen aansluiten als je ritgeschiedenis wilt. |
|
|
27
27
|
|
|
28
|
-
##
|
|
28
|
+
## Eerst CarData instellen
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
Doe dit **voordat** je de nodes installeert, anders hebben ze niets om mee te verbinden:
|
|
31
|
+
|
|
32
|
+
1. Maak in het MyBMW- of MyMINI-webportaal (niet de app) een CarData-client aan
|
|
33
|
+
("Create CarData Client"), autoriseer beide scopes `cardata:api:read` en
|
|
34
|
+
`cardata:streaming:read`, en zet **CarData API** en **CarData Stream** aan. Noteer het
|
|
34
35
|
client-ID.
|
|
35
|
-
|
|
36
|
-
complete flow, met het virtuele EV-apparaat al aangesloten (daarvoor is
|
|
37
|
-
`@victronenergy/node-red-contrib-victron` nodig; zonder Victron gebruik je `cardata-basic`, die eindigt
|
|
38
|
-
in debug-nodes). Open de `cardata-account`-node, vul het client-ID en het VIN in, en
|
|
39
|
-
deploy eenmalig.
|
|
40
|
-
4. Klik op **Inloggen** op de account-node: die toont een link en een code — open de
|
|
41
|
-
link, vul de code in, bevestig met je MINI/BMW-account. De node pollt automatisch en
|
|
42
|
-
toont "ingelogd" zodra het gelukt is.
|
|
43
|
-
5. Klik op **Container aanmaken** (nodig voor het laaddoel) — vult het container-ID zelf
|
|
44
|
-
in, of plak er een die je al eerder met de CarData-API hebt gemaakt.
|
|
45
|
-
6. Open de **Electric vehicle**-node (`victron-virtual`) en vul hetzelfde VIN in en de
|
|
46
|
-
accucapaciteit in kWh — CarData heeft daar geen veld voor. Controleer het merk en kies
|
|
47
|
-
je **EV Charger** als je er een op hetzelfde systeem hebt (dat koppelt de auto aan de
|
|
48
|
-
lader, zodat Dynamic ESS weet welke lader welke auto laadt; het enige veld dat het
|
|
49
|
-
voorbeeld niet kan voorinvullen, want het instance verschilt per installatie). Het
|
|
50
|
-
apparaat verschijnt dan in VRM als EV, gevoed door `cardata-stream` (toestand) en
|
|
51
|
-
`cardata-target` (laaddoel).
|
|
36
|
+
2. Vink de datapunten hieronder aan en bewaar de selectie.
|
|
52
37
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
38
|
+
Officiële pagina's: [BMW Group CarData](https://www.bmwgroup.com/en/innovation/connected-car/cardata.html)
|
|
39
|
+
en de [MINI CarData FAQ](https://www.mini.co.uk/en-gb/utilities/mini/api/assets/cardata/CarDataFAQ_mini_gb_en.pdf)
|
|
40
|
+
(Verenigd Koninkrijk; menunamen verschillen per markt). Een stapsgewijze gids van de community:
|
|
41
|
+
[BavarianData portal setup](https://github.com/JustChr/BavarianData/wiki/Getting-Started-1-BMW-Portal-Setup).
|
|
56
42
|
|
|
57
43
|
## Datapunten aanzetten in het CarData-portaal
|
|
58
44
|
|
|
@@ -86,6 +72,33 @@ account** tegelijk toe, ongeacht via welke client/app die loopt (dus `cardata-st
|
|
|
86
72
|
bijvoorbeeld de CarData-app of een andere tool kunnen niet allebei tegelijk de stream
|
|
87
73
|
vasthouden).
|
|
88
74
|
|
|
75
|
+
## Installeren
|
|
76
|
+
|
|
77
|
+
1. Vanuit de Node-RED-editor: **Menu → Manage palette → Install**, zoek op
|
|
78
|
+
`node-red-contrib-cardata`. Herstart Node-RED daarna; de nodes staan dan onder
|
|
79
|
+
**cardata** in het palet.
|
|
80
|
+
2. In Node-RED: **Import → Examples → node-red-contrib-cardata → cardata-victron**: de
|
|
81
|
+
complete flow, met het virtuele EV-apparaat al aangesloten (daarvoor is
|
|
82
|
+
`@victronenergy/node-red-contrib-victron` nodig; zonder Victron gebruik je `cardata-basic`, die eindigt
|
|
83
|
+
in debug-nodes). Open de `cardata-account`-node, vul het client-ID en het VIN in, en
|
|
84
|
+
deploy eenmalig.
|
|
85
|
+
3. Klik op **Inloggen** op de account-node: die toont een link en een code. De link gaat naar de BMW- of
|
|
86
|
+
MINI-inlogpagina, afhankelijk van je account. Open hem, vul de code in, bevestig met je MINI/BMW-account. De node pollt automatisch en
|
|
87
|
+
toont "ingelogd" zodra het gelukt is.
|
|
88
|
+
4. Klik op **Container aanmaken** (nodig voor het laaddoel) — vult het container-ID zelf
|
|
89
|
+
in, of plak er een die je al eerder met de CarData-API hebt gemaakt.
|
|
90
|
+
5. Open de **Electric vehicle**-node (`victron-virtual`) en vul hetzelfde VIN in en de
|
|
91
|
+
accucapaciteit in kWh — CarData heeft daar geen veld voor. Controleer het merk en kies
|
|
92
|
+
je **EV Charger** als je er een op hetzelfde systeem hebt (dat koppelt de auto aan de
|
|
93
|
+
lader, zodat Dynamic ESS weet welke lader welke auto laadt; het enige veld dat het
|
|
94
|
+
voorbeeld niet kan voorinvullen, want het instance verschilt per installatie). Het
|
|
95
|
+
apparaat verschijnt dan in VRM als EV, gevoed door `cardata-stream` (toestand) en
|
|
96
|
+
`cardata-target` (laaddoel).
|
|
97
|
+
|
|
98
|
+
Het node-ID van het virtuele apparaat staat in het voorbeeld bewust vast: het device-instance
|
|
99
|
+
van een Victron virtual device hangt aan dat ID, dus een nieuw ID betekent een tweede
|
|
100
|
+
apparaat in VRM.
|
|
101
|
+
|
|
89
102
|
## MQTT-instellingen: uitgezocht op het echte toestel, niet zomaar aanpassen
|
|
90
103
|
|
|
91
104
|
| | | |
|
|
@@ -61,8 +61,14 @@
|
|
|
61
61
|
return
|
|
62
62
|
}
|
|
63
63
|
// Als DOM-elementen, niet als HTML-string: de URI komt uit een serverantwoord.
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
// De code staat op een eigen regel, in een eigen vak en zonder leesteken erachter:
|
|
65
|
+
// een dubbele punt direct na de code lijkt anders deel van de code.
|
|
66
|
+
$('<div>').text(def._('cardata-account.login.instructions')).appendTo(uitleg)
|
|
67
|
+
$('<div>').append($('<a target="_blank" rel="noopener">').attr('href', data.verificationUri).text(data.verificationUri)).appendTo(uitleg)
|
|
68
|
+
$('<div style="margin-top:8px">')
|
|
69
|
+
.append($('<span>').text(def._('cardata-account.login.codeLabel') + ' '))
|
|
70
|
+
.append($('<code style="font-size:1.3em;font-weight:bold;padding:2px 8px;background:#eee;border:1px solid #ccc;border-radius:3px;letter-spacing:2px;user-select:all">').text(data.userCode))
|
|
71
|
+
.appendTo(uitleg)
|
|
66
72
|
poll(uitleg, data.intervalS || 5)
|
|
67
73
|
})
|
|
68
74
|
.fail(function () {
|
|
@@ -22,12 +22,13 @@
|
|
|
22
22
|
"loggedIn": "logged in",
|
|
23
23
|
"notLoggedIn": "not logged in",
|
|
24
24
|
"failed": "failed: __error__",
|
|
25
|
-
"instructions": "Open the
|
|
25
|
+
"instructions": "Open the login page and enter the code shown below",
|
|
26
26
|
"success": "logged in",
|
|
27
27
|
"unreachable": "could not reach Node-RED",
|
|
28
28
|
"notDeployed": "node not deployed yet — click Deploy first",
|
|
29
29
|
"noAttempt": "no login in progress",
|
|
30
|
-
"expired": "code expired, try again"
|
|
30
|
+
"expired": "code expired, try again",
|
|
31
|
+
"codeLabel": "Code"
|
|
31
32
|
},
|
|
32
33
|
"container": {
|
|
33
34
|
"busy": "creating…",
|
|
@@ -22,12 +22,13 @@
|
|
|
22
22
|
"loggedIn": "ingelogd",
|
|
23
23
|
"notLoggedIn": "niet ingelogd",
|
|
24
24
|
"failed": "mislukt: __error__",
|
|
25
|
-
"instructions": "Open
|
|
25
|
+
"instructions": "Open de inlogpagina en vul de code in die hieronder staat",
|
|
26
26
|
"success": "ingelogd",
|
|
27
27
|
"unreachable": "kon Node-RED niet bereiken",
|
|
28
28
|
"notDeployed": "node nog niet uitgerold — klik eerst op Deploy",
|
|
29
29
|
"noAttempt": "geen inlogpoging bezig",
|
|
30
|
-
"expired": "code verlopen, probeer opnieuw"
|
|
30
|
+
"expired": "code verlopen, probeer opnieuw",
|
|
31
|
+
"codeLabel": "Code"
|
|
31
32
|
},
|
|
32
33
|
"container": {
|
|
33
34
|
"busy": "bezig…",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-red-contrib-cardata",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Node-RED nodes for MINI/BMW CarData: stream the car's state and charge target into a virtual EV device (e.g. for Victron VRM/Dynamic ESS), with trip tracking.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"node-red",
|