Skip to content

Commit 9d75ad7

Browse files
Add new sensor category and metric enums (#93)
In our terminology, `components` are the devices that are connected to a microgrid's electrical circuit, and `sensors` are the devices that measure the physical parameters of the environment. Hence, we need to distinguish between the two, and we need to be able to identify the type of sensor and the type of metric that it measures. This commit adds the `frequenz.api.common.v1.sensors` package, which contains the `SensorCategory` and `SensorMetric` enums. Also, this commit removes * the `COMPONENT_CATEGORY_SENSOR` variant from the `ComponentCategory` enum, and * The `SensorType` enum.
2 parents 62fc411 + 8cb9bcc commit 9d75ad7

File tree

3 files changed

+83
-30
lines changed

3 files changed

+83
-30
lines changed

RELEASE_NOTES.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@
1010
`frequenz.api.common.v1.<package>`. `v1` is the API's major version, and will
1111
be incremented for breaking changes.
1212

13+
- Added `frequenz.api.common.sensors` package, containing the enums
14+
`SensorCategory` and `SensorType`. Removed the component category variant
15+
`COMPONENT_CATEGORY_SENSOR` and the enum `SensorType` from
16+
`frequenz.api.common.components`.
17+
1318
## New Features
1419

1520
- Added a new component category variant: `COMPONENT_CATEGORY_FUSE`.

proto/frequenz/api/common/v1/components.proto

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,6 @@ enum ComponentCategory {
3434
// A station for charging electrical vehicles.
3535
COMPONENT_CATEGORY_EV_CHARGER = 6;
3636

37-
// A sensor for measuring ambient metrics, e.g., temperature, humidity, etc.
38-
COMPONENT_CATEGORY_SENSOR = 7;
39-
4037
// A crypto miner.
4138
COMPONENT_CATEGORY_CRYPTO_MINER = 8;
4239

@@ -115,30 +112,3 @@ enum EvChargerType {
115112
// The EV charging station supports both AC and DC.
116113
EV_CHARGER_TYPE_HYBRID = 3;
117114
}
118-
119-
// Enumerated sensor types.
120-
enum SensorType {
121-
// Unspecified
122-
SENSOR_TYPE_UNSPECIFIED = 0;
123-
124-
// Thermometer (temperature sensor)
125-
SENSOR_TYPE_THERMOMETER = 1;
126-
127-
// Hygrometer (humidity sensor)
128-
SENSOR_TYPE_HYGROMETER = 2;
129-
130-
// Barometer (pressure sensor).
131-
SENSOR_TYPE_BAROMETER = 3;
132-
133-
// Pyranometer (solar irradiance sensor).
134-
SENSOR_TYPE_PYRANOMETER = 4;
135-
136-
// Anemometer (wind velocity and direction sensor).
137-
SENSOR_TYPE_ANEMOMETER = 5;
138-
139-
// Accelerometers (acceleration sensor).
140-
SENSOR_TYPE_ACCELEROMETER = 6;
141-
142-
// General sensors, which do not fall in any of the above categories
143-
SENSOR_TYPE_GENERAL = 7;
144-
}
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
// Frequenz microgrid sensor definitions.
2+
//
3+
// Copyright:
4+
// Copyright 2023 Frequenz Energy-as-a-Service GmbH
5+
//
6+
// License:
7+
// MIT
8+
9+
syntax = "proto3";
10+
11+
package frequenz.api.common.v1.sensors;
12+
13+
// Enumerated sensor categories.
14+
enum SensorCategory {
15+
// Unspecified
16+
SENSOR_CATEGORY_UNSPECIFIED = 0;
17+
18+
// Thermometer (temperature sensor)
19+
SENSOR_CATEGORY_THERMOMETER = 1;
20+
21+
// Hygrometer (humidity sensor)
22+
SENSOR_CATEGORY_HYGROMETER = 2;
23+
24+
// Barometer (pressure sensor).
25+
SENSOR_CATEGORY_BAROMETER = 3;
26+
27+
// Pyranometer (solar irradiance sensor).
28+
SENSOR_CATEGORY_PYRANOMETER = 4;
29+
30+
// Anemometer (wind velocity and direction sensor).
31+
SENSOR_CATEGORY_ANEMOMETER = 5;
32+
33+
// Accelerometers (acceleration sensor).
34+
SENSOR_CATEGORY_ACCELEROMETER = 6;
35+
36+
// General sensors, which do not fall in any of the above categories
37+
SENSOR_CATEGORY_GENERAL = 7;
38+
}
39+
40+
// Enumrated sensor metrics.
41+
enum SensorMetric {
42+
// Unspecified.
43+
SENSOR_METRIC_UNSPECIFIED = 0;
44+
45+
// Temperature.
46+
// In Celsius (°C).
47+
SENSOR_METRIC_TEMPERATURE = 1;
48+
49+
// Humidity
50+
// In percentage (%).
51+
SENSOR_METRIC_HUMIDITY = 2;
52+
53+
// Pressure
54+
// In Pascal (Pa).
55+
SENSOR_METRIC_PRESSURE = 3;
56+
57+
// Irradiance / Radiation flux
58+
// In watts per square meter (W / m^2).
59+
SENSOR_METRIC_IRRADIANCE = 4;
60+
61+
// Velocity
62+
// In meters per second (m / s).
63+
SENSOR_METRIC_VELOCITY = 5;
64+
65+
// Acceleration.
66+
// In meters per second per second (m / s^2)
67+
SENSOR_METRIC_ACCELERATION = 6;
68+
69+
// Metric to represent angles, for metrics like direction.
70+
// In angles with respect to the (magnetic) North (°).
71+
SENSOR_METRIC_ANGLE = 7;
72+
73+
// Dew point.
74+
// The temperature at which the air becomes saturated with water vapor.
75+
//
76+
// In Celsius (°C).
77+
SENSOR_METRIC_DEW_POINT = 8;
78+
}

0 commit comments

Comments
 (0)