Channels

channels

Introduction

Waylay provides OAuth2 based API integration using channels concept. When you connect to 3rd party OAuth2 using channel concept, waylay keeps, in secure way, access tokens to that app. Waylay makes sure that these tokens are always valid - which means that you don’t need to care about requesting new access tokens using refresh token. channels

In your sensor and actuation code, you can always access the token using waylay util package, as shown in this example below:

var user = waylayUtil.getProperty(options, "user") || "organisation"
    
waylayUtil.getAuthTokens(options, user, "googledrive")
.then(tokens => {
    var options = {
        url:"https://content-sheets.googleapis.com/v4/spreadsheets/"+ sheetId + "/values/" + range,
        auth:{
            'bearer': tokens.access_token
        }
    }
 ...

As you can see waylayUtil.getAuthTokens is a promise, while default user (organisation) to which we associate the channel (in this example googledrive).

Next to the channels, out of the box, we provide several sensors and actuators for various cloud applications and platforms.

B2C OAuth2 integration

Channels are great way to integrate B2C applications. Should you want to integrate OAuth2 based smart devices, such as NEST, philips Hue, netatmo, fitbit, homeconnect or similar (we have done 50+ integrations so far), please contact our professional service team at info@waylay.io

IoT platform integration

It is very easy to connect popular IoT platforms to Waylay. In the Channels tile, you will find connectors for Azure IoT Hub, Amazon IoT Core, Google IoT Core and MQTT.

  • Note: the message payload forwarded to Waylay is assumed in xml or json format

channels

Azure IoT Hub integration

To connect Waylay to your Azure IoT Hub environment, you need to fetch the Azure Connection String from your Azure IoT Hub environment. This connection string needs to be configured in the Waylay Azure connector as indicated in the image below.

channels

In Azure IoT Hub, every device has a unique device id. Once the Waylay Azure Connector is connected and your device publishes data to Azure IoT Hub, the data payload will be forwarded to your Waylay environment. In Waylay, you will automatically find resources with the same id as in Azure IoT Hub as soon as the first message is received.

channels

AWS IoT Core integration

To connect Waylay to your AWS IoT Core environment, you have to configure the following settings

channels

In AWS IoT Core, every device (Thing Shadow) has a unique device name. Once the Waylay AWS Connector is connected and your device publishes data to AWS, the data payload will be forwarded to your Waylay environment. In Waylay, you will automatically find resources with the same id as your AWS Things, as soon as the first message is received.

  • Topics: the topics you want Waylay to subscribe to, e.g. ‘$/aws/things/+/shadow/update’ will listen on updates of all your AWS Things Shadow. We will fetch the Thing id via the topic string, e.g. any message published on $/aws/things/MyDevice1/shadow/update will be forwarded to Waylay with a resource id = MyDevice1.
    • Multiple topics can be filled in separated with a ‘;’.
  • Endpoint: this is the unique endpoint id of your AWS IoT environment (see screenshot below)
  • Key: the unique key and secret that Waylay can use to connect to your AWS IoT environment. You retrieve these from https://console.aws.amazon.com/iam
  • Secret: the unique key and secret that Waylay can use to connect to your AWS IoT environment. You retrieve these from https://console.aws.amazon.com/iam

channels

Google IoT Core integration

To connect Waylay to your Google IoT Core environment via Google Cloud Pub/Sub, you have to specify the following settings

channels

  • Topics: the Google Pub/Sub device telemetry topics you want Waylay to subscribe to, e.g. ‘/projects/quiet-mechanic-140114/topics/waylay-office’ will listen on updates of all the Google IoT devices that belong to the Google IoT device registry ‘waylay-office’. We will fetch the device id via the attributes of each device telemetry message. This means that the device id that is used in Google IoT core will also appear as resource id in Waylay.
    • Multiple topics can be filled in separated with a ‘;’.
    • see screenshot below where to find the Google Pub/Sub telemetry topic that corresponds to your device data events
  • Application Credentials: upload your service account API credentials configuration file. See https://cloud.google.com/iam/docs/creating-managing-service-account-keys

channels

MQTT broker integration

To connect Waylay to your MQTT broker of choice, you have to configure the following settings channels

  • Topics: the topics you want Waylay to subscribe to, e.g. ‘#’. Multiple topics can be filled in seperated with a ‘;’.
  • Connection String: e.g. mqtts://my-mqtt-broker.io
  • Resource Property Name: name of the device you want waylay to listen to (optional)
  • Username: username for the Waylay client connection to your MQTT broker of choice
  • Password: password for the Waylay client connection to your MQTT broker of choice
  • Port: port of your MQTT broker (optional, default 8883)