Skip to content

Commit 7cce24d

Browse files
authored
Merge pull request #183 from jay-oswald/vehicle-profiles-class
add class to vehicle profiles
2 parents 95d22b3 + 205fa73 commit 7cce24d

File tree

7 files changed

+29
-11
lines changed

7 files changed

+29
-11
lines changed

.vehicle_profiles/schema.json

+6
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"minItems": 1,
1818
"items": {
1919
"type": "object",
20+
"required": ["pid"],
2021
"properties": {
2122
"pid": {
2223
"description": "The PID for this group of parameters",
@@ -28,6 +29,7 @@
2829
"minItems": 1,
2930
"items": {
3031
"type": "object",
32+
"required": ["name", "expression", "unit", "class"],
3133
"properties": {
3234
"name": {
3335
"description": "Used in MQTT JSON, no spaces",
@@ -40,6 +42,10 @@
4042
"unit": {
4143
"description": "Unit for this parameter",
4244
"type": "string"
45+
},
46+
"class": {
47+
"description": "Class of sensor, See Home Assistant sensor classes",
48+
"type": "string"
4349
}
4450
}
4551
}

vehicle_profiles/README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ If you would like to add/update a car please make sure it is formatted properly,
1717

1818
**expression**: The expression used to calculate the parameter value
1919

20-
**unit**: The unit of the parameter, e.g., %, °C, or others
20+
**unit**: The unit of the parameter, e.g., %, °C, or others, see [Home Assistant List](https://www.home-assistant.io/integrations/sensor/#device-class)
21+
22+
**class**: The class of the sensor, see [Home Assistant List](https://www.home-assistant.io/integrations/sensor/#device-class)
2123

2224
**Example:**
2325
```

vehicle_profiles/bmw/i3.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
{
99
"name": "SoC",
1010
"expression": "[B11:B12]/10",
11-
"unit": "%"
11+
"unit": "%",
12+
"class": "battery"
1213
}
1314
]
1415
}

vehicle_profiles/byd/atto3.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
{
99
"name": "SOC",
1010
"expression": "(B5*256)+B4)/100",
11-
"unit": "%"
11+
"unit": "%",
12+
"class": "battery"
1213
}
1314
]
1415
}

vehicle_profiles/generic.json

+8-4
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
{
99
"name": "Engine RPM",
1010
"expression": "[B3:B4]*0.25",
11-
"unit": "RPM"
11+
"unit": "RPM",
12+
"class": "frequency"
1213
}
1314
]
1415
},
@@ -18,7 +19,8 @@
1819
{
1920
"name": "Vehicle Speed",
2021
"expression": "B3",
21-
"unit": "KM"
22+
"unit": "km/h",
23+
"class": "speed"
2224
}
2325
]
2426
},
@@ -28,12 +30,14 @@
2830
{
2931
"name": "value1",
3032
"expression": "B10/10",
31-
"unit": "%"
33+
"unit": "%",
34+
"class": "battery"
3235
},
3336
{
3437
"name": "value2",
3538
"expression": "(B19+B20)/2",
36-
"unit": "%"
39+
"unit": "%",
40+
"class": "battery"
3741
}
3842
]
3943
}

vehicle_profiles/hyundai/ioniq5-6.json

+6-3
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,14 @@
88
{
99
"name": "SOC_BMS",
1010
"expression": "B10/2",
11-
"unit": "%"
11+
"unit": "%",
12+
"class": "battery"
1213
},
1314
{
1415
"name": "Aux_Batt_Volts",
1516
"expression": "B38*0.1",
16-
"unit": "V"
17+
"unit": "V",
18+
"class": "voltage"
1719
}
1820
]
1921
},
@@ -23,7 +25,8 @@
2325
{
2426
"name": "SOH",
2527
"expression": "[B34:B35]/10",
26-
"unit": "%"
28+
"unit": "%",
29+
"class": "battery"
2730
}
2831
]
2932
}

vehicle_profiles/renault/kangoo-ze.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
{
99
"name": "SoC",
1010
"expression": "((B4*256)+B5)/50",
11-
"unit": "%"
11+
"unit": "%",
12+
"class": "battery"
1213
}
1314
]
1415
}

0 commit comments

Comments
 (0)