Enumeration Filter

The foglamp-filter-enumeration filter provides a mechanism to convert between numeric values and symbolic names that those numeric values represent.

The typical use of this filter is when a numeric data value represents a state that needs to be translated to a more meaningful, textual name for the state. It can also be used to convert from textual names to numeric values, which is useful within control pipelines to set some form of state that is represented by a numeric value, but is passed into the pipeline as a text string.

Filter Configuration

enumeration

The configuration options supported by the enumeration filter are detailed in the table below

  • Asset: The name of the asset to operate on.

  • Datapoint: The name of the datapoint that contains the state.

  • Values: A list of text strings for the enumeration and the associated numeric values.

Operation

The plugin will examine each reading and when it finds one with an asset name that matches the asset name in the configuration it will looked at the named data point. If the type of that datapoint is numeric, then the plugin will find the string that matches the numeric value and change the datapoint to be a string datapoint with the same name and the string value that matches the numeric value.

If the incoming reading has a string value for the configured asset and datapoint, then the process will work the other way around, the string will be looked up in the configured list and the datapoint replaced with one that has the same name but the matching numeric value.

Match Failures

If the incoming datapoint value is numeric and a match can not be found in the configured list of states then a warning will be written to the log and the value set to the string “Undefined X” where X is the numeric value that could not be found.

When converting from a string to a numeric value, a warning will be written to the log and the numeric value set to 0.

See Also

foglamp-filter-asset - A FogLAMP processing filter that is used to block or allow certain assets to pass onwards in the data stream

foglamp-filter-conditional-labeling - Attach labels the reading data based on a set of expressions matched against the data stream.

foglamp-filter-expression - A FogLAMP processing filter plugin that applies a user define formula to the data as it passes through the filter

foglamp-filter-fft - A FogLAMP processing filter plugin that calculates a Fast Fourier Transform across sensor data

foglamp-filter-metadata - A FogLAMP processing filter plugin that adds metadata to the readings in the data stream

foglamp-filter-normalise - Normalise the timestamps of all readings that pass through the filter. This allows data collected at different rate or with skewed timestamps to be directly compared.

foglamp-filter-omfhint - A filter plugin that allows data to be added to assets that will provide extra information to the OMF north plugin.

foglamp-filter-python35 - A FogLAMP processing filter that allows Python 3 code to be run on each sensor value.

foglamp-filter-rename - A FogLAMP processing filter that is used to modify the name of an asset, datapoint or both.

foglamp-filter-rms - A FogLAMP processing filter plugin that calculates RMS value for sensor data

foglamp-filter-scale-set - A FogLAMP processing filter plugin that applies a set of sale factors to the data

foglamp-filter-statistics - Generic statistics filter for FogLAMP data that supports the generation of mean, mode, median, minimum, maximum, standard deviation and variance.