Attensys realtime train API 1.0.0

Welcome

The Attensys realtime API allows you to remotely measure and manage your connected devices.

  • Communication is done by connecting to the Attensys gateway onboard MQTT broker, which publishes topics which can be consumed by an MQTT client.
  • The Broker simultaneously supports MQTT v3.1, v3.1.1, and V5.0. The complete compliance to the MQTT standard ensures the smooth integration with all major of MQTT clients and tools.

Messages

All messages are retained and sent with QoS2.

Wildcards

Wildcards can be used at any path.

Servers

  • mqtt://{gatewayIP}:{port}mqtt 3.1.1mqtt

    Attensys Gateway MQTT broker

    gatewayIP
    required
    string

    IP of gateway to connect to.

    port
    required
    string

    Secure connection (TLS) is available through port 8883.

    Default value:"1883"
      Allowed values:
    • "1883"
    • "8883"
    Security:
    • User/Password

Operations

  • SUB {gatewayId}/node/{nodeId}/$state

    The topic on which node state life cycle may be consumed.

    Inform about node life cycle state

    The life cycle will change during the powered node.

    Operation IDonNodeStateChange
    gatewayId
    required
    string
    must match: ^[a-zA-Z0-9\-_]+$uid: gatewayId

    Id of the gateway.

    Parameter location: $message.payload#/gatewayId
    nodeId
    required
    string
    must match: ^[a-zA-Z0-9\-_]+$uid: nodeId

    Id of the node which is also the serial number.

    Parameter location: $message.payload#/gatewayId/node/nodeId
    • #node

    Accepts the following message:

    Node state change.nodeStateChanged

    Inform about node state changes.

    Payload
    string
    uid: nodeStateChangedPayload
    • init: The node is connected to the MQTT broker, but has not yet sent all initialization messages and is not yet ready to operate.
    • updating: The node is updating the firmware.
    • ready: The node is connected to the MQTT broker, has sent all initialization messages and is ready to operate.
    • disconnected: this is the state the node is in when it is cleanly disconnected from the MQTT broker.
    • lost: this is the state the device is in when the device has been “badly” disconnected.
    • alert: this is the state the device is when connected to the MQTT broker, but something wrong is happening. E.g. a sensor is not providing data and needs human intervention.
      Allowed values:
    • "init"
    • "updating"
    • "ready"
    • "disconnected"
    • "lost"
    • "alert"

    Examples

  • SUB {gatewayId}/node/{nodeId}/$error

    The topic on which node errors may be consumed.

    Inform about node errors

    Displaying current errors on the node.

    Operation IDonNodeErrorChange
    gatewayId
    required
    string
    must match: ^[a-zA-Z0-9\-_]+$uid: gatewayId

    Id of the gateway.

    Parameter location: $message.payload#/gatewayId
    nodeId
    required
    string
    must match: ^[a-zA-Z0-9\-_]+$uid: nodeId

    Id of the node which is also the serial number.

    Parameter location: $message.payload#/gatewayId/node/nodeId
    • #node

    Accepts the following message:

    Node error change.nodeErrorChanged

    Inform about node errors.

    Payload
    string
    uid: nodeErrorChangedPayload
    • sensorpad_cable: There's an error on the cable or sensor pad.
    • fdc: The node fdc chip is damaged.
    • data_cable: The data cable is damaged.
      Allowed values:
    • "sensorpad_cable"
    • "fdc"
    • "data_cable"

    Examples

  • SUB {gatewayId}/node/{nodeId}/$fw/version

    The topic on which node firmware version may be consumed.

    Inform about node firmware version

    The node firmware follows semver.

    Operation IDonNodeFwChange
    gatewayId
    required
    string
    must match: ^[a-zA-Z0-9\-_]+$uid: gatewayId

    Id of the gateway.

    Parameter location: $message.payload#/gatewayId
    nodeId
    required
    string
    must match: ^[a-zA-Z0-9\-_]+$uid: nodeId

    Id of the node which is also the serial number.

    Parameter location: $message.payload#/gatewayId/node/nodeId
    • #node

    Accepts the following message:

    Node firmware version change.nodeFirmwareChanged

    Inform about node firmware version changes.

    Payload
    string
    uid: nodeFirmwareVersionChangedPayload

    Node firmware version

    Examples

  • SUB {gatewayId}/node/{nodeId}/$stats/uptime

    The topic on which node uptime may be consumed.

    Inform about node uptime

    The node update is meassured in seconds and updates every minute.

    Operation IDonNodeUptimeChange
    gatewayId
    required
    string
    must match: ^[a-zA-Z0-9\-_]+$uid: gatewayId

    Id of the gateway.

    Parameter location: $message.payload#/gatewayId
    nodeId
    required
    string
    must match: ^[a-zA-Z0-9\-_]+$uid: nodeId

    Id of the node which is also the serial number.

    Parameter location: $message.payload#/gatewayId/node/nodeId
    • #node

    Accepts the following message:

    Node uptime change.nodeUptimeChanged

    Inform about node uptime changes.

    Payload
    string
    uid: nodeUptimeChangedPayload

    Node uptime

    Examples

  • SUB {gatewayId}/node/{nodeId}/seat/{seatId}/cushion/category

    The topic on which measured values from seat cushion category may be consumed.

    Inform about seat category measurements for a particular seat

    Depending on the installed Attensys sensor, the resulting measurement will be published here whenever there is detected a change.

    Operation IDonSeatCushionCategoryMeasured
    gatewayId
    required
    string
    must match: ^[a-zA-Z0-9\-_]+$uid: gatewayId

    Id of the gateway.

    Parameter location: $message.payload#/gatewayId
    nodeId
    required
    string
    must match: ^[a-zA-Z0-9\-_]+$uid: nodeId

    Id of the node which is also the serial number.

    Parameter location: $message.payload#/gatewayId/node/nodeId
    seatId
    required
    string
    must match: ^[a-zA-Z0-9\-_]+$uid: seatId

    Id of the seat as specified in the seat paring process.

    Parameter location: $message.payload#/gatewayId/seat/seatId
    • #seat

    Accepts the following message:

    Seat measuredseatCushionCategoryMeasured

    Inform about sensor measurements for a particular seat.

    string oneOf
    uid: seatCushionCategoryMeasuredPayload

    Detected category depending on sensor type installed in seat.

    Examples

  • SUB {gatewayId}/node/{nodeId}/seat/{seatId}/cushion/category/$thresholds

    The topic on which measured values from seat cushion category tresholds may be consumed.

    Inform about seat category tresholds for a particular seat

    Depending on the installed Attensys sensor, the resulting measurement will be published here whenever there is detected a change.

    Operation IDonSeatCushionCategoryThresholdsChanged
    gatewayId
    required
    string
    must match: ^[a-zA-Z0-9\-_]+$uid: gatewayId

    Id of the gateway.

    Parameter location: $message.payload#/gatewayId
    nodeId
    required
    string
    must match: ^[a-zA-Z0-9\-_]+$uid: nodeId

    Id of the node which is also the serial number.

    Parameter location: $message.payload#/gatewayId/node/nodeId
    seatId
    required
    string
    must match: ^[a-zA-Z0-9\-_]+$uid: seatId

    Id of the seat as specified in the seat paring process.

    Parameter location: $message.payload#/gatewayId/seat/seatId
    • #seat

    Accepts the following message:

    Seat category thresholds changedseatCushionCategoryThresholdsChanged

    Inform about seat categories for a particular seat.

    Payload
    string
    uid: seatCushionCategoryThresholdsPayload

    Comma seperated numbers of seat thresholds

    Examples

  • SUB {gatewayId}/node/{nodeId}/seat/{seatId}/cushion/category/$datatype

    The topic on which measured values from seat cushion category data-types may be consumed.

    Inform about seat category data-types for a particular seat.

    Depending on the installed Attensys sensor, the resulting measurement will be published here whenever there is detected a change.

    Operation IDonSeatCushionDatatypeChanged
    gatewayId
    required
    string
    must match: ^[a-zA-Z0-9\-_]+$uid: gatewayId

    Id of the gateway.

    Parameter location: $message.payload#/gatewayId
    nodeId
    required
    string
    must match: ^[a-zA-Z0-9\-_]+$uid: nodeId

    Id of the node which is also the serial number.

    Parameter location: $message.payload#/gatewayId/node/nodeId
    seatId
    required
    string
    must match: ^[a-zA-Z0-9\-_]+$uid: seatId

    Id of the seat as specified in the seat paring process.

    Parameter location: $message.payload#/gatewayId/seat/seatId
    • #seat

    Accepts the following message:

    Seat cushion datatype change.seatCushionCategoryDatatypeChanged

    Inform about Seat cushion datatype changes.

    Payload
    string
    uid: seatCushionCategoryDatatypeChangedPayload

    Comma separated string enums of valid seat cushion data-types fx person,empty

    Examples

Messages

  • #1Seat measuredseatCushionCategoryMeasured

    Inform about sensor measurements for a particular seat.

    string oneOf
    uid: seatCushionCategoryMeasuredPayload

    Detected category depending on sensor type installed in seat.

  • #2Seat category thresholds changedseatCushionCategoryThresholdsChanged

    Inform about seat categories for a particular seat.

    Payload
    string
    uid: seatCushionCategoryThresholdsPayload

    Comma seperated numbers of seat thresholds

  • #3Node state change.nodeStateChanged

    Inform about node state changes.

    Payload
    string
    uid: nodeStateChangedPayload
    • init: The node is connected to the MQTT broker, but has not yet sent all initialization messages and is not yet ready to operate.
    • updating: The node is updating the firmware.
    • ready: The node is connected to the MQTT broker, has sent all initialization messages and is ready to operate.
    • disconnected: this is the state the node is in when it is cleanly disconnected from the MQTT broker.
    • lost: this is the state the device is in when the device has been “badly” disconnected.
    • alert: this is the state the device is when connected to the MQTT broker, but something wrong is happening. E.g. a sensor is not providing data and needs human intervention.
      Allowed values:
    • "init"
    • "updating"
    • "ready"
    • "disconnected"
    • "lost"
    • "alert"
  • #4Node error change.nodeErrorChanged

    Inform about node errors.

    Payload
    string
    uid: nodeErrorChangedPayload
    • sensorpad_cable: There's an error on the cable or sensor pad.
    • fdc: The node fdc chip is damaged.
    • data_cable: The data cable is damaged.
      Allowed values:
    • "sensorpad_cable"
    • "fdc"
    • "data_cable"
  • #5Node uptime change.nodeUptimeChanged

    Inform about node uptime changes.

    Payload
    string
    uid: nodeUptimeChangedPayload

    Node uptime

  • #6Node firmware version change.nodeFirmwareChanged

    Inform about node firmware version changes.

    Payload
    string
    uid: nodeFirmwareVersionChangedPayload

    Node firmware version

  • #7Seat cushion datatype change.seatCushionCategoryDatatypeChanged

    Inform about Seat cushion datatype changes.

    Payload
    string
    uid: seatCushionCategoryDatatypeChangedPayload

    Comma separated string enums of valid seat cushion data-types fx person,empty

Schemas

  • nodeStateChangedPayload
    string
    uid: nodeStateChangedPayload
    • init: The node is connected to the MQTT broker, but has not yet sent all initialization messages and is not yet ready to operate.
    • updating: The node is updating the firmware.
    • ready: The node is connected to the MQTT broker, has sent all initialization messages and is ready to operate.
    • disconnected: this is the state the node is in when it is cleanly disconnected from the MQTT broker.
    • lost: this is the state the device is in when the device has been “badly” disconnected.
    • alert: this is the state the device is when connected to the MQTT broker, but something wrong is happening. E.g. a sensor is not providing data and needs human intervention.
      Allowed values:
    • "init"
    • "updating"
    • "ready"
    • "disconnected"
    • "lost"
    • "alert"
  • nodeErrorChangedPayload
    string
    uid: nodeErrorChangedPayload
    • sensorpad_cable: There's an error on the cable or sensor pad.
    • fdc: The node fdc chip is damaged.
    • data_cable: The data cable is damaged.
      Allowed values:
    • "sensorpad_cable"
    • "fdc"
    • "data_cable"
  • nodeFirmwareVersionChangedPayload
    string
    uid: nodeFirmwareVersionChangedPayload

    Node firmware version

  • nodeUptimeChangedPayload
    string
    uid: nodeUptimeChangedPayload

    Node uptime

  • seatCushionCategoryDatatypeChangedPayload
    string
    uid: seatCushionCategoryDatatypeChangedPayload

    Comma separated string enums of valid seat cushion data-types fx person,empty

  • seatCushionCategoryThresholdsPayload
    string
    uid: seatCushionCategoryThresholdsPayload

    Comma seperated numbers of seat thresholds

  • string oneOf
    uid: seatCushionCategoryMeasuredPayload

    Detected category depending on sensor type installed in seat.

  • singleSensorPayload
    string
    uid: singleSensorPayload

    Single Sensor

      Allowed values:
    • "empty"
    • "person"
  • singleSensorPlusPayload
    string
    uid: singleSensorPlusPayload

    Single Sensor plus

      Allowed values:
    • "empty"
    • "person"
    • "object-small"
    • "object-large"
  • dualSensorPayload
    string
    uid: dualSensorPayload

    Dual Sensor

      Allowed values:
    • "empty"
    • "person"
    • "object-small"
    • "object-large"
    • "liquid"
  • tripleSensorPayload
    string
    uid: tripleSensorPayload

    Triple Sensor

      Allowed values:
    • "empty"
    • "person"
    • "object-small"
    • "object-large"
    • "liquid"
    • "object-under-seat"