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
  • Required Payload for Order Progress
  • Sending to the MQTT Broker
  1. MQTT API

Publish Order Progress

Overview

An Order Progress is a TilliT Edge timeseries entity that tracks the production counts and equipment status every minute to create metrics such as performance, availbility and quality. This data can be published via MQTT into TilliT to give a live up-to-date view of your current production data.

Required Payload for Order Progress

The Order Progress entity is shown below. You will need to find the assetId of the asset you are going to update, you may want to look at how to interact with our API to receive that data.

[{
    assetId: number,
    orderId: number, //Is optional, if not supplied then the current running order is used.
    timestamp: string,
    totalCount: number,
    rejectCount: number,
    EQUIPMENT_STATUS_READY: boolean,
    EQUIPMENT_STATUS_RUNNING: boolean,
    EQUIPMENT_STATUS_STOPPED: boolean,
    EQUIPMENT_STATUS_COMPLETE: boolean,
    EQUIPMENT_STATUS_SUSPENDED: boolean,
    EQUIPMENT_STATUS_ABORTED: boolean,
    EQUIPMENT_STATUS_STARVED: boolean,
    EQUIPMENT_STATUS_BLOCKED: boolean,
    EQUIPMENT_STATUS_FAULTED: boolean,
    downtimeReason: string,
    reasonGroupId: number
}]

It is not necessary to send every field in the payload. It may be easier to start with just counts, stopped and running states. Take note that this is an array, where each element in the array has a unique asset. This allows you to send multiple order-progress for multiple asset in a single message.

Sending to the MQTT Broker

DO NOT send order progress at an interval less than one minute. For best results, order progress is sent every minute.

DO NOT send multiple updates for an asset/order in a single order progress message.

Batching should be used as much as possible. Where multiple assets have an updated count/state in a minute, then include them all in the same order progress message.

The topic to publish on is constructed as per the following, replacing ENV, TENANT and THINGNAME with those that apply for you

$aws/rules/ENV_edge_data/TENANT/THINGNAME/order-progress
e.g $aws/rules/production_edge_data/bottling/TillitEdge-717503/order-progress
    $aws/rules/stage_edge_data/bakery/TillitEdge-a0163b/order-progress

You can find your thingName contained in the same file as the certificates supplied to you. You can also contact support to track down the thingName for you.

Now follow these steps to successfully simulate order progress

Find an asset to add order-progress to and record it's ID.

Ensure an order is in the RUNNING state on the asset (only nessecary if orderId is not included in payload)

Publish the following payload on the topic specified prior (replace ids with yours and timestamp of today)

{
  "format": 'json',
  "body": [{
    "assetId": 2,
    "timestamp": "2022-06-30T05:28:40.273Z",
    "totalCount": 10,
    "EQUIPMENT_STATUS_RUNNING": true,
    "EQUIPMENT_STATUS_STOPPED": false
  }]
}
	

You can now see progress on the order and asset card inside TilliT

For a rawer view, you can navigate to History -> Orders and select the order that was running on the asset

Scroll and click on the Progress Pane, observe that there is a row with the order progress we sent via MQTT.

PreviousPublish TimeseriesNextActivity API

Last updated 9 months ago