Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

Direct vs Smart message types

Direct Message Types are actually raw messages received from sensors, which are formatted into JSON. You are able to configure a message of this types of processing scenario and set up your own HTTP-body format.

Smart message types have a pre-defined template body that cannot be changed. These messages are the results of the Nwave Parking Analytics system. They support the following features:

  • Filtering of extremely short parking sessions (open bays only)

  • Advanced handling of unmarked bay occupancies

  • Automatic parking session correction in the event of message loss

  • Easy transition to RabbitMQ protocols (RTA & Parking Sessions) due to identical structure

Smart message types are recommended for payment applications

Category

Message Type

Description

Direct

Status Change

status change message is sent from a sensor when its value has been changed (occupancy state for parking sensor or number of detected cars for car counters

Heartbeat

heartbeat message is sent after every constant time period of unchanging sensor state

User Registration

user registration message is sent when a user is authorized on the sensor using a Bluetooth-tag

Smart

Group Occupancy

status change message in a group format with group summary

Parking Sessions

smart parking session messages formed by Nwave’s backend, with auto-correction for lost messages

Preset Templates for Direct Message Types (Editable format)

These are template bodies of the template presets available at your console. You can create custom templates for each directmessage typeand the templates below can be used as a starting point.

Message Type

Template Body

Status Change

{
  "device_id": "{device_id}",
  "position":{
      "network_id": "{network_id}",
      "custom_id": "{custom_id}",
      "latitude": {latitude},
      "longitude": {longitude},
      "group_inner_id": {group_inner_id},
      "group":{
          "id": {group_id},
          "name": "{group_name}",
          "zone_id": {zone_id}
      }
  },
  "message_type": "status_change",
  "occupied": "{"occupied" if parsed["occupation_status"] is True else "free"}",
  "parking_session_iterator": {parsed["parking_session_iterator"]},
  "previous_occupancy_status_duration_min": {parsed["previous_occupancy_status_duration_min"]},
  "voltage_V": {parsed["voltage_V"]}
}
  • message_type - message type;

  • message_trace_id - system message-id;

  • occupied - parking occupancy status ("occupied" or "free");

  • parking_session_iterator - short serial number of parking session. Iterator (number) is incrementing when new parking session starts (0-7);

  • previous_status_duration_min - duration of previous sensor status;

  • voltage_V - device’s voltage

User Registration

{
  "device_id": "{device_id}",
  "position":{
      "network_id": "{network_id}",
      "custom_id": "{custom_id}",
      "latitude": {latitude},
      "longitude": {longitude},
      "group_inner_id": {group_inner_id},
      "group":{
          "id": {group_id},
          "name": "{group_name}",
          "zone_id": {zone_id}
      }
  },
  "message_type": "user_registration",
  "occupied": "{"occupied" if parsed["occupation_status"] is True else "free"}",
  "voltage_V": {parsed["voltage_V"]},
  "auth_ble_tag": {
    "tag_id": "{parsed["user_ID"]}",
    "event_time": "{message_time}"
  }
}
  • message_type - message type;

  • message_trace_id - system message-id;

  • parking_session_iterator - short serial number of parking session. Iterator (number) is incrementing when new parking session starts (0-7);

  • occupied- parking occupancy status ("occupied" or "free");

  • voltage_V - device’s voltage;

  • auth_ble_tag

    • tag_id - an ID of Bluetooth tag which was used for authorization;

    • event_time - message reception time.

Heartbeat

{
  "device_id": "{device_id}",
  "position":{
      "network_id": "{network_id}",
      "custom_id": "{custom_id}",
      "latitude": {latitude},
      "longitude": {longitude},
      "group_inner_id": {group_inner_id},
      "group":{
          "id": {group_id},
          "name": "{group_name}",
          "zone_id": {zone_id}
      }
  },
  "message_type": "heartbeat",
  "parking_session_iterator": {parsed["parking_session_iterator"]},
  "occupied": "{"occupied" if parsed["occupation_status"] is True else "free"}",
  "heartbeat_message_counter": {parsed["heartbeat_message_counter"]},
  "voltage_V": {parsed["voltage_V"]}
}
  • message_type - message type;

  • message_trace_id - system message-id;

  • parking_session_iterator - short number of parking session. Iterator is incrementing when parking session starts (0-7);

  • occupied - parking occupancy status ("occupied" or "free");

  • heartbeat_message_counter - the value increases for every following heartbeat during single occupancy state (0-11);

  • voltage_V - device’s voltage

Preset Templates for Smart Message Types (Fixed format)

These are examples of HTTP request bodies produced by smart templates. They cannot be modified but you can use the example requests as reference.

Message Type

Example Request Body

Group Availability

RabbitMQ version

{
   "timestamp": "2021-01-01T00:00:00.000000+00:00",
   "group_id": 1,
   "project_id": 1,
   "group_custom_id": "Group Custom ID",
   "level_id": null,
   "floor_number": null,
   "positions_availability":[
      {
         "position":{
            "id": 1,
            "network_id":"00000000-0000-0000-0000-000000000001",
            "custom_id": "Custom ID 1",
            "group_inner_id": 1,
            "lat": 52.406063006389,
            "lon": -1.5157277658969
         },
         "occupation_status":"occupied"
      },
      {
         "position":{
            "id": 2,
            "network_id":"00000000-0000-0000-0000-000000000002",
            "custom_id": "Custom ID 2",
            "group_inner_id": 2,
            "lat": 52.406022747069,
            "lon": -1.5157359155385
         },
         "occupation_status":"occupied"
      },
      {
         "position":{
            "id": 3,
            "network_id":"00000000-0000-0000-0000-000000000003",
            "custom_id": "Custom ID 3",
            "group_inner_id": 3,
            "lat": 52.406101689254,
            "lon": -1.515721405201
         },
         "occupation_status":"n/a"
      }
   ],
   "summary":{
      "total": 3,
      "occupied": 2,
      "available": 0,
      "undefined": 1
   }
}

Parking Session

RabbitMQ version

{
   "parking_session_uuid": "d8f7d4b3-a26c-4921-a488-489de273bcf6",
   "involved_devices":[
      {
         "device_id": "100AA",
         "hardware_type": "Sparkit Surface V3.9",
         "position":{
            "network_id":"00000000-0000-0000-0000-0000000100aa",
            "custom_id": null,
            "latitude": 52.40602,
            "longitude": -1.5157359,
            "group":{
               "id": 1,
               "type": "marked_spaces",
               "name": "Group Name 1",
               "custom_id": "Group Custom ID",
               "zone_id": 1,
               "level_id": null,
               "floor_number": null,
               "zone":{
                  "id": 1,
                  "project_id": 1
               }
            },
            "group_inner_id":1
         }
      }
   ],
   "correction_counter": 0,
   "session_start":{
      "event_time":"2021-01-01T00:00:00.000000+00:00",
      "delta_time_sec": 0,
      "message_trace_ids":[
         "d8cd1146-21f7-3906-21e4-8f55534f6573"
      ]
   },
   "session_end": {
      "event_time": "2021-01-01T01:00:00.000000+00:00",
      "delta_time_sec": 0,
      "message_trace_ids": [
          "71bfb22e-3569-d7c1-26fd-a2a0d0febb7a"
      ],
    }
}

  • No labels