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"]} } |
| |
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}" } } |
| |
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"]} } |
|
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 | { "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 | { "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" ], } } |