Integrations

Integrations are connections to external MQTT brokers, Pub/Sub messaging suppliers or other third-party web services. These connections can then be used to trigger workflows and/or output messages from your application.

Examples & Tutorials

Viewing Integrations

Integrations List

View your application's integrations under Integrations in the Application menu bar. Icons next to each integration indicate its last known connection status.

Click an integration's name in the list to view its configuration, make edits or view workflows associated with the integration.

Creating an Integration

Add Integration

From the Integrations list page, click "Add Integration" in the top right corner. This will take you to a page where the new integration can be configured.

Integration Settings

Integration Common Config

Every integration requires a name, and you may also disable the integration by unchecking the Enabled checkbox. When editing an existing integration, you may also re-check its connection status from the settings page if you have editor permissions for the application.

Beyond that, the configuration for an integration varies wildly depending on its type.

MQTT

Setting up an MQTT broker integration allows you to trigger workflows whenever the integration receives a message; it also allows you to publish messages to the broker via a workflow.

There are a number of properties that must be defined when setting up the integration.

Integration MQTT Config

  • Protocol, Host and Port: Select mqtt://, mqtts://, ws:// or wss:// for the protocol. The port number will update to the default port for each of these protocols, but you may change this if necessary. For the host, enter the domain at which the broker is accessed.
  • Clean: Leave this checked to clear any previous session when connecting to the broker; uncheck it to pick up previous session data if it exists.
  • Client ID: Enter a client ID if the broker requires one. If you leave this field blank, Losant will automatically assign a client ID, which you may change at any time.
  • Authentication Method: There are three options to choose from, some of which require additional fields to be entered ...
    • None: Provide no authentication information to the broker.
    • Username and password: Authenticate with the broker by providing a Username and a Password. This is the default authentication method.
    • Certificate: If a secure protocol is selected (mqtts:// or wss://), you can choose to authenticate by certificate, in which case you must provide a Private Key and a Certificate.
  • Topics: Enter one or more topics to subscribe to from this broker. Any workflows triggering off of this integration will fire anytime a message is received on one of these topics. (Note: It is not necessary to subscribe to a topic in order to publish to it in an MQTT Output Node.)
  • CA Certificate: If you selected a secure protocol for the connection, you will have the option to enter your own CA certificate. If you use a self-signed certificate or a certificate from a non-standard authority, you must provide the CA certificate from the authority so Losant can properly verify the connection.

Google Pub/Sub

A Google Cloud Pub/Sub integration allows you to trigger workflows off of messages going through your messaging middleware. It also allows you to publish to the service via a workflow.

There are three properties that must be defined when setting up the integration.

Integration Google Pub/Sub Config

  • Project ID: This is the ID of your Google Cloud Platform project.
  • Configuration: A JSON object in the format of a Service Account Key. There are a few validation rules on the object's properties; it is recommended you copy the key directly from your Google Cloud account and paste it here. Note: The key should have the Pub/Sub Editor role - roles/pubsub.editor - because it needs to be able to create subscriptions.
  • Topics: Enter one or more topics to subscribe to. Any workflows triggering off of this integration will fire anytime a message is received on one of these topics. Note: It is not necessary to subscribe to a topic in order to publish to it in a Google Pub/Sub Output Node.

Particle

A Particle integration allows you to trigger workflows off of events published from your Particle devices. It also allows you to call a Particle device function and receive a response via a workflow.

There are two properties that must be defined when setting up the integration.

Integration Particle Config

  • Access Token: This is the access token that Losant will use to communicate with Particle. You can get your access token from the "Settings" view in the Particle IDE.
  • Event Names: Enter one or more event names to subscribe to. Any workflows triggering off of this integration will fire anytime a message is received on one of these topics. If you append a *, the event name will be treated as a prefix match - so any events that start with the given name will match. In addition, an event name of just * will subscribe to all events. Note: It is not necessary to subscribe to an event in order to perform device function calls.

The other three fields in the Particle integration configuration are optional - Device Name or ID, Product Slug or ID, Org Slug or ID. These correspond to the deviceId, product, and org parameters on the underlying Particle Event Stream API endpoint. When the deviceId field is left blank, Losant will use the special keyword mine when connecting to Particle, to ensure that Losant only subscribes to events for your devices (as opposed to subscribing to the public events of any Particle device).

For a step-by-step walkthrough, please read the article How to Integrate Particle with Losant.

Meridian

A Meridian integration allows you to trigger workflows off of asset and tag location updates published from a Meridian location.

There are two properties that must be defined when setting up the integration.

Integration Meridian Config

  • Authentication Token: This is the authentication token that Losant will use to communicate with Meridian. You can create an authentication token from the "Application Tokens" screen in the Meridian interface for a location.
  • Meridian Location ID: This is the Meridian location ID associated with the authentication token.

The other fields in the Meridian integration are optional, and help you to filter down the exact Meridian messages that Losant should listen to. Subscribe to Zone Updates tells the integration to subscribe to messages about assets entering or leaving Meridian zones. Subscribe to Asset Updates tells the integration to subscribe to messages about the location of an asset changing. Finally, you can provide any number of Map IDs, which will filter messages for the location down to just those taking place in the specified maps. If no map IDs are provided, the messages will not be filtered - Losant will subscribe to updates for the entire location.

Using Integrations

Integration Example Workflow

Setting up integrations serves two purposes: triggering workflows and outputting messages. Both of these goals are accomplished using Losant's workflow engine. For more information, check out your integration's corresponding nodes:

Messages received from your integrations count against your payload limits, so make sure to only subscribe to topics that you are actually using.

Deleting an Integration

An integration can be deleted by clicking the "Delete" icon next to any item on the list page, or by clicking the "Delete" button in the footer of an integration's edit page.

Delete Integration

When deleting an integration, you also have the option of deleting any workflows triggered by that integration. Note that this action deletes any workflow with a trigger matching this integration. If you wish to save your workflows and change out their triggers, or if the workflows are triggered by multiple conditions and you wish to retain them, you should leave this option unchecked.