Asset Validation Filter¶
The foglamp-filter-asset-validation filter allows simple validation of readings within a pipeline such that readings that are invalidated can be identified and dealt with appropriately, or discarded early in the processing of the readings.
The filter works by executing a number of expressions, defined in the configuration of the plugin, against a single reading. If any of those expressions evaluates to false then the asset is considered to have failed validation and a user defined action will be instigated. Supported actions are
Label all readings
Label failed readings
Change asset name
Remove reading
Filter Configuration¶
The configuration options supported by the asset-validation filter are
Asset: The name of the asset to validate. If left blank then the validation is to be used for all assets in the pipeline.
Action: The actions that can be taken for failed validation
Label all readings: Label all readings with a pass/fail status by adding a datapoint to the asset in the reading.
Label failed readings: Label readings that have failed validation by adding a datapoint to the asset in the reading.
Change asset name: Change the asset name of readings that have failed validation.
Remove reading: Remove readings that have failed validation from the pipeline.
Status Datapoint: The name of the datapoint to label pass/fail conditions on a reading. This is applicable only for the action “Label all readings” and “Label failed readings”.
Failed Asset: The name to be used for asset if validation failed.
Validations: A list of validation expressions. These expressions should evaluate to true or false. A value of false represents a failed validation.
Examples
If a reading has two data points voltage and current and condition is that power used must not exceed 10kW. The following expression can be added as a validation expression
voltage * current <= 10000
If condition is that voltage should be between 110 and 240 volts and the maximum current that can be supplied is 50 Ampere. The following expressions can be added as a validation expression
voltage >= 0
voltage == 0 or (voltage >= 110 and voltage <= 240)
current >= 0 and current <= 50