Transformer Description

Last modified: Feb 13, 2019 @ 06:07

Transformers

A Transformer applies a transformation algorithm on incoming measurements and posts the result to a new Resource.

New terminology

  • Transformer Type: The Transformer implementation that defines the algorithm.
  • Source Types: Specifies the resources that will supply the incoming values for transformation (Smart Object type –> instance –> Resource Type).
  • Target Types: Specifies the resources that will receive the transformation result (Smart Object type –> instance –> Resource Type).
  • Target Index: Index to map the target Resources if the transformation produces multiple results (for example, GPS), if applicable for the Transformer Type.
  • Trigger Type:
    • Single Resource: Only one source Resource is allowed.
    • All Resources Updated: Apply transformation only when all source Resources have updated values since last transformation (when using multiple source Resources).
    • Any Resource Updated: Apply transformation whenever any source Resource has an updated value (when using multiple source Resources).
    • Timer: Apply transformation only at specified time intervals (milliseconds) if the source Resource(s) have updated values.
  • Transformation Count: A statistics object added to all Devices containing a Transformer, holding the number of all performed transformations for the Device.
  • Transformer Device: A stand-alone Transformer that is set up as virtual device, which applies a transformation algorithm using resources defined by a Resource Collection as the source. It can be used to transform values from several different Devices.

Pre-defined transformers

The following predefined transformers are available:

  • Aggregator: Aggregates the value of the transformed resource(s).
  • Calculator: Calculates a new value using one of the four basic arithmetical operations.
  • Counter: Counts the number of times a value fulfills a specific condition. The count is only incremented if the previous measurement did not fulfill the condition but the latest one does.
  • DewPoint: Calculates the dew point based on Temperature in Celsius and relative humidity. Using approximation ±1 °C when humidity > 50%.
  • Timer: Calculates the total time that a specific condition is fulfilled.
  • UpCount: Increments every time a new measurement has a higher value than the previous one.

User-defined transformers

Users can implement custom transformers using the Transformer SDK.

Manage transformers

Upload: User-defined transformer types can be uploaded in Settings -> Transformer Types.

When uploading through Settings -> Transformer Types, the current Device Network is automatically selected.

Approve/Revoke: (This requires the custom permission TransformerReview)

Before a Transformer Type can be used, it must be approved.

Note: A new Transformer implementation should be reviewed before it is approved.

If the Transformer Type is not approved, it should be revoked.

Deactivate/Activate: (This requires the custom permission TransformerReview)

A Transformer Type that is in use can be deactivated. All transformations based on this Transformer Type will then be stopped until the Transformer Type is activated again.

Using transformers

To add a Transformer to a Device, configure the Transformer on a Device Template.

The Transformer is added to all Devices that use that Device Template.

Create a Transformer Device via the Action menu in a Location.