Recipes are a reusable blocks of Edge Connect language which allow for easier integration of various devices and full solutions.


Recipe

Recipe

A recipe will typically consume events and emit
events for a top-level configuration to consume.

To receive all/multiple from a recipe a pipeline's eventType can be
specified as a regular expression (must start with '^' or end with '$')

For example "eventType": "^mysensor\..+" would receive all events emitted by mysensor.

For consistency, all the identifiers (filter, action, pipelines, connections, etc) in a recipe
must contain only alphanumeric or '-', '/' characters and start with a lowercase alphanumeric character.

Fields

NameTypeDescriptionRequired
descriptionstringRecipe description string
Example: "This recipe handles processing of sensor 9000 data"
No
emitsmap of string to RecipeEventDeclaration of events that the recipe emits
map key is the eventType name (accessed via recipeName.eventTypeName)
map value is the metadata for the eventType
No
exportsmap of string to RecipeExportRecipe export declarations
map key is the exported name (accessed via recipe.exportedName)
map value is the metadata for the exported item
No
importsarrayRecipe imports
Specify imports required by the recipe.
Imports can be recipe names or inline json.
Example: [ "[email protected]"]
No
namestringRecipe name
Example: "mysensor"
Yes
optionsRecipeOptionsNo
recipeRecipeDefinitionNo
variablesmap of string to RecipeVariableRecipe variable declarations
map key is the exposed variable name (accessed via recipe.variableName)
map value is the metadata for the variable
No
versionstringRecipe version string
Must follow semantic versioning rules
Example: "1.2.3"
Yes

Example

{
  "emits": {
    "aggregateEvent": {
      "description": "aggregated advertisement data",
      "testFlow": ""
    }
  },
  "exports": {
    "hasCheesyEnding": {
      "description": "matcher that matches when the value stored in key 'string' ends in 'cheese'"
    }
  },
  "imports": [
    "[email protected]"
  ],
  "name": "myRecipe",
  "recipe": {
    "filters": {
      "aggregator": {
        "config": {
          "interval": "10s",
          "mode": "map"
        },
        "type": "aggregate"
      },
      "emitter": {
        "config": {
          "eventType": "myRecipe.aggregateEvent",
          "interval": "10s"
        },
        "type": "emitEvent"
      }
    },
    "matchers": {
      "cheesyEnding": {
        "string": ".*cheese$"
      }
    },
    "pipelines": {
      "scanner": {
        "eventType": [
          "advertisement"
        ],
        "filters": [
          "aggregator",
          "emitter"
        ]
      }
    }
  },
  "variables": {
    "aggregationInterval": {
      "default": "10s",
      "description": "set the aggregation interval for advertisements",
      "key": "filters.aggregator.config.interval",
      "rules": "",
      "type": ""
    }
  },
  "version": "1.0.0"
}

Reference

RecipeBLEOptions

Recipes may need access to active bluetooth scanning. This section allows a recipe to request that behavior.
Note that active scanning will reduce the number of available scanning windows. Only use if absolutely necessary.

Referenced By:
RecipeOptions  

Fields

NameTypeDescriptionRequired
activeScanningbooleanNo

RecipeDefinition

Definines processing encapsulated by a recipe.
Sets up devicegroups, pipelines, connections, cloud connectors, filters, connection actions, etc.

Referenced By:
Recipe  

Fields

NameTypeDescriptionRequired
actionsmap of string to ConnectionActionDefines the ConnectionActions that can be used in ConnectionSequences.

A map of unique identifier to a ConnectionAction definition.

ConnectionActions defined here can be reused in multiple ConnectionSequences.
No
cloudCloudNo
connectionsmap of string to ConnectionSequenceDefines the ConnectionSequences that will handle processing of BLE connections.

A map of unique identifier to a ConnectionSequence definition.

ConnectionSequences are triggered by a connect filter.
No
devicesDevicesNo
eventGeneratorsmap of string to EventGeneratorDefines the EventGenerators to run.

A map of EventGenerator ID's to EventGeneratorConfig
No
filtersmap of string to FilterDefines the Filters available for use in Pipelines.

A map of unique identifier to a definition of a Filter.

Filters defined here can be reused in multiple Pipelines.
No
groupsmap of string to DeviceGroupDefines the DeviceGroups that can be referenced by Pipelines.

A map of unique identifier to DeviceGroup definition.
No
keysKeystoreConfigNo
matchersMatchersNo
metadataMetadataNo
minimumVersionstringSet the minimum version of edge-connect required to run this configuration
Example: "2021.01-01"
No
pipelinesmap of string to PipelineDefines the Pipelines of Filters that events will flow through.

A map of unique identifier to a Pipeline definition.
No

RecipeEvent

All emitted eventTypes must be declared by the recipe.

Referenced By:
Recipe  

Fields

NameTypeDescriptionRequired
descriptionstringDescription of the recipe eventType
Example: "this is a temperature alarm event"
Yes
testFlowstringThe id of a flow in the recipe's test that emits this event type. Not required yet but will be.
Example: "minewP1DataFromUUID"
No

Example

{
  "description": "description of the emitted event",
  "testFlow": ""
}

RecipeExport

Once exported, the item can be used in the top-level configuration as well as other recipes by recipeName.exportedName.
Any processing unit can be exported (filter, action, pipeline, connection, matcher, devicegroup, etc).

The internal lookup is lazy so if you have a filter named myProcessor and an action named myProcessor,
and try to export myProcessor an error will be thrown.

Referenced By:
Recipe  

Fields

NameTypeDescriptionRequired
descriptionstringDescription of the exported item
Example: "filter for converting temperature from F to C."
Yes

Example

{
  "description": "description of the exported item"
}

RecipeOptions

These options provide for advanced configuration of wireless features.

Referenced By:
Recipe  

Fields

NameTypeDescriptionRequired
bleRecipeBLEOptionsNo
wirepasRecipeWirepasOptionsNo

RecipeVariable

Once a RecipeVariable is declared, the value can be set
from the top-level Imports configuration.

Referenced By:
Recipe  

Fields

NameTypeDescriptionRequired
default?The default value of the variable in the recipe
Example: "30"
Yes
descriptionstringThe description of the variable
Example: "this variable sets the BLE connection timeout"
Yes
key?The path to the values in the recipe, can also give an array of keys
Example: "filters.myFilter.config.connectionTimeout"
Yes
rulesstringThe rules for the variable value
Example: "1m-24h durations are supported"
Yes
typestringThe data type of variable value. Valid options are string, number, object, array
Example: "string"
Yes

Example

{
  "default": "10s",
  "description": "set the aggregation interval for advertisements",
  "key": "filters.aggregator.config.interval",
  "rules": "",
  "type": ""
}