-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathwb-mqtt-snmp.schema.json
296 lines (285 loc) · 11.6 KB
/
wb-mqtt-snmp.schema.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"title": "snmp_title",
"description": "snmp_description",
"configFile": {
"path": "/etc/wb-mqtt-snmp.conf",
"service": "wb-mqtt-snmp"
},
"definitions": {
"device": {
"type": "object",
"title": "SNMP device",
"properties": {
"enabled": {
"type": "boolean",
"title": "Enable device",
"default": true,
"_format": "checkbox",
"propertyOrder": 1
},
"name": {
"type": "string",
"title": "Device name",
"description": "Device name to be displayed in UI",
"minLength": 1,
"propertyOrder": 10
},
"id": {
"type": "string",
"title": "MQTT ID of the device",
"description": "Used as a part of a MQTT topic name",
"minLength": 1,
"propertyOrder": 20
},
"address": {
"type": "string",
"title": "SNMP device address",
"description": "May be either IP address or domain name",
"minLength": 1,
"propertyOrder": 30
},
"device_type": {
"type": "string",
"title": "Device type",
"description": "Selects device template",
"enum": {
"directories": ["/usr/share/wb-mqtt-snmp/templates"],
"pointer": "/device_type",
"pattern": "^.*\\.json"
},
"propertyOrder": 40
},
"community": {
"type": "string",
"title": "SNMP community string",
"description": "password",
"propertyOrder": 60
},
"oid_prefix": {
"type": "string",
"title": "SNMP object ID prefix (MIB name)",
"description": "oid_prefix_description",
"default": "",
"propertyOrder": 70
},
"snmp_version": {
"type": "string",
"title": "SNMP protocol version for device",
"enum": [ "1", "2c" ],
"default": "2c",
"propertyOrder": 80
},
"snmp_timeout": {
"type": "integer",
"title": "SNMP timeout (s)",
"minimum": 0,
"default": 5,
"propertyOrder": 90
},
"poll_interval": {
"type": "integer",
"title": "Desired default poll interval (ms)",
"description": "poll_interval_description",
"minimum": 0,
"default": 1000,
"propertyOrder": 95
},
"channels": {
"type": "array",
"title": "List of channels",
"description": "channels_description",
"items": { "$ref": "#/definitions/channel" },
"propertyOrder": 99
}
},
"options": {
"disable_edit_json": true
},
"required": ["address"],
"defaultProperties": ["address", "device_type", "enabled"]
},
"channel": {
"type": "object",
"title": "Channel",
"properties": {
"enabled": {
"type": "boolean",
"title": "Enable channel",
"default": true,
"_format": "checkbox",
"propertyOrder": 1
},
"name": {
"type": "string",
"title": "Control name",
"description": "This name is displayed both in MQTT topic and UI",
"minLength": 1,
"propertyOrder": 10
},
"oid": {
"type": "string",
"title": "Object ID",
"description": "OID (starting from dot) or variable name from MIB",
"propertyOrder": 20
},
"control_type": {
"type": "string",
"title": "Control type",
"description": "Defaults to 'text'",
"enum": [ "text", "value", "temperature", "voltage", "power" ],
"propertyOrder": 30
},
"units": {
"type": "string",
"title": "Units",
"default": "",
"description": "units_description",
"propertyOrder": 35,
"_format": "edWb",
"options": {
"enum_values": ["mm/h", "m/s", "W", "kWh", "V", "mV", "m^3/h", "m^3", "Gcal/h", "cal", "Gcal", "Ohm", "mOhm", "bar", "mbar", "s", "min", "h", "m", "g", "kg", "mol", "cd", "%, RH", "deg C", "%", "ppm", "ppb", "A", "mA", "deg", "rad", "lx", "dB", "Hz", "rpm"],
"enum_titles": ["mm/h", "m/s", "W", "kWh", "V", "mV", "m³/h", "m³", "Gcal/h", "cal", "Gcal", "Ohm", "mOhm", "bar", "mbar (100 Pa)", "s", "min", "h", "m", "g", "kg", "mol", "cd", "%, RH", "°C", "%", "ppm", "ppb", "A", "mA", "°", "rad", "lx", "dB", "Hz", "rpm"]
}
},
"scale": {
"type": "number",
"title": "Scale (value multiplier)",
"default": 1,
"propertyOrder": 40
},
"poll_interval": {
"type": "integer",
"title": "Desired poll interval (ms)",
"description": "poll_interval_description",
"minimum": 0,
"default": 1000,
"propertyOrder": 50
}
},
"options": {
"disable_edit_json": true
},
"required": [ "name" ]
}
},
"properties": {
"debug": {
"type": "boolean",
"title": "Enable debug logging",
"default": false,
"_format": "checkbox",
"propertyOrder": 10
},
"num_workers": {
"type": "integer",
"title": "Number of SNMP connections",
"description": "Number of SNMP clients running simultaneously",
"default": 4,
"maximum": 64,
"propertyOrder": 15
},
"devices": {
"type": "array",
"title": "List of devices",
"description": "Hosts to be accessed by driver",
"items": { "$ref": "#/definitions/device" },
"_format": "list",
"propertyOrder": 20
},
"max_unchanged_interval": {
"type": "integer",
"title": "Unchanged value posting interval (s)",
"description": "max_unchanged_interval_description",
"default": -1,
"propertyOrder": 30
}
},
"required": [ "devices" ],
"options": {
"disable_edit_json": true
},
"translations": {
"en": {
"snmp_title": "SNMP Device Driver Configuration",
"snmp_description": "List devices to poll via SNMP protocol",
"oid_prefix_description": "Common prefix for names in channel OIDs (for SNMPv2-MIB::sysLocation.0 prefix is SNMPv2-MIB). May be overriden by writing OID in channel with prefix and '::'",
"poll_interval_description": "Total duration of the poll cycle",
"channels_description": "List device variables and their corresponding controls",
"units_description": "Value units of measure (V, A, kWh etc.). Only for control_type == 'value'",
"max_unchanged_interval_description": "Maximum interval between posting the same value to message queue. Zero - post at every reading, negative - don't post the same values"
},
"ru": {
"snmp_title": "Настройка драйвера SNMP-устройств",
"snmp_description": "Список устройств для опроса по протоколу SNMP",
"SNMP device": "SNMP устройство",
"Enable device": "Опрашивать устройство",
"Device name": "Имя устройства",
"Device name to be displayed in UI": "Заголовок карточки устройства в веб-интерфейсе контроллера",
"MQTT ID of the device": "MQTT идентификатор устройства",
"Used as a part of a MQTT topic name": "Используется как часть имени топика MQTT",
"SNMP device address": "Адрес устройства SNMP",
"May be either IP address or domain name": "Может быть IP-адресом или именем домена",
"Device type": "Тип устройства",
"Selects device template": "Выбирает шаблон устройства",
"password": "пароль",
"SNMP object ID prefix (MIB name)": "Префикс идентификатора объекта SNMP (имя MIB)",
"oid_prefix_description": "Общий префикс для имен в идентификаторах каналов (для SNMPv2-MIB::sysLocation.0 префикс - SNMPv2-MIB). Может быть переопределен путем записи OID в канал с префиксом и '::'",
"SNMP protocol version for device": "Версия протокола SNMP для устройства",
"SNMP timeout (s)": "Таймаут SNMP (с)",
"Desired default poll interval (ms)": "Желаемый интервал опроса по умолчанию (мс)",
"poll_interval_description": "Задаёт общую продолжительность цикла опроса",
"List of channels": "Список каналов",
"channels_description": "Список переменных устройства и соответствующих им элементов управления",
"Channel": "Канал",
"Enable channel": "Включить канал",
"Control name": "Имя элемента управления",
"This name is displayed both in MQTT topic and UI": "Название канала устройства в MQTT и веб-интерфейсе контроллера",
"Object ID": "Идентификатор объекта",
"OID (starting from dot) or variable name from MIB": "OID (начиная с точки) или имя переменной из MIB",
"Control type": "Тип элемента управления",
"Defaults to 'text'": "По умолчанию - 'text'",
"Units": "Единицы измерения",
"units_description": "Единицы измерения значения (В, А, кВтч и т.д.). Только для control_type == 'value'",
"Scale (value multiplier)": "Множитель значения",
"Desired poll interval (ms)": "Желаемый интервал опроса (мс)",
"Enable debug logging": "Включить отладочное логирование",
"Number of SNMP connections": "Количество соединений SNMP",
"Number of SNMP clients running simultaneously": "Количество одновременно работающих SNMP-клиентов",
"List of devices": "Список устройств",
"Hosts to be accessed by driver": "Хосты, к которым обращается драйвер",
"Unchanged value posting interval (s)": "Интервал публикации неизмененных значений (с)",
"max_unchanged_interval_description": "Максимальный интервал между публикациями одинаковых значений в очередь сообщений. Ноль - публиковать при каждом чтении, отрицательное значение - не публиковать одинаковые значения",
"mm/h": "мм/ч",
"m/s": "м/с",
"W": "Вт",
"kWh": "кВтч",
"V": "В",
"mV": "мВ",
"mA": "мА",
"m³/h": "м³/ч",
"m³": "м³",
"Gcal/h": "Гкал/ч",
"cal": "кал",
"Gcal": "Гкал",
"Ohm": "Ом",
"mOhm": "мОм",
"bar": "бар",
"mbar (100 Pa)": "мбар (100 Па)",
"s": "c",
"min": "мин",
"h": "ч",
"m": "м",
"g": "г",
"kg": "кг",
"mol": "моль",
"cd": "кд",
"rad": "рад",
"lx": "лк",
"dB": "дБ",
"Hz": "Гц",
"rpm": "об/мин"
}
}
}