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
- How to Integrate Particle with Losant
- Getting Started with Azure IoT and Losant
- Getting Started with AWS IoT and Losant
- Getting Started with Google Pub/Sub IoT and Losant
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
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.
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.
There are a number of properties that must be defined when setting up the integration.
- Protocol, Host and Port: Select
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
Password. This is the default authentication method.
- Certificate: If a secure protocol is selected (
wss://), you can choose to authenticate by certificate, in which case you must provide a
Private Keyand a
- 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.
There are three properties that must be defined when setting up the integration.
- 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.
There are two properties that must be defined when setting up the integration.
- 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
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.
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.
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.