node-red-contrib-cardata 0.0.0-stage → 0.1.0

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Gabe Mensinga
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,160 @@
1
- # Temporary Holding Version
1
+ # node-red-contrib-cardata
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Node-RED nodes for **MINI/BMW CarData**: stream the car's state (charge level, range,
4
+ charging status, position) and its charge target into a virtual EV device — e.g. for
5
+ Victron VRM/Dynamic ESS — plus trip tracking built from the car's own odometer and
6
+ position, since CarData itself keeps no trip history.
7
+
8
+ *[Nederlandse versie van deze pagina](README.nl.md).*
9
+
10
+ ## Requirements
11
+
12
+ | | |
13
+ | --- | --- |
14
+ | Node-RED | 3.0 or newer |
15
+ | Node.js | 18 or newer |
16
+ | CarData | a client created in the [CarData portal](https://www.bmw.com/cardata), subscribed to "stream" |
17
+ | Victron VRM (optional) | `@victronenergy/node-red-contrib-victron` (preinstalled on Venus OS; not on npm) for the `victron-virtual` (EV device) node this package's output is meant to feed |
18
+
19
+ ## Nodes
20
+
21
+ | Node | What it does |
22
+ | --- | --- |
23
+ | `cardata-account` | Config node: client ID, VIN, login (device-code flow, button in the editor), container ID (also a button), home location. Shares one client — and its token refresh — with every node below. |
24
+ | `cardata-stream` | Connects to the CarData MQTT stream, parses it into flat paths, and sends the full current state — ready to wire into `victron-virtual`. Reconnects automatically on token refresh, and restores state after a Node-RED restart. |
25
+ | `cardata-target` | Polls the charge target through the REST API (not every vehicle streams it) — hourly by default. |
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
+
28
+ ## Install
29
+
30
+ 1. From the Node-RED editor: **Menu → Manage palette → Install**, search for
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).
51
+
52
+ The virtual device's node ID is kept stable in the example: a Victron virtual device's
53
+ instance is tied to that ID, so a new ID means a second device in VRM.
54
+
55
+ ## Data points to enable in the CarData portal
56
+
57
+ When you configure the datastream for your client, tick these technical descriptors.
58
+ They are the ones `cardata-stream` recognizes (names as listed in the CarData portal; BMW
59
+ notes that availability can vary by vehicle model):
60
+
61
+ | Field | Technical descriptor | Used for |
62
+ | --- | --- | --- |
63
+ | `/Soc` | `vehicle.powertrain.electric.battery.stateOfCharge.displayed` | State of charge as shown in the car. `vehicle.drivetrain.batteryManagement.header` (the high-voltage battery's own figure) is accepted too; if both are on, the latest one received wins. |
64
+ | `/RangeToGo` | `vehicle.drivetrain.electricEngine.kombiRemainingElectricRange` | Remaining electric range in km. |
65
+ | `/ChargingState` | `vehicle.drivetrain.electricEngine.charging.status` | `NOCHARGING`, `INITIALIZATION`, `CHARGINGPAUSED` and `CHARGINGENDED` count as not charging, `CHARGINGACTIVE` as charging, `CHARGINGERROR` as an error. |
66
+ | `/Ac/Power` | `vehicle.powertrain.electric.battery.charging.power` | Current charging power. BMW documents it in watt and says it is only valid for its own timestamp: it is not reset when charging stops, so the package sets it to 0 as soon as the charging status says "not charging". |
67
+ | `/Odometer` | `vehicle.vehicle.travelledDistance` | Odometer in km; the basis of `cardata-trips`. |
68
+ | `/Position/Latitude` | `vehicle.cabin.infotainment.navigation.currentLocation.latitude` | Position (BMW sends it whether or not GPS positioning is switched on in the car's menu); used for `/AtSite` and for trip start/end/pauses. |
69
+ | `/Position/Longitude` | `vehicle.cabin.infotainment.navigation.currentLocation.longitude` | Same. |
70
+
71
+ The charge target is not part of the stream: it comes from the REST container, which
72
+ `cardata-target` polls. That container (made by the "Create container" button) always asks
73
+ for exactly these three descriptors, regardless of what you enable for the stream:
74
+
75
+ ```
76
+ vehicle.powertrain.electric.battery.stateOfCharge.target
77
+ vehicle.powertrain.electric.battery.stateOfCharge.displayed
78
+ vehicle.powertrain.electric.battery.charging.acLimit.selected
79
+ ```
80
+
81
+ BMW also rate-limits the REST side to 50 calls/day per account — `cardata-target`'s
82
+ hourly default uses 24 of those — and allows only **one streaming connection per
83
+ account** at a time, regardless of which client/app opens it (so `cardata-stream` and,
84
+ say, the CarData app or another tool can't both hold the stream at once).
85
+
86
+ ## MQTT settings: tuned on the actual hardware, don't change lightly
87
+
88
+ | | | |
89
+ | --- | --- | --- |
90
+ | Keepalive | 25 s | BMW's broker closes an idle connection after ~60 s. At 60 the first ping lands exactly on that edge and the connection drops every minute. |
91
+ | Protocol version | MQTT v5 | v3.1.1 gives no reason on disconnect; v5 does. |
92
+ | Session | clean (no session expiry set) | A high session-expiry value keeps every dropped session counting and blocks new connections. |
93
+
94
+ `cardata-stream` reconnects (and resubscribes) on every real connect, including after a
95
+ token refresh — the previous connection's password (the ID token) stops working the
96
+ moment a new one is issued, and the broker only checks credentials at connect time.
97
+
98
+ ## What the car can tell you, and what it can't
99
+
100
+ `cardata-stream`'s state only ever reflects what the *car* reports: charge level, range,
101
+ charging status, current, position, and (if a home location is set) whether it's at that
102
+ site. It knows nothing about your home battery or grid connection — pair it with an
103
+ energy manager (Dynamic ESS, or your own) for that.
104
+
105
+ The charge target (`stateOfCharge.target`) isn't streamable for every vehicle, which is
106
+ why `cardata-target` polls the REST API instead (see [Data points](#data-points-to-enable-in-the-cardata-portal)
107
+ for its rate limit).
108
+
109
+ ## Trips
110
+
111
+ `cardata-trips` has no fixed idea of "the car is parked" — CarData doesn't expose an
112
+ ignition or parked signal. It weighs how long the car has been stationary against where
113
+ it is and whether it's charging: 3 minutes at the configured home location is enough,
114
+ 90 minutes while charging (a fast-charging stop shouldn't end a trip), 45 minutes
115
+ anywhere else. A stop of 10 minutes or more gets recorded as a pause inside the trip
116
+ (so a fuel/coffee stop or a charging session shows up, rather than silently extending
117
+ the trip), with its own duration, location and whether the car was charging.
118
+
119
+ A trip still open in memory does not survive a Node-RED restart; the odometer keeps
120
+ counting from where it left off, so the next trip starts from the right distance even
121
+ though the interrupted one is lost. Completed trips are appended as one JSON line per
122
+ trip to the trips file (default: `<Node-RED userDir>/cardata/trips-<node-id>.jsonl`,
123
+ or set your own path on the node) — read them back with:
124
+
125
+ ```sh
126
+ cat <path> | python3 -m json.tool --json-lines
127
+ ```
128
+
129
+ ## Privacy
130
+
131
+ The account node's tokens (access/refresh/ID token, your CarData account ID) live in two
132
+ places. Node-RED's own credential store keeps them encrypted in `flows_cred.json` (never in
133
+ a flow export), but Node-RED only writes that file on a deploy. Token refreshes happen
134
+ in between, and the refresh token you logged in with is replaced after the first one, so
135
+ the latest tokens are also kept in `<Node-RED userDir>/cardata/<account-id>.tokens.json`
136
+ (permissions 600, **not** encrypted — the same trade-off the old `tokens.json` made). On
137
+ startup the newest of the two wins. Latitude/longitude and VIN-like field names are masked in
138
+ `cardata-stream`'s "unknown fields" debug output (`(value hidden)`), so a debug sidebar
139
+ screenshot doesn't leak your location.
140
+
141
+ ## Development
142
+
143
+ ```sh
144
+ npm test # unit tests: parsing, trip logic, OAuth/REST against a fake BMW, node loading, locale keys
145
+ ```
146
+
147
+ `CardataClient` takes optional `authBase`/`apiBase` URLs, which is how the tests point it at
148
+ the fake BMW in `test/fake-cardata-auth.js`.
149
+
150
+ ## Sources
151
+
152
+ Technical descriptors as listed in the CarData portal, cross-checked against
153
+ [evcc's CarData page](https://docs.evcc.io/en/vehicles/bmw-cardata). The MQTT settings
154
+ above were found by trial on real hardware, and the field mapping was checked against the
155
+ stream of a MINI Aceman SE (including that `stateOfCharge.target`, not `targetMin`, is the
156
+ charge target).
157
+
158
+ ## License
159
+
160
+ MIT — see [LICENSE](LICENSE).
package/README.nl.md ADDED
@@ -0,0 +1,164 @@
1
+ # node-red-contrib-cardata
2
+
3
+ Node-RED-nodes voor **MINI/BMW CarData**: de toestand van de auto (accustand, bereik,
4
+ laadstatus, positie) en het laaddoel naar een virtueel EV-apparaat sturen — bijvoorbeeld
5
+ voor Victron VRM/Dynamic ESS — plus ritten bijhouden uit de kilometerstand en positie van
6
+ de auto zelf, want CarData houdt zelf geen ritgeschiedenis bij.
7
+
8
+ *[English version of this page](README.md).*
9
+
10
+ ## Eisen
11
+
12
+ | | |
13
+ | --- | --- |
14
+ | Node-RED | 3.0 of nieuwer |
15
+ | Node.js | 18 of nieuwer |
16
+ | CarData | een client aangemaakt in het [CarData-portaal](https://www.bmw.com/cardata), geabonneerd op "stream" |
17
+ | Victron VRM (optioneel) | `@victronenergy/node-red-contrib-victron` (standaard aanwezig op Venus OS; staat niet op npm) voor de `victron-virtual`-node (EV-apparaat) waar dit pakket zijn uitvoer voor bedoelt |
18
+
19
+ ## Nodes
20
+
21
+ | Node | Doet |
22
+ | --- | --- |
23
+ | `cardata-account` | Config-node: client-ID, VIN, inloggen (device-code flow, knop in de editor), container-ID (ook een knop), thuislocatie. Deelt één client — en de tokenvernieuwing — met alle nodes hieronder. |
24
+ | `cardata-stream` | Verbindt met de CarData MQTT-stream, parseert naar vlakke paden, en stuurt de volledige actuele toestand — klaar om op `victron-virtual` aan te sluiten. Herverbindt automatisch bij tokenvernieuwing, en herstelt de toestand na een herstart van Node-RED. |
25
+ | `cardata-target` | Haalt het laaddoel op via de REST-API (niet elke auto streamt dit) — standaard elk uur. |
26
+ | `cardata-trips` | Bouwt ritten (afstand, duur, pauzes) uit de toestand die `cardata-stream` stuurt. Optioneel; alleen aansluiten als je ritgeschiedenis wilt. |
27
+
28
+ ## Installeren
29
+
30
+ 1. Vanuit de Node-RED-editor: **Menu → Manage palette → Install**, zoek op
31
+ `node-red-contrib-cardata`. Herstart Node-RED daarna; de nodes staan dan onder
32
+ **cardata** in het palet.
33
+ 2. In het CarData-portaal: maak een client aan en abonneer hem op "stream" — noteer het
34
+ client-ID.
35
+ 3. In Node-RED: **Import → Examples → node-red-contrib-cardata → cardata-victron**: de
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).
52
+
53
+ Het node-ID van het virtuele apparaat staat in het voorbeeld bewust vast: het device-instance
54
+ van een Victron virtual device hangt aan dat ID, dus een nieuw ID betekent een tweede
55
+ apparaat in VRM.
56
+
57
+ ## Datapunten aanzetten in het CarData-portaal
58
+
59
+ Vink bij het instellen van de datastream voor je client deze technical descriptors aan.
60
+ Dit zijn de velden die `cardata-stream` herkent (de namen zoals het CarData-portaal ze
61
+ toont; BMW vermeldt dat de beschikbaarheid per automodel kan verschillen):
62
+
63
+ | Veld | Technical descriptor | Gebruikt voor |
64
+ | --- | --- | --- |
65
+ | `/Soc` | `vehicle.powertrain.electric.battery.stateOfCharge.displayed` | Laadstatus zoals die in de auto wordt getoond. `vehicle.drivetrain.batteryManagement.header` (het cijfer van de hoogspanningsaccu zelf) wordt ook geaccepteerd; staan beide aan, dan wint de laatst ontvangen. |
66
+ | `/RangeToGo` | `vehicle.drivetrain.electricEngine.kombiRemainingElectricRange` | Resterende elektrische actieradius in km. |
67
+ | `/ChargingState` | `vehicle.drivetrain.electricEngine.charging.status` | `NOCHARGING`, `INITIALIZATION`, `CHARGINGPAUSED` en `CHARGINGENDED` tellen als niet laden, `CHARGINGACTIVE` als laden, `CHARGINGERROR` als fout. |
68
+ | `/Ac/Power` | `vehicle.powertrain.electric.battery.charging.power` | Huidig laadvermogen. BMW documenteert het in watt en zegt dat het alleen geldt voor zijn eigen tijdstempel: het wordt niet teruggezet als het laden stopt, dus het pakket zet het op 0 zodra de laadstatus "niet laden" meldt. |
69
+ | `/Odometer` | `vehicle.vehicle.travelledDistance` | Kilometerstand; de basis van `cardata-trips`. |
70
+ | `/Position/Latitude` | `vehicle.cabin.infotainment.navigation.currentLocation.latitude` | Positie (BMW stuurt die ook als plaatsbepaling in het menu van de auto uit staat); voor `/AtSite` en voor begin, einde en pauzes van ritten. |
71
+ | `/Position/Longitude` | `vehicle.cabin.infotainment.navigation.currentLocation.longitude` | Idem. |
72
+
73
+ Het laaddoel zit niet in de stream: dat komt uit de REST-container, die `cardata-target`
74
+ polt. Die container (via de knop "Container aanmaken") vraagt altijd precies deze drie
75
+ descriptors, los van wat je voor de stream aanzet:
76
+
77
+ ```
78
+ vehicle.powertrain.electric.battery.stateOfCharge.target
79
+ vehicle.powertrain.electric.battery.stateOfCharge.displayed
80
+ vehicle.powertrain.electric.battery.charging.acLimit.selected
81
+ ```
82
+
83
+ BMW begrenst de REST-kant ook op 50 aanroepen/dag per account — het standaard-interval
84
+ van `cardata-target` (elk uur) gebruikt er 24 — en staat maar **één streamverbinding per
85
+ account** tegelijk toe, ongeacht via welke client/app die loopt (dus `cardata-stream` en
86
+ bijvoorbeeld de CarData-app of een andere tool kunnen niet allebei tegelijk de stream
87
+ vasthouden).
88
+
89
+ ## MQTT-instellingen: uitgezocht op het echte toestel, niet zomaar aanpassen
90
+
91
+ | | | |
92
+ | --- | --- | --- |
93
+ | Keepalive | 25 s | BMW's broker sluit een idle verbinding na ~60 s. Op 60 valt de eerste ping precies op die grens en ligt de verbinding er elke minuut uit. |
94
+ | Protocolversie | MQTT v5 | v3.1.1 geeft bij een verbreking geen reden; v5 wel. |
95
+ | Sessie | schoon (geen sessie-verlooptijd ingesteld) | Een hoge waarde laat elke afgebroken sessie meetellen en blokkeert nieuwe verbindingen. |
96
+
97
+ `cardata-stream` herverbindt (en abonneert opnieuw) bij elke echte verbinding, ook na een
98
+ tokenvernieuwing — het wachtwoord (het ID-token) van de vorige verbinding werkt vanaf dat
99
+ moment niet meer, en de broker controleert dat alleen bij het verbinden zelf.
100
+
101
+ ## Wat de auto wél en niet kan vertellen
102
+
103
+ De toestand van `cardata-stream` is altijd wat de *auto* meldt: accustand, bereik,
104
+ laadstatus, stroom, positie, en (met een ingestelde thuislocatie) of hij daar staat. Hij
105
+ weet niets van je thuisbatterij of aansluiting — daarvoor zet je er een energiemanager
106
+ naast (Dynamic ESS, of je eigen oplossing).
107
+
108
+ Het laaddoel (`stateOfCharge.target`) is niet voor elke auto streambaar, vandaar dat
109
+ `cardata-target` de REST-API polt (zie [Datapunten](#datapunten-aanzetten-in-het-cardata-portaal)
110
+ voor het quotum).
111
+
112
+ ## Ritten
113
+
114
+ `cardata-trips` heeft geen vast idee van "de auto staat geparkeerd" — CarData heeft geen
115
+ contactslot- of geparkeerd-veld. Het weegt hoe lang de auto stilstaat tegen waar hij
116
+ staat en of hij laadt: 3 minuten op de ingestelde thuislocatie is genoeg, 90 minuten
117
+ tijdens het laden (een snellaadsessie mag een rit niet beëindigen), 45 minuten overal
118
+ elders. Een stilstand vanaf 10 minuten komt als pauze in de rit te staan (zo blijft een
119
+ tank- of koffiestop, of een laadsessie, zichtbaar in plaats van de rit stilletjes te
120
+ verlengen), met eigen duur, plek en of er geladen werd.
121
+
122
+ Een rit die nog in het geheugen loopt overleeft een herstart van Node-RED niet; de
123
+ kilometerstand loopt gewoon door, dus de volgende rit begint bij de juiste afstand, ook al
124
+ is die ene onderbroken rit kwijt. Afgeronde ritten komen als één JSON-regel per rit in het
125
+ rittenbestand (standaard: `<Node-RED userDir>/cardata/trips-<node-id>.jsonl`, of zet je
126
+ eigen pad op de node) — uitlezen met:
127
+
128
+ ```sh
129
+ cat <pad> | python3 -m json.tool --json-lines
130
+ ```
131
+
132
+ ## Privacy
133
+
134
+ De tokens van de account-node (access/refresh/ID-token, je CarData-account-ID) staan op
135
+ twee plekken. Node-RED's eigen credential-opslag bewaart ze versleuteld in
136
+ `flows_cred.json` (nooit in een flow-export), maar schrijft dat bestand alleen bij een
137
+ deploy. Tokenvernieuwingen gebeuren daartussen, en de refresh-token waarmee je inlogde is
138
+ na de eerste vernieuwing vervangen, dus de laatste tokens staan ook in
139
+ `<Node-RED userDir>/cardata/<account-id>.tokens.json` (rechten 600, **niet** versleuteld —
140
+ dezelfde afweging als de oude `tokens.json`). Bij het starten wint de nieuwste van de twee.
141
+ Breedte-/lengtegraad en VIN-achtige veldnamen worden verborgen
142
+ in de "unknown fields"-debuguitvoer van `cardata-stream` (`(waarde verborgen)`), zodat een
143
+ screenshot van de debug-sidebar je locatie niet lekt.
144
+
145
+ ## Ontwikkelen
146
+
147
+ ```sh
148
+ npm test # unit tests: parsen, ritlogica, OAuth/REST tegen een nep-BMW, nodes laden, vertaalsleutels
149
+ ```
150
+
151
+ `CardataClient` accepteert optioneel `authBase`/`apiBase`-URL's; zo wijzen de tests hem naar
152
+ de nep-BMW in `test/fake-cardata-auth.js`.
153
+
154
+ ## Bronnen
155
+
156
+ Technical descriptors zoals ze in het CarData-portaal staan, gecontroleerd tegen
157
+ [evcc's CarData-pagina](https://docs.evcc.io/en/vehicles/bmw-cardata). De MQTT-instellingen
158
+ hierboven zijn door uitproberen op echte hardware gevonden, en de veldkoppeling is
159
+ gecontroleerd aan de stream van een MINI Aceman SE (waaronder dat `stateOfCharge.target`,
160
+ niet `targetMin`, het laaddoel is).
161
+
162
+ ## Licentie
163
+
164
+ MIT — zie [LICENSE](LICENSE).
@@ -0,0 +1,136 @@
1
+ [
2
+ {
3
+ "id": "cardata-basic-tab",
4
+ "type": "tab",
5
+ "label": "CarData basic",
6
+ "disabled": false,
7
+ "info": "Fill in the account node (client ID, VIN), deploy once, then click \"Log in\" on it. Wire cardata-stream's first output (and cardata-target's output) into a victron-virtual (EV device) node for real VRM integration — see README."
8
+ },
9
+ {
10
+ "id": "cardata-basic-account",
11
+ "type": "cardata-account",
12
+ "name": "",
13
+ "clientId": "",
14
+ "vin": "",
15
+ "containerId": "",
16
+ "homeLat": "",
17
+ "homeLon": "",
18
+ "homeRadiusM": 150
19
+ },
20
+ {
21
+ "id": "cardata-basic-stream",
22
+ "type": "cardata-stream",
23
+ "z": "cardata-basic-tab",
24
+ "name": "",
25
+ "account": "cardata-basic-account",
26
+ "x": 240,
27
+ "y": 120,
28
+ "wires": [["cardata-basic-dbg-state", "cardata-basic-trips"], ["cardata-basic-dbg-unknown"]]
29
+ },
30
+ {
31
+ "id": "cardata-basic-dbg-state",
32
+ "type": "debug",
33
+ "z": "cardata-basic-tab",
34
+ "name": "state (wire this into victron-virtual)",
35
+ "active": true,
36
+ "tosidebar": true,
37
+ "console": false,
38
+ "tostatus": false,
39
+ "complete": "payload",
40
+ "targetType": "msg",
41
+ "statusVal": "",
42
+ "statusType": "auto",
43
+ "x": 520,
44
+ "y": 100,
45
+ "wires": []
46
+ },
47
+ {
48
+ "id": "cardata-basic-dbg-unknown",
49
+ "type": "debug",
50
+ "z": "cardata-basic-tab",
51
+ "name": "unknown fields",
52
+ "active": true,
53
+ "tosidebar": true,
54
+ "console": false,
55
+ "tostatus": false,
56
+ "complete": "payload",
57
+ "targetType": "msg",
58
+ "statusVal": "",
59
+ "statusType": "auto",
60
+ "x": 490,
61
+ "y": 160,
62
+ "wires": []
63
+ },
64
+ {
65
+ "id": "cardata-basic-target",
66
+ "type": "cardata-target",
67
+ "z": "cardata-basic-tab",
68
+ "name": "",
69
+ "account": "cardata-basic-account",
70
+ "intervalMinutes": 60,
71
+ "x": 240,
72
+ "y": 220,
73
+ "wires": [["cardata-basic-dbg-target"]]
74
+ },
75
+ {
76
+ "id": "cardata-basic-dbg-target",
77
+ "type": "debug",
78
+ "z": "cardata-basic-tab",
79
+ "name": "target SoC (wire this into victron-virtual too)",
80
+ "active": true,
81
+ "tosidebar": true,
82
+ "console": false,
83
+ "tostatus": false,
84
+ "complete": "payload",
85
+ "targetType": "msg",
86
+ "statusVal": "",
87
+ "statusType": "auto",
88
+ "x": 530,
89
+ "y": 220,
90
+ "wires": []
91
+ },
92
+ {
93
+ "id": "cardata-basic-trips",
94
+ "type": "cardata-trips",
95
+ "z": "cardata-basic-tab",
96
+ "name": "",
97
+ "filePath": "",
98
+ "x": 240,
99
+ "y": 300,
100
+ "wires": [["cardata-basic-dbg-trip"], ["cardata-basic-dbg-inprogress"]]
101
+ },
102
+ {
103
+ "id": "cardata-basic-dbg-trip",
104
+ "type": "debug",
105
+ "z": "cardata-basic-tab",
106
+ "name": "completed trip",
107
+ "active": true,
108
+ "tosidebar": true,
109
+ "console": false,
110
+ "tostatus": true,
111
+ "complete": "payload",
112
+ "targetType": "msg",
113
+ "statusVal": "payload.km",
114
+ "statusType": "jsonata",
115
+ "x": 500,
116
+ "y": 280,
117
+ "wires": []
118
+ },
119
+ {
120
+ "id": "cardata-basic-dbg-inprogress",
121
+ "type": "debug",
122
+ "z": "cardata-basic-tab",
123
+ "name": "trip in progress",
124
+ "active": false,
125
+ "tosidebar": true,
126
+ "console": false,
127
+ "tostatus": false,
128
+ "complete": "payload",
129
+ "targetType": "msg",
130
+ "statusVal": "",
131
+ "statusType": "auto",
132
+ "x": 500,
133
+ "y": 320,
134
+ "wires": []
135
+ }
136
+ ]