Skip to content

Commit b81bb75

Browse files
authored
Merge pull request #239 from camueller/automate-doc
Automate documentation / Supported vehicles list
2 parents 116229b + 8800066 commit b81bb75

File tree

9 files changed

+95
-5
lines changed

9 files changed

+95
-5
lines changed

.vehicle_profiles/merge.js

+19-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,24 @@ result.cars.sort((a,b) => {
2828
return (first < second) ? -1 : (first > second ) ? 1 : 0;
2929
});
3030

31-
result = JSON.stringify(result);
31+
const resultString = JSON.stringify(result);
3232
//Use below line instead for generating pretty json
3333
// result = JSON.stringify(result, null, 2);
34-
await writeFile(target, result)
34+
await writeFile(target, resultString)
35+
36+
const models = result.cars.map(car => car.car_model).filter(model => model !== 'AAA: Generic');
37+
let supportedVehiclesListContent = '';
38+
supportedVehiclesListContent += '<!--\n';
39+
supportedVehiclesListContent += '================================================================\n'
40+
supportedVehiclesListContent += 'THIS FILE WAS GENERATED! DO NOT UPDATE OR YOUR CHANGES ARE LOST!\n'
41+
supportedVehiclesListContent += '================================================================\n'
42+
supportedVehiclesListContent += '-->\n';
43+
supportedVehiclesListContent += '# Supported Vehicles\n';
44+
supportedVehiclesListContent += 'For vehicles listed below a WiCAN vehicle profiles exists:\n';
45+
models.forEach(model => supportedVehiclesListContent += `- ${model}\n`);
46+
47+
const supportedVehiclesListFilepath = await glob('../docs/content/*.Config/*.Automate/*.Supported_Vehicles.md')
48+
if(supportedVehiclesListFilepath.length == 0 || supportedVehiclesListFilepath.length != 1) {
49+
throw new Error('Unable to determine automateDirectory');
50+
}
51+
await writeFile(supportedVehiclesListFilepath[0], supportedVehiclesListContent);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
---
2+
title: Usage
3+
---
4+
5+
# Automate
6+
7+
The "Automate" feature can be used to **periodically request one or more PID**s.
8+
9+
First of all **the `Protocol` in the `CAN` section on the "Settings" tab has to be set to `AutoPID`**
10+
11+
Configuration of "Automate" itself is done on the "Automate" tab.
12+
13+
Responses can be monitored:
14+
- by monitoring the MQTT subject configured if [MQTT is enabled](../MQTT.md)
15+
![image](/config/automate/monitor_mqtt.png)
16+
17+
- pointing the Web browser to `http://<WiCAN IP adress>/autopid_data` if [MQTT is NOT enabled](../MQTT.md)
18+
![image](/config/automate/monitor_http.png)
19+
20+
## Vehicle Profiles
21+
Initially the download of **vehicle profiles** has to be triggered by pressing the sync button next to the `Vehicle Model` dropdown box. These vehicle profiles are car vendor and/or model specific and contain some popular PIDs (e.g. SoC, SoH). There is a growing [list of supported vehicles](2.Supported_Vehicles.md).
22+
23+
If WiCAN cannot download vehicles profiles for any reason you man also [download in manually](https://github.com/meatpiHQ/wican-fw/blob/main/vehicle_profiles.json) and press the `Choose File` button to select the file downloaded.
24+
25+
In order to use vehicle profiles `Vehicle Specific` has to be set to `Enable`.
26+
27+
If vehicles profiles are available to WiCAN the appropriate `Vehicle Model` should be selected from the drop-down box. Use the reload button next to it to trigger the download of the most up-to-date vehicle profiles.
28+
29+
In `Cycle Time(ms)` the interval is configured after which the PIDs, contained in the vehicle profile, are requested.
30+
31+
The results are posted to the MQTT topic specified in `Destination Topic` if [MQTT is enabled](../MQTT.md).
32+
33+
![image](/config/automate/automate.png)
34+
35+
36+
## Custom PIDs
37+
38+
If there is no vehicle profile for your car, or it does not contain the PIDs you would like to use, the "Custom PIDs" feature should be used. Basically the same parameters as contained in the vehicle profiles can be entered:
39+
40+
- **Custom Initialisation**: will be sent by WiCAN prior requesting particular PIDs
41+
- **Name**: the attribute name containing the result of the PID request
42+
- **Init**: will be sent by WiCAN prior requesting this particular PID
43+
- **Expression**: is used to calculate the attribute value from the bytes returned for this PID
44+
- **Period**: the interval after which this PID is requested again
45+
- **Type**: currently only `MQTT_Topic` can be selected
46+
- **Send_to**: the MQTT topic the result should be sent to
47+
48+
In order to add more PIDs the `New` button can be used.
49+
The `Delete` button deletes the configuration of the corresponding PID
50+
51+
In order to use Custom PIDs `Vehicle Specific` has to be set to `Disable`.
52+
53+
**At the moment Custom PIDs are only supported over MQTT**. Therefore [MQTT has to be enabled](../MQTT.md).
54+
55+
![image](/config/automate/custom_pids.png)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<!--
2+
================================================================
3+
THIS FILE WAS GENERATED! DO NOT UPDATE OR YOUR CHANGES ARE LOST!
4+
================================================================
5+
-->
6+
# Supported Vehicles
7+
For vehicles listed below a WiCAN vehicle profiles exists:
8+
- BMW: i3
9+
- BYD: Atto 3
10+
- Hyundai: Ioniq2017
11+
- Hyundai: Ioniq5/Ioniq6/Kona
12+
- Jaguar: I-PACE
13+
- Kia: Niro PHEV
14+
- Nissan : leaf-ze1
15+
- Renault: Kangoo Z.E
16+
- Toyota: Rav4
17+
- VW: e-Golf
18+
- VW: e-Up
19+
- VW: id-3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
title: Automate
2+
icon: material-symbols:automation

docs/content/0.Config/Automate.md

-3
This file was deleted.
73.4 KB
Loading
91.5 KB
Loading
13 KB
Loading
8.56 KB
Loading

0 commit comments

Comments
 (0)