API
Documentation
  • Welcome!
  • REST API
    • Overview
    • Authentication
    • Swagger docs
    • Query an endpoint
    • Filter query results
    • Handling timestamps
    • Backward compatibility
    • Exporting Data using ODATA
    • Power BI Incremental refresh
    • Data Lake Transfer Gateway
    • EXAMPLES
      • Upload production schedule
      • Find all Running Orders
      • Interact with the Order Lifecycle
      • Consume and Submit an Activity
      • Raise an Event in TilliT
  • MQTT API
    • Overview
    • Connect to the TilliT Broker
    • Subscribe to a TilliT Topic
    • Setting a MQTT Integration
    • Publish Timeseries
    • Publish Order Progress
  • Activity API
    • Overview
    • JavaScript Basics
    • Using $scope and OnLoad Scripts
    • JavaScript Object Schema
  • Release Notes
    • 2024
      • April
Powered by GitBook
On this page
  • Overview
  • Subscribe to TilliT MQTT
  • Separating Different Client Subscriptions
  1. MQTT API

Subscribe to a TilliT Topic

Overview

When TilliT sends an MQTT message, it is sent on a specific topic only available to you in a hierarchical structure. Depending on how specific you want to be, you can adjust the subscriptions you make to get exactly the data you want.

Subscribe to TilliT MQTT

The easiest way to receive data from TilliT MQTT Endpoint is to subscribe to all topics. This is done with the wildcard character #.

subscribe('/tenant/#')

This will receive:
 - /tenant/test
 - /tenant/another/test/
 - /tenant/another/another/test/
 - etc.
It will not receive:
 - /another
 - /another/topic
 - /tenant

To be more specific, every message TilliT sends have a topic structure of:

tenant/siteName/assetName/endpoint
 - tenant: the name of your tenant
 - siteName: the name of the site the event occured on
 - assetName: the name of the asset the event occured on
 - endpoint: the topic configured by the channel endpoint field (see Seperating Different Client Subscriptions)

If you want to subscribe to anything in a level, then you can use the character + like so:

/tenant/+/assetName/endpoint - receive updates on an asset across any site
/tenant/siteName/+/endpoint - receive updates on a site across any asset
/tenant/+/+/endpoint - receive updates on any site and any asset for an ednpoint

Separating Different Client Subscriptions

A Channel configured in TilliT has an optional endpoint field. By including an identifier here, we can easily subscribe to a specific TilliT Channel and seperate our subscriptions.

PreviousConnect to the TilliT BrokerNextSetting a MQTT Integration

Last updated 10 months ago