MQTT Connector

Overview

The Novo AI MQTT Event-Based Connector is designed to publish real-time and batch machine event data to any configured external MQTT broker. This connector facilitates seamless data transfer, supporting both machine state changes and cycle event reporting.

The connector is deployed and managed by Novo AI and ensures machine data is published in a structured format for external systems to consume.

Authentication & Configuration

  • The MQTT connector is configured to send data to a predefined external MQTT broker.

  • Broker settings, including host, port, authentication details, and topic mapping, are configurable based on user preferences.

  • Each message follows a structured JSON format, ensuring consistency and easy parsing.

Machine State Event

Proposed Topic: novoai/v2/machine/state

Description:

This event is triggered when a machine state changes. It provides detailed information about the machine's activity, including the duration of each state and the predicted current state.

Example Payload:

{
  "payload": {
    "measurement": "ava",
    "tags": {
      "mac_id": "example_mac_id",
      "type": "machine"
    },
    "fields": {
      "start": 1713783600000,
      "stop": 1713787200000,
      "state": 0,
      "curr_state": 2
    },
    "time": 1713805653000
  }
}

Fields & Definitions:

  • measurement (string): Defines the type of data being published ("ava" for machine state).

  • tags (object): Identifiers for the machine.

    • mac_id (string): Unique identifier for the machine (e.g., MAC address).

    • type (string): Defines the type of event ("machine" for state events).

    • Additional identifiers can be configured: "machine_name", "company_name", "machine_id", "company_id", or other public_ids.

  • fields (object): Defines machine state details.

    • start (integer): UNIX timestamp (milliseconds) when the state began.

    • stop (integer): UNIX timestamp (milliseconds) when the state ended.

    • state (integer): State of the machine during the given time frame.

    • curr_state (integer): The predicted real-time state of the machine until the next event is received.

  • time (integer): UNIX timestamp (milliseconds) when the event was generated.

Machine State Definitions:

State Value

Description

0

Off (Power Off)

1

Idle (Powered but not functional)

2

Production

3

Preparation (Setup/Reset)

4

Unknown


Cycle Event

Proposed Topic: novoai/v2/machine/cycle

Description:

This event is triggered when a product cycle is completed. By default, cycle events are published at the end of the day. However, with good data and testing, real-time cycle events can be generated.

Example Payload (Batch Cycle Data):

{
  "payload": {
    "measurement": "ava",
    "tags": {
      "mac_id": "example_mac_id",
      "type": "cycles"
    },
    "fields": {
      "duration_sec": [180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180],
      "probability": [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
    },
    "time": [
      1740459663842, 1740477730659, 1740488591161, 1740490000235, 1740490067834,
      1740490136617, 1740490205040, 1740490271769, 1740490341242, 1740490408643,
      1740490476547
    ]
  }
}

Example Payload (Real-Time Cycle Event):

{
  "payload": {
    "measurement": "ava",
    "tags": {
      "mac_id": "uhe_test_4",
      "type": "cycles"
    },
    "fields": {
      "duration_sec": [180],
      "probability": [1]
    },
    "time": [1740459663842]
  }
}

Fields & Definitions:

  • measurement (string): "ava", defines cycle event data.

  • tags (object): Identifiers for the machine.

    • mac_id (string): Unique identifier for the machine.

    • type (string): "cycles", indicating a cycle event.

    • Additional configurable identifiers: "machine_name", "company_name", "machine_id", "company_id", or other public_ids.

  • fields (object): Defines cycle details.

    • duration_sec (array): List of cycle durations (in seconds).

    • probability (array): Probability score of each cycle event occurrence.

  • time (array): List of UNIX timestamps (milliseconds) when each cycle event occurred.


Connector Status Updates

Proposed Topic: novoai/status

Description:

The connector itself publishes its status at regular intervals (configurable to 30s / 1m / 5m / 10m), allowing users to monitor its health and connectivity.

Example Payload:

{
  "status": "running",
  "uptime": 86400,
  "last_successful_publish": "2025-02-24T12:34:56Z",
  "errors": 0,
  "message": "MQTT Connector is operational."
}

Fields & Definitions:

  • status (string): The current state of the connector.

    • Possible values: "running", "stopped", "error", "reconnecting".
  • uptime (integer): Total time (in seconds) the connector has been running.

  • last_successful_publish (string, ISO 8601 format): Timestamp of the last successful event publication.

  • errors (integer): Count of errors encountered since startup.

  • message (string): Additional status message for debugging or informational purposes.

Updated on