Legrand / Raritan / Server Technology Xerus™ PDU JSON-RPC API
GatewaySensorManager.idl
1 /* SPDX-License-Identifier: BSD-3-Clause */
2 /*
3  * Copyright 2022 Raritan Inc. All rights reserved.
4  */
5 
6 #ifndef __PERIPHERAL_GATEWAY_SENSOR_MANAGER_IDL__
7 #define __PERIPHERAL_GATEWAY_SENSOR_MANAGER_IDL__
8 
9 #include <Sensor.idl>
10 #include <NumericSensor.idl>
11 #include <Event.idl>
12 #include <ModbusCfg.idl>
13 
14 /**
15  * Peripheral Devices
16  */
17 module peripheral {
18 
19  /** Gateway Sensor Configuration Interface */
21 
22  /*
23  To define a gateway sensor the following steps are required:
24 
25  1) Create a [Numeric|State|Switch]SensorClass with a unique
26  *classId* and metadata.
27  This specification can be used for one or more gateway sensors.
28 
29  2) Create a Remote[ModbusRTU|ModbusTCP|...]Device with a unique
30  *deviceId* and all information required to connect a remote
31  device that provides access to sensors and actuators to be associated
32  to one or more gateway sensors.
33 
34  3) Create a ValueEncoding, e.g. ModbusValueEncoding[Bit|8|16|32|64],
35  with a unique *encodingId* and all information needed to correctly
36  interpret a received byte sequence.
37 
38  Besides word width, masking and encoding (bool/int/uint/float) there
39  is also the possibility to define rules that interpret error codes and
40  special values.
41 
42  A rule consists of a recognition feature (e.g. InterpretationRuleRAW,
43  InterpretationRuleIEEE754INF) and an interpretation (e.g. IGNORE,
44  NUMERIC_INVALID).
45 
46  This specification can be used for one or more gateway sensors.
47 
48  4) Create a [Modbus|...]Sensor, with references to configurations described
49  above: *classId*, *deviceId* and *encodingId*. The unique *sensorId* will be
50  generated if not set. Additionaly, [Modbus|...]Sensor has information necessary
51  to address the sensor on the referenced RemoteDevice.
52 
53  5) Store all created classes using setConfiguration()
54 
55 
56  Example A) PMMC-1000
57 
58  1) Create NumericSensorClass with
59  classId = "Temperature"
60  metaData = {
61  type = { NUMERIC, TEMPERATURE, DEGREE_CELSIUS },
62  decdigits = 1,
63  range = { -55, +85 },
64  accuracy = 0.1,
65  resolution = 0.1,
66  tolerance = 0,
67  noiseThreshold = -55,
68  thresholdCaps = { true, true, true, true }
69  }
70  defaultThresholds = {
71  upperCriticalActive = true,
72  upperCritical = 44.0,
73  upperWarningActive = true,
74  upperWarning = 37.0,
75  lowerWarningActive = true,
76  lowerWarning = 1.0,
77  lowerCriticalActive = true,
78  lowerCritical = -11,
79  assertionTimeout = 3,
80  deassertionHysteresis = 2.0F
81  }
82  preferCommonThresholds = false
83 
84  2) Create RemoteModbusRTUDevice with
85  deviceId = "PMMC"
86  busInterface = "sensorhub1-rs485"
87  busSettings = {38400, NONE, 8, 1}
88  unitId = 247;
89  detectionIdentifiers = [ { VENDOR_NAME, "Raritan" },
90  { PRODUCT_CODE, "iPDU" }
91  { REVISION, "3\\.6.*"}
92  ]
93 
94  3) Create ModbusValueEncoding32 with
95  encodingId = "IEEE754_32"
96  endianness = MODBUS_BIG_ENDIAN
97  type = IEEE754
98  interpretationRules = [
99  InterpretationRuleIEEE754NAN {
100  interpretation = INVALID
101  }
102  ]
103 
104  4) Create ModbusSensor with
105  classId = "Temperature"
106  deviceId = "PMMC"
107  encodingId = "IEEE754_32"
108  function = HOLDING_REGISTER;
109  regAddr = 0x812
110  defaultName = "Room temperature"
111 
112 
113  Example B) Current sensor and check product code in INPUT_REGISTER 0
114 
115  1) Create NumericSensorClass with
116  classId = "Current"
117  metaData = {
118  type = { NUMERIC, CURRENT, AMPERE },
119  decdigits = 2,
120  range = { 0, 100 },
121  accuracy = 0.01,
122  resolution = 0.01,
123  tolerance = 0,
124  noiseThreshold = 0.01,
125  thresholdCaps = { true, true, true, true }
126  }
127 
128  2) Create RemoteModbusRTUDevice with
129  deviceId = "GW"
130  busInterface = "sensorhub1-rs485"
131  busSettings = {9600, NONE, 8, 1}
132  unitId = 1;
133 
134  3) Create ModbusValueEncoding32 with
135  encodingId = "IEEE754_32_MIXED_LE"
136  endianness = MODBUS_LITTLE_ENDIAN
137  type = IEEE754
138  interpretationRules = [
139  InterpretationRuleRAW {
140  value = 0x00800000 # FLT_MIN
141  interpretation = IGNORE
142  ignoreTimeout = 60 # unavailable after 60 seconds
143  },
144  InterpretationRuleRAW {
145  value = 0x7f7fffff # FLT_MAX
146  interpretation = UNAVAILABLE
147  }
148  ]
149 
150  Create ModbusValueEncoding16 with
151  encodingId = "GW_PRODUCT_UINT_16"
152  type = UINT
153  interpretationRules = [
154  InterpretationRuleRAW {
155  value = 1200 # product code
156  invertCondition = true
157  interpretation = REJECT_DEVICE # device detection failed
158  },
159  ]
160 
161  4) Create ModbusSensor with
162  classId = "Current"
163  deviceId = "GW"
164  encodingId = "IEEE754_32_MIXED_LE"
165  function = INPUT_REGISTER;
166  regAddr = 0xD
167  defaultName = "AC Current ch2"
168 
169  Create ModbusSensor with
170  classId = "" # used for device detection only
171  deviceId = "GW"
172  encodingId = "GW_PRODUCT_UINT_16"
173  function = INPUT_REGISTER;
174  regAddr = 0
175 
176 
177  Example C) Energy Meter
178 
179  1) Create NumericSensorClass with
180  classId = "Energy"
181  metaData = {
182  type = { NUMERIC, POWER, WATT },
183  decdigits = 1,
184  range = { 0, 9999999 },
185  accuracy = 0.1,
186  resolution = 0.1,
187  tolerance = 0,
188  noiseThreshold = 0,
189  thresholdCaps = { }
190  }
191 
192  2) Create RemoteModbusRTUDevice with
193  deviceId = "EX4"
194  busInterface = "sensorhub0-rs485"
195  busSettings = {9600, NONE, 8, 1}
196  unitId = 4;
197 
198  3) Create ModbusValueEncoding32 with
199  encodingId = "UINT_24_MIXED_LE"
200  endianness = MODBUS_LITTLE_ENDIAN
201  mask = 0x00FFFFFF
202  type = UINT
203  scalingFactor = 10.0;
204 
205  4) Create ModbusSensor with
206  classId = "Energy"
207  deviceId = "EX4"
208  encodingId = "UINT_24_MIXED_LE"
209  function = HOLDING_REGISTER;
210  regAddr = 0
211  defaultName = "Energy Meter"
212  */
213 
214 
215  /* ======================= SENSOR CLASSES ========================= */
216 
217  /**
218  * @brief Specification of sensor class that stores sensor properties
219  *
220  * Before an instance of Sensor can be created,
221  * an instance of SensorClass must be present.
222  * The Sensor locates the corresponding SensorClass
223  * using the sensor class id `classId`.
224  */
225  valueobject SensorClass {
226  string classId; ///< sensor class id
227  };
228 
229  /**
230  * @brief Sensor class that stores numeric sensor properties
231  */
232  valueobject NumericSensorClass extends SensorClass {
233  /**
234  * numeric sensor type, ranges, etc.
235  */
237 
238  /**
239  * threshold values may be used initially and as default threshold values,
240  * depending on the value of the preferCommonThresholds field
241  */
243 
244  boolean preferCommonThresholds; ///< if true, use common default thresholds if available, otherwise use the value of the defaultThresholds field
245  };
246 
247  /**
248  * @brief Sensor class that stores state sensor properties
249  */
250  valueobject StateSensorClass extends SensorClass {
251  sensors.Sensor.TypeSpec type; ///< state sensor type
252  };
253 
254  /**
255  * @brief Sensor class that switch properties
256  */
257  valueobject SwitchSensorClass extends StateSensorClass { };
258 
259 
260  /* ======================= REMOTE DEVICES ========================= */
261 
262  /**
263  * @brief Specification of a remote device that provides access to sensors
264  *
265  * It contains all the information required to connect a remote
266  * device that provides access to sensors and actuators to be connected
267  * to one or more gateway sensors.
268  *
269  * Before an instance of Sensor can be created, an instance
270  * of RemoteDevice must be present. The Sensor locates the
271  * corresponding RemoteDevice using the remote device id `deviceId`.
272  */
273  valueobject RemoteDevice {
274  string deviceId; ///< remote device id
275  boolean disabled; ///< prevents usage of all sensor specifications which reference this device
276  string name; ///< human readable remote device name
277  int timeoutMs; ///< communication access timeout, 0 = default
278  int retry; ///< communication retry count, 0 = default
279  };
280 
281  constant int MODBUS_VENDOR_NAME = 0;
282  constant int MODBUS_PRODUCT_CODE = 1;
283  constant int MODBUS_REVISION = 2;
284  constant int MODBUS_VENDOR_URL = 3;
285  constant int MODBUS_PRODUCT_NAME = 5;
286  constant int MODBUS_MODEL_NAME = 6;
287  constant int MODBUS_APP_NAME = 7;
288 
289  valueobject RemoteModbusDevice extends RemoteDevice {
290  map<int, string> detectionIdentifiers; ///< list of expected device identifiers
291  int unitId; ///< modbus server address
292  };
293 
295  /**
296  * @brief rs485 interface used for modbus communication
297  *
298  * only SRC-080X ist supported, possible values are
299  * - "sensorhub0-rs485" means port "REMOTE HUB 1"
300  * - "sensorhub1-rs485" means port "REMOTE HUB 2"
301  *
302  */
303  string busInterface;
304  ModbusCfg.SerialSettings busSettings; ///< interface settings
305  int interframeDelayDeciChars; ///< (== 0) -> default, (< 0) -> no delay, (> 0) -> e.g. 35 means 3.5 chars
306  };
307 
309  string ipAddress; ///< modbus device ip address
310  int tcpPort; ///< modbus tcp port
311  };
312 
313 
314  /* ======================= VALUE ENCODING ========================= */
315 
316  /**
317  * @brief Specification of value encoding
318  *
319  * Before an instance of Sensor can be created,
320  * an instance of ValueEncoding must be present.
321  * The Sensor locates the corresponding ValueEncoding
322  * using the sensor class id `encodingId`.
323  */
324  enumeration EncodingType {
325  BOOL, ///< boolean
326  INT, ///< signed integer of a size specified in ValueEncoding
327  UINT, ///< unsigned integer of a size specified in ValueEncoding
328  IEEE754 ///< IEEE 754 floating point of a size specified in ValueEncoding
329  };
330 
331  /**
332  * @brief Here you define how certain read values are to be interpreted
333  *
334  * The rules leading to *_IGNORE and *_UNAVAILABLE are applied to numeric values and states.
335  *
336  * IGNORE can be time-limited using ignoreTimeout, see InterpretationRule. After the time has expired,
337  * the value is set to unavailable.
338  *
339  * NUMERIC_INVALID only affects NumericSensors. As DEFAULT for numeric sensors (if
340  * no rule is matched, or if DEFAULT is matched) the value is converted to a floating point
341  * number according to type specification.
342  *
343  * STATE_ON and STATE_OFF affect only StateSensors. If no such rule is specified, the state
344  * becomes true if the read value is integral and not 0. If STATE_ON or STATE_OFF are present in
345  * the rules, then the state is set to true or false only if a STATE_* rule matches. Otherwise
346  * (DEFAULT) the state becomes unavailable.
347 
348  * REJECT_SENSOR means: do not accept this reading in any way. The sensor is treated as
349  * non-existent.
350  *
351  * REJECT_DEVICE means: do not accept this reading in any way. Instead, this is a clear
352  * indication that the device is defective, or it is a wrong device. All sensors that belong
353  * to this device are treated as non-existent.
354  * REJECT_DEVICE can be used in this way to detect devices. The sensor defined for this purpose
355  * does not have to be imported as gateway sensor (see Sensor.classId = "").
356  *
357  * DEFAULT on failed receives modbus exceptions REJECT_SENSOR. DEFAULT on modbus read errors
358  * (e.g. timeouts) is REJECT_DEVICE.
359  */
360  enumeration Interpretation {
361  DEFAULT, ///< use default decoding
362  REJECT_DEVICE, ///< device is treated as non-existent
363  REJECT_SENSOR, ///< sensor is treated as non-existent
364  IGNORE, ///< ignore (use previous value)
365  UNAVAILABLE, ///< set value to unavailable
366  NUMERIC_INVALID, ///< set numeric value to invalid
367  STATE_ON, ///< set state to ON
368  STATE_OFF ///< set state to OFF
369  };
370 
371  /**
372  * InterpretationRule defines a rule that is applied to a reading, resulting in an Interpretation.
373  * A list of InterpretationRule is applied in the given order, and stopped after the first match.
374  * If no rule applies, the interpretation is Interpretation.DEFAULT.
375  **/
376  valueobject InterpretationRule {
377  Interpretation interpretation; ///< how to interpret the applied rule
378  int ignoreTimeout; ///< if > 0, ignoring stops after this timeout (seconds), and state changes to unavailable
379  };
380 
382  boolean invertCondition; ///< negate rule condition
383  };
384 
385  /** InterpretationRuleModbusException is applied to modbus read exceptions
386  */
388  vector<int> exceptions; ///< list of modbus exception codes
389  };
390 
391  /** InterpretationRuleModbusSystemError is applied to standard system errors returned
392  * from libmodbus
393  */
395  vector<int> errnos; ///< list of system error codes
396  };
397 
398  /** InterpretationRuleModbusSpecificError is applied to specific errors from libmodbus
399  */
401  vector<ModbusCfg.SpecificModbusErrors> errors; ///< list of specific libmodbus error codes
402  };
403 
404  /** InterpretationRuleRAW is applied after swap, but before masking (because it has it's own mask)
405  */
407  long value; ///< compare to value
408  long mask; ///< (0 = not masked, the same as 0xFFFF...)
409  };
410 
411  /** InterpretationRuleRangeRAW is applied after swap, but before masking (because it has it's own mask)
412  */
414  long min; ///< minimum accepted value
415  long max; ///< maximum accepted value
416  long mask; ///< (0 = not masked, the same as 0xFFFF...)
417  };
418 
419  /** InterpretationRuleIEEE* are applied after value is wapped, masked and interpreted as float / double
420  */
424 
425  valueobject ValueEncoding {
426  string encodingId; ///< encoding type id
427  EncodingType type; ///< value coding type
428  boolean invertState; ///< invert when interpreting as state
429  vector<InterpretationRule> interpretationRules; ///< error/value inerpretation rules
430  };
431 
432  valueobject NumericValueEncoding extends ValueEncoding {
433  float scalingFactor; ///< multiply with when interpreting as numeric value
434  float offset; ///< add value after applying scalingFactor
435  };
436 
437  valueobject ModbusValueEncodingBit extends ValueEncoding {};
438 
440  /**
441  * 16-bit modbus words should be transferred in big-endian byte order.
442  * For modbus devices that do not comply with this, byteSwap = true must
443  * be set. Another application is to use byteSwap to address a single byte in
444  * a 16-bit modbus word in case 8-bit values are requested (ModbusValueEncoding8).
445  */
446  boolean byteSwap;
447  long mask; ///< mask raw value before interpreting (0 = not masked, the same as 0xFFFF...)
448  };
449 
451 
452  enumeration ModbusEndianness {
453  MODBUS_BIG_ENDIAN, ///< use big endian modbus word order (default is big endian)
454  MODBUS_LITTLE_ENDIAN ///< use little endian modbus word order
455  };
456 
458  /**
459  * Modbus 16-bit-words should be transmitted in big endian order. For modbus
460  * devices that do not comply with this, endianness must be set to LITTLE_ENDIAN.
461  */
463  };
464 
465 
467 
468 
469  /* ======================= SENSORS ========================= */
470 
471  /**
472  * Specification of a Sensor
473  */
474  valueobject Sensor {
475  /**
476  * Unique sensor id, is automatically generated if not set
477  */
478  string sensorId;
479 
480  /**
481  * Set disabled = true prevents any usage of the specification
482  */
483  boolean disabled;
484 
485  /**
486  * @brief remote device id
487  *
488  * deviceId is used to locate the corresponding RemoteDevice that
489  * provides the physical sensor
490  */
491  string deviceId;
492 
493  /**
494  * @brief sensor class id
495  *
496  * classId is used to locate the corresponding SensorClass.
497  * classId = "" prevents the sensor specification from being used
498  * for an imported gateway sensor. The sensor value is read anyway, and a read
499  * error or a interpretation as Interpretation.REJECT_DEVICE
500  * prevents the successful detection of the device
501  */
502  string classId;
503 
504  /**
505  * @brief sensor encoding id
506  *
507  * classId is used to locate the corresponding ValueEncoding
508  */
509  string encodingId;
510 
511  /**
512  * @brief default sensor name
513  *
514  * defaultName is used as sensor slot name
515  */
516  string defaultName;
517  };
518 
519  valueobject ModbusSensor extends Sensor {
520  ModbusCfg.ModbusFunction function; ///< Modbus function to be used
521  int regAddr; ///< Modbus server register address
522  };
523 
524 
525  /* ======================= FULL CONFIGURATION ========================= */
526 
528  boolean disabled; ///< prevents usage of all sensor specifications defined in this package
529  string name; ///< package name
530  vector<SensorClass> classes;
531  vector<RemoteDevice> devices;
532  vector<ValueEncoding> encodings;
533  vector<Sensor> sensors;
534  };
535 
536  /**
537  * @brief Get all defined gateway sensors and required objects from config
538  *
539  * Read all Sensor Classes, Remote Devices, Value Encodings and Sensors
540  * at once to ensure that the overall configuration is consistent
541  *
542  * @return all defined gateway sensor feature configuration objects
543  */
544  map<string, ConfigurationPackage> getConfiguration();
545 
546  constant int ERR_CONFIG_INCONSISTENT = 1;
547  constant int ERR_CONFIG_STORAGE_FAILED = 2;
548 
549  /**
550  * @brief Replace defined gateway sensor and/or other configuration objects in config
551  *
552  * Write all Sensor Classes, Remote Devices, Value Encodings and Sensors
553  * at once to ensure that the overall configuration is consistent at every
554  * moment.
555  *
556  * The uniqueness of all IDs and the availability of all referenced elements are
557  * checked before the configuration is applied. Otherwise setConfiguration() returns
558  * with an error.
559  *
560  * @param cfg all defined gateway sensor feature configuration objects
561  * @return 0 if OK
562  * @return ERR_CONFIG_INCONSISTENT if consistency check has failed (e.g. non-unique identifiers)
563  * @return ERR_CONFIG_STORAGE_FAILED if configuration cannot be stored
564  */
565  int setConfiguration(in map<string, ConfigurationPackage> cfg);
566 
567  /** Event: The gateway sensor feature configuration has changed */
568  valueobject ConfigurationChangedEvent extends idl.Event {
569  map<string, ConfigurationPackage> configuration; ///< the current gateway sensor feature configuration
570  };
571 
572 
573  /* ======================= FEEDBACK ========================= */
574 
575  /**
576  * @brief Feedback from gateway sensor configuration usage
577  *
578  * There is no knowledge of Feedback required to configure gateway sensors.
579  * The following is only needed for special tools that monitor the usage
580  * of the configurations above.
581  */
582  structure FeedbackObject {
583  enumeration FeedbackState {
584  UNSPECIFIED,
585  INTENTIONALLY_UNUSED,
586  FAILED_PRECONDITIONS_UNUSED,
587  FAILED,
588  GOOD
589  };
590 
591  string key; ///< empty or free defined value name
592  string value; ///< message or value
593  FeedbackState stateTansitionTo; ///< this FeedbackObject changes state, if not UNSPECIFIED
594  };
595 
596  valueobject Feedback {
597  FeedbackObject.FeedbackState currentState; ///< Device or sensor state
598  vector<FeedbackObject> infos;
599  };
600 
601  valueobject DeviceFeedback extends Feedback {
602  string packageId; ///< the configuration package id
603  string deviceId; ///< the same id as in RemoteDevice
604  };
605 
606  valueobject SensorFeedback extends Feedback {
607  string packageId; ///< the configuration package id
608  string deviceId; ///< the same id as in RemoteDevice
609  string sensorId; ///< the same id as in Sensor
610  };
611 
612  /**
613  * Get feedback from gateway sensor configuration usage
614  *
615  * @return Result: the full feedback
616  */
617  vector<Feedback> getFeedback();
618 
619  /** Event: The configuration usage feedback has changed */
620  valueobject FeedbackChangedEvent extends idl.Event {
621  vector<Feedback> feedback; ///< the latest configuration usage feedback
622  };
623  };
624 }
625 
626 #endif /* __PERIPHERAL_GATEWAY_SENSOR_MANAGER_IDL__ */
Gateway Sensor Configuration Interface.
Definition: GatewaySensorManager.idl:20
ModbusEndianness
Definition: GatewaySensorManager.idl:452
@ MODBUS_BIG_ENDIAN
use big endian modbus word order (default is big endian)
Definition: GatewaySensorManager.idl:453
map< string, ConfigurationPackage > getConfiguration()
Get all defined gateway sensors and required objects from config.
int setConfiguration(in map< string, ConfigurationPackage > cfg)
Replace defined gateway sensor and/or other configuration objects in config.
EncodingType
Specification of value encoding.
Definition: GatewaySensorManager.idl:324
@ BOOL
boolean
Definition: GatewaySensorManager.idl:325
@ INT
signed integer of a size specified in ValueEncoding
Definition: GatewaySensorManager.idl:326
@ UINT
unsigned integer of a size specified in ValueEncoding
Definition: GatewaySensorManager.idl:327
vector< Feedback > getFeedback()
Get feedback from gateway sensor configuration usage.
Interpretation
Here you define how certain read values are to be interpreted.
Definition: GatewaySensorManager.idl:360
@ DEFAULT
use default decoding
Definition: GatewaySensorManager.idl:361
@ UNAVAILABLE
set value to unavailable
Definition: GatewaySensorManager.idl:365
@ IGNORE
ignore (use previous value)
Definition: GatewaySensorManager.idl:364
@ REJECT_SENSOR
sensor is treated as non-existent
Definition: GatewaySensorManager.idl:363
@ NUMERIC_INVALID
set numeric value to invalid
Definition: GatewaySensorManager.idl:366
@ STATE_ON
set state to ON
Definition: GatewaySensorManager.idl:367
@ REJECT_DEVICE
device is treated as non-existent
Definition: GatewaySensorManager.idl:362
Definition: ModbusCfg.idl:13
A sensor with numeric readings.
Definition: NumericSensor.idl:17
Sensor interface
Definition: Sensor.idl:15
Basic IDL definitions.
Definition: Event.idl:10
Peripheral Devices.
Definition: GatewaySensorManager.idl:17
@ UNSPECIFIED
device type is unknown
Definition: PeripheralDeviceSlot.idl:25
Sensors Model.
Definition: AccumulatingNumericSensor.idl:13
Common base for all events.
Definition: Event.idl:13
Event: The gateway sensor feature configuration has changed.
Definition: GatewaySensorManager.idl:568
map< string, ConfigurationPackage > configuration
the current gateway sensor feature configuration
Definition: GatewaySensorManager.idl:569
Definition: GatewaySensorManager.idl:527
boolean disabled
prevents usage of all sensor specifications defined in this package
Definition: GatewaySensorManager.idl:528
string name
package name
Definition: GatewaySensorManager.idl:529
Definition: GatewaySensorManager.idl:601
string packageId
the configuration package id
Definition: GatewaySensorManager.idl:602
string deviceId
the same id as in RemoteDevice
Definition: GatewaySensorManager.idl:603
Event: The configuration usage feedback has changed.
Definition: GatewaySensorManager.idl:620
vector< Feedback > feedback
the latest configuration usage feedback
Definition: GatewaySensorManager.idl:621
Feedback from gateway sensor configuration usage.
Definition: GatewaySensorManager.idl:582
FeedbackState stateTansitionTo
this FeedbackObject changes state, if not UNSPECIFIED
Definition: GatewaySensorManager.idl:593
string value
message or value
Definition: GatewaySensorManager.idl:592
string key
empty or free defined value name
Definition: GatewaySensorManager.idl:591
Definition: GatewaySensorManager.idl:596
FeedbackObject::FeedbackState currentState
Device or sensor state.
Definition: GatewaySensorManager.idl:597
Definition: GatewaySensorManager.idl:423
InterpretationRuleIEEE* are applied after value is wapped, masked and interpreted as float / double.
Definition: GatewaySensorManager.idl:421
boolean invertCondition
negate rule condition
Definition: GatewaySensorManager.idl:382
InterpretationRuleModbusException is applied to modbus read exceptions.
Definition: GatewaySensorManager.idl:387
vector< int > exceptions
list of modbus exception codes
Definition: GatewaySensorManager.idl:388
InterpretationRuleModbusSpecificError is applied to specific errors from libmodbus.
Definition: GatewaySensorManager.idl:400
vector< ModbusCfg::SpecificModbusErrors > errors
list of specific libmodbus error codes
Definition: GatewaySensorManager.idl:401
InterpretationRuleModbusSystemError is applied to standard system errors returned from libmodbus.
Definition: GatewaySensorManager.idl:394
vector< int > errnos
list of system error codes
Definition: GatewaySensorManager.idl:395
InterpretationRuleRAW is applied after swap, but before masking (because it has it's own mask)
Definition: GatewaySensorManager.idl:406
long value
compare to value
Definition: GatewaySensorManager.idl:407
long mask
(0 = not masked, the same as 0xFFFF...)
Definition: GatewaySensorManager.idl:408
InterpretationRuleRangeRAW is applied after swap, but before masking (because it has it's own mask)
Definition: GatewaySensorManager.idl:413
long mask
(0 = not masked, the same as 0xFFFF...)
Definition: GatewaySensorManager.idl:416
long max
maximum accepted value
Definition: GatewaySensorManager.idl:415
long min
minimum accepted value
Definition: GatewaySensorManager.idl:414
InterpretationRule defines a rule that is applied to a reading, resulting in an Interpretation.
Definition: GatewaySensorManager.idl:376
Interpretation interpretation
how to interpret the applied rule
Definition: GatewaySensorManager.idl:377
int ignoreTimeout
if > 0, ignoring stops after this timeout (seconds), and state changes to unavailable
Definition: GatewaySensorManager.idl:378
Definition: GatewaySensorManager.idl:519
int regAddr
Modbus server register address.
Definition: GatewaySensorManager.idl:521
Definition: GatewaySensorManager.idl:450
Definition: GatewaySensorManager.idl:457
ModbusEndianness endianness
Modbus 16-bit-words should be transmitted in big endian order.
Definition: GatewaySensorManager.idl:462
Definition: GatewaySensorManager.idl:466
Definition: GatewaySensorManager.idl:439
long mask
mask raw value before interpreting (0 = not masked, the same as 0xFFFF...)
Definition: GatewaySensorManager.idl:447
boolean byteSwap
16-bit modbus words should be transferred in big-endian byte order.
Definition: GatewaySensorManager.idl:446
Definition: GatewaySensorManager.idl:437
Sensor class that stores numeric sensor properties.
Definition: GatewaySensorManager.idl:232
sensors::NumericSensor Thresholds defaultThresholds
threshold values may be used initially and as default threshold values, depending on the value of the...
Definition: GatewaySensorManager.idl:242
sensors::NumericSensor MetaData metadata
numeric sensor type, ranges, etc.
Definition: GatewaySensorManager.idl:236
boolean preferCommonThresholds
if true, use common default thresholds if available, otherwise use the value of the defaultThresholds...
Definition: GatewaySensorManager.idl:244
Definition: GatewaySensorManager.idl:432
float scalingFactor
multiply with when interpreting as numeric value
Definition: GatewaySensorManager.idl:433
float offset
add value after applying scalingFactor
Definition: GatewaySensorManager.idl:434
Specification of a remote device that provides access to sensors.
Definition: GatewaySensorManager.idl:273
int timeoutMs
communication access timeout, 0 = default
Definition: GatewaySensorManager.idl:277
string name
human readable remote device name
Definition: GatewaySensorManager.idl:276
string deviceId
remote device id
Definition: GatewaySensorManager.idl:274
int retry
communication retry count, 0 = default
Definition: GatewaySensorManager.idl:278
boolean disabled
prevents usage of all sensor specifications which reference this device
Definition: GatewaySensorManager.idl:275
Definition: GatewaySensorManager.idl:289
map< int, string > detectionIdentifiers
list of expected device identifiers
Definition: GatewaySensorManager.idl:290
int unitId
modbus server address
Definition: GatewaySensorManager.idl:291
Definition: GatewaySensorManager.idl:294
ModbusCfg::SerialSettings busSettings
interface settings
Definition: GatewaySensorManager.idl:304
string busInterface
rs485 interface used for modbus communication
Definition: GatewaySensorManager.idl:303
int interframeDelayDeciChars
(== 0) -> default, (< 0) -> no delay, (> 0) -> e.g. 35 means 3.5 chars
Definition: GatewaySensorManager.idl:305
Definition: GatewaySensorManager.idl:308
int tcpPort
modbus tcp port
Definition: GatewaySensorManager.idl:310
string ipAddress
modbus device ip address
Definition: GatewaySensorManager.idl:309
Specification of sensor class that stores sensor properties.
Definition: GatewaySensorManager.idl:225
string classId
sensor class id
Definition: GatewaySensorManager.idl:226
Definition: GatewaySensorManager.idl:606
string sensorId
the same id as in Sensor
Definition: GatewaySensorManager.idl:609
string deviceId
the same id as in RemoteDevice
Definition: GatewaySensorManager.idl:608
string packageId
the configuration package id
Definition: GatewaySensorManager.idl:607
Specification of a Sensor.
Definition: GatewaySensorManager.idl:474
boolean disabled
Set disabled = true prevents any usage of the specification.
Definition: GatewaySensorManager.idl:483
string classId
sensor class id
Definition: GatewaySensorManager.idl:502
string deviceId
remote device id
Definition: GatewaySensorManager.idl:491
string defaultName
default sensor name
Definition: GatewaySensorManager.idl:516
string encodingId
sensor encoding id
Definition: GatewaySensorManager.idl:509
string sensorId
Unique sensor id, is automatically generated if not set.
Definition: GatewaySensorManager.idl:478
Sensor class that stores state sensor properties.
Definition: GatewaySensorManager.idl:250
sensors::Sensor TypeSpec type
state sensor type
Definition: GatewaySensorManager.idl:251
Sensor class that switch properties.
Definition: GatewaySensorManager.idl:257
Definition: GatewaySensorManager.idl:425
boolean invertState
invert when interpreting as state
Definition: GatewaySensorManager.idl:428
EncodingType type
value coding type
Definition: GatewaySensorManager.idl:427
vector< InterpretationRule > interpretationRules
error/value inerpretation rules
Definition: GatewaySensorManager.idl:429
string encodingId
encoding type id
Definition: GatewaySensorManager.idl:426
Definition: ModbusCfg.idl:14
Numeric sensor metadata.
Definition: NumericSensor.idl:40
Numeric sensor thresholds.
Definition: NumericSensor.idl:111
Complete sensor type specification.
Definition: Sensor.idl:169