|
1 | | -# Purpose |
2 | | - |
3 | | -This specification is intended to define a standardized way of communicating with lighting systems for real-time monitoring and control and to allow data collection between control systems and / or peripheral devices. |
4 | | - |
5 | | -**NOTE:** need to add API to query last-known update...identify what was done and when (and by whom?) |
6 | | - |
7 | | -# Scope |
8 | | - |
9 | | -The scope of this document is limited to providing a payload structure and endpoint type definitions to allow basic control and data acquisition. The addition of product specific features is left to the implementer, but to be in compliance the product must support the basic set of features specified below. |
10 | | - |
11 | | -# Definitions |
12 | | - |
13 | | -The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119. |
14 | | - |
15 | | -# Endpoints |
16 | | -## Sensors |
17 | | -### Talking to one sensor |
18 | | -**Retrieving ID information** |
19 | | -``` |
20 | | -GET http://[domain:port]/agroapi/[version]/lights/sensors/[sensorid]/info |
21 | | -``` |
22 | | -Returns [Info](general.md#info-data) |
23 | | - |
24 | | -**Sending ID information** |
25 | | -``` |
26 | | -POST http://[domain:port]/agroapi/[version]/lights/sensors/[sensorid]/info |
27 | | -``` |
28 | | -Sends [Info](general.md#info-data) |
29 | | - |
30 | | -**Retrieving version information** |
31 | | -``` |
32 | | -GET http://[domain:port]/agroapi/[version]/lights/sensors/[sensorid]/version |
33 | | -``` |
34 | | -Returns [Version](general.md#version-data) |
35 | | - |
36 | | -**Retrieving location information** |
37 | | -``` |
38 | | -GET http://[domain:port]/agroapi/[version]/lights/sensors/[sensorid]/location |
39 | | -``` |
40 | | -Returns [Location](general.md#location-data) |
41 | | - |
42 | | -**Sending location information** |
43 | | -``` |
44 | | -POST http://[domain:port]/agroapi/[version]/lights/sensors/[sensorid]/location |
45 | | -``` |
46 | | -Sends [Location](general.md#location-data) |
| 1 | +## Example Document Snippets |
| 2 | + |
| 3 | +```yaml |
| 4 | +/sensors: |
| 5 | + get: |
| 6 | + description: Returns all sensors from the system that the user has access to |
| 7 | + responses: |
| 8 | + '200': |
| 9 | + description: A list of sensors. |
| 10 | + content: |
| 11 | + application/json: |
| 12 | + schema: |
| 13 | + type: array |
| 14 | + items: |
| 15 | + $ref: '#/components/schemas/Sensor' |
| 16 | +/sensors/{sensorId}: |
| 17 | + get: |
| 18 | + summary: Info for a specific sensor |
| 19 | + operationId: showSensorById |
| 20 | + tags: |
| 21 | + - sensors |
| 22 | + parameters: |
| 23 | + - name: sensorId |
| 24 | + in: path |
| 25 | + required: true |
| 26 | + description: The id of the sensor to retrieve |
| 27 | + schema: |
| 28 | + type: string |
| 29 | + responses: |
| 30 | + '200': |
| 31 | + description: Expected response to a valid request |
| 32 | + content: |
| 33 | + application/json: |
| 34 | + schema: |
| 35 | + $ref: "#/components/schemas/Sensors" |
| 36 | + default: |
| 37 | + description: unexpected error |
| 38 | + content: |
| 39 | + application/json: |
| 40 | + schema: |
| 41 | + $ref: "#/components/schemas/Error" |
| 42 | + |
| 43 | +/sensors/{sensorId}/measurements: |
| 44 | + get: |
| 45 | + description: Returns spectrum measurements from a specific sensor |
| 46 | + parameters: |
| 47 | + - name: format |
| 48 | + in: query |
| 49 | + required: false |
| 50 | + description: PPF or PPFD |
| 51 | + schema: |
| 52 | + type: string |
| 53 | + responses: |
| 54 | + '200': |
| 55 | + description: A list of measurements |
| 56 | + content: |
| 57 | + application/json: |
| 58 | + schema: |
| 59 | + type: array |
| 60 | + items: |
| 61 | + $ref: '#/components/schemas/SpectrumMeasurement' |
| 62 | + |
| 63 | +``` |
| 64 | + |
| 65 | +### Example Schema |
| 66 | + |
| 67 | +Sensor |
| 68 | + |
| 69 | +```yaml |
| 70 | +type: object |
| 71 | +required: |
| 72 | +- id |
| 73 | +properties: |
| 74 | + name: |
| 75 | + type: string |
| 76 | + info: |
| 77 | + type: string |
| 78 | + version: |
| 79 | + type: string |
| 80 | + location: |
| 81 | + ***TODO: LOCATION FORMAT*** general.md#location-data |
| 82 | + age: |
| 83 | + type: integer |
| 84 | + format: int32 |
| 85 | + minimum: 0 |
| 86 | +``` |
| 87 | +
|
| 88 | +Measurement |
| 89 | +
|
| 90 | +```yaml |
| 91 | +type: object |
| 92 | +required: |
| 93 | +- id |
| 94 | +properties: |
| 95 | + id: |
| 96 | + description: Unique id of the device |
| 97 | + type: string |
| 98 | + timestamp: |
| 99 | + description: UTC timestamp of the measurement |
| 100 | + type: string |
| 101 | + red: |
| 102 | + description: Level of red spectrum light |
| 103 | + type: string |
| 104 | + blue: |
| 105 | + description: Level of blue spectrum light |
| 106 | + type: string |
| 107 | + green: |
| 108 | + description: Level of green spectrum light |
| 109 | + type: string |
| 110 | + uv: |
| 111 | + description: Level of ultraviolet light |
| 112 | + type: string |
| 113 | + infrared: |
| 114 | + description: Level of infrared light |
| 115 | + type: string |
| 116 | + par: |
| 117 | + description: Level of absorbable light |
| 118 | + type: string |
| 119 | + light: |
| 120 | + description: Level of all spectrums of light |
| 121 | + type: string |
| 122 | +``` |
| 123 | +
|
| 124 | +## Example requests |
47 | 125 |
|
48 | 126 | **Retrieving spectrum measurements as PPF** |
49 | 127 | ``` |
@@ -143,31 +221,7 @@ GET http://[domain:port]/agroapi/[version]/zones/[zoneid]/lights/sensors/ppfd |
143 | 221 | ``` |
144 | 222 | Returns an array of [Light PPFD](lights.md#light-ppfd) |
145 | 223 |
|
146 | | -### Light PPF |
147 | | -| Name | Description | Unit | |
148 | | -| --------- | -------------------------------- | -------- | |
149 | | -| id | Unique id of the device | uid | |
150 | | -| timestamp | UTC timestamp of the measurement | datetime | |
151 | | -| red | Level of red spectrum light | PPF | |
152 | | -| blue | Level of blue spectrum light | PPF | |
153 | | -| green | Level of green spectrum light | PPF | |
154 | | -| uv | Level of ultraviolet light | PPF | |
155 | | -| infrared | Level of infrared light | PPF | |
156 | | -| par | Level of absorbable light | PPF | |
157 | | -| light | Level of all spectrums of light | PPF | |
158 | | - |
159 | | -### Light PPFD |
160 | | -| Name | Description | Unit | |
161 | | -| --------- | -------------------------------- | -------- | |
162 | | -| id | Unique id of the device | uid | |
163 | | -| timestamp | UTC timestamp of the measurement | datetime | |
164 | | -| red | Level of red spectrum light | PPFD | |
165 | | -| blue | Level of blue spectrum light | PPFD | |
166 | | -| green | Level of green spectrum light | PPFD | |
167 | | -| uv | Level of ultraviolet light | PPFD | |
168 | | -| infrared | Level of infrared light | PPFD | |
169 | | -| par | Level of absorbable light | PPFD | |
170 | | -| light | Level of all spectrums of light | PPFD | |
| 224 | + |
171 | 225 |
|
172 | 226 | ## Fixtures |
173 | 227 | ### Talking to one fixture |
|
0 commit comments