Contents
Find everything you need to know about the RmoniWeb JSON API below. This article consists out of the following items:
- Introduction
- JSON API URL's
- Authentication
- Encryption
- Available methods
- Getting started
- Hardware topology
- Sensor information
1. Introduction
Rmoni has developed Digital Quality Management Solutions for the registration, real-time monitoring and reporting of crucial control parameters. One of the solutions concerns sensor monitoring.
Each device contains a Zigbee radio module and a microcontroller which is responsible for doing the measurements and controlling the radio for transmitting all kinds of messages over the air. Each device is uniquely defined by its mac address (8 bytes in hex-notation: 0013A200158E3F7C)
Sensor Endpoints: Sensor boxes with connection possibilities to a wide range of probes for different applications: temperature, humidity, etc.
Routers: Extending the range of the Zigbee network
Gateways: Full range of 'bridges' between the wireless Zigbee network, and the internet/onboard-computers:
- Ethernet and Wifi LAN gateway
- GPRS standalone gateway
- Serial gateways for passing data to Truck onboard-computers
- GPRS boxes with GPS for monitoring vehicles and cargoes
Each sensor/probe is uniquely identified by its:
- Network identification (unitid or mac of Coordinator)
- Unique MAC address of the sensor box
- KeyId of the probe
2. JSON API URL's
The description of the interface is available at: https://service.rmoniweb.rmoni.com/swagger/index.html
The API itself is reachable via: https://service.rmoniweb.rmoni.com
3. Authentication
The JSON authentication is done using a Bearer Token. In order to get a Token, the following steps have to be executed:
Step 1: Assign the permission “Execution of API calls” to an existing or new user by admin user
Step 2: Log in with this user and go to “Administration” -> “Settings” -> tab “Generate a security token for the API”
Step 3: Generate a security token by clicking on the button
Click on the button “Generate a security token”. A popup will appear with a generated security token.
Copy this token to a safe location. If a token is lost, a new token can be generated by clicking on the “Generate a security token”.
Step 4 : use the token in the bearer token of all your HTTP requests
GET /GetDataForSensor?unitId=26&dateFrom=2023-01-01&dateTo=2023-01-10&mac=0013A200AABBCC01&keyId=1008 HTTP/1.1
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI0ODgiLCJ0ZW5hbnRJZCI6IjciLCJ0ZW5hbmN5TmFtZSI6IkRlbW9NYXJrIiwiY3JlYXRpb25EYXRlIjoiMjAtMS0yMDIzIDA5OjQ3OjAwIiwiaXNzIjoiUm1vbmlXZWIiLCJhdWQiOiJSbW9uaVdlYiJ9.vb3jnRdb4GNi9aZNZ4wh6Gq6R-l-ERFWq9Vao0R5TZM
User-Agent: PostmanRuntime/7.30.0
Accept: */*
Cache-Control: no-cache
Postman-Token: 18dcdbb6-90dc-46b0-9a39-9f81e2c840a2
Host: test.service.rmoniweb.rmoni.com
Accept-Encoding: gzip, deflate, br
Connection: keep-alive
4. Encryption
By default encryption is enabled using SSL. All JSON API calls have to be done using HTTPS.
5. Available methods
Networklist | |
getNetworksForLoginacount | |
Sensorlist | |
getSensorsForNetwork | |
getSensorsForDevice | |
Devicelist | |
getDevicesForNetwork | |
getDevicesStatus | |
getCurrentDeviceStatus | |
Measurements | |
getDataForNetwork | |
getNewData | |
getNewDataWithoutAck | |
AckNewData | |
getDataForDevice | |
getDataForSensor | |
getDataForNetwork | |
AlarmingEvents | |
getAlarmEventsForNetwork | |
getAlarmEventsForDevice | |
getAlarmEventsForSensor | |
getAlarmEventsSummary | |
Lists | |
getTimezoneList | |
PublishedChecklists | |
/GetPublishedChecklistsDiff |
Documentation can be found on swagger-url.
6. Getting started
- Step 1 : Create an authentication token using Chapter 3. Authentication
- Step 2 : Use the following sample code in C#
using System.Net.Http.Headers;
using System.Text.Json;
using System.Text.Json.Serialization;
using Microsoft.AspNetCore.WebUtilities;
using HttpClient client = new();
String AccessToken = “<put here your accesstoken>”;
client.DefaultRequestHeaders.Accept.Clear();
client.DefaultRequestHeaders.Accept.Add(
new MediaTypeWithQualityHeaderValue("application/json"));
client.DefaultRequestHeaders.Add("User-Agent", "JSON API Client");
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", AccessToken);
await GetNetworksForLoginAccountAsync(client);
static async Task GetNetworksForLoginAccountAsync(HttpClient client)
{
var parameters = new Dictionary<string, string> { { "unitId", "2701" }, { "mac", "0013A2004151E783" }, { "limitSensors", "0" } };
var uri = QueryHelpers.AddQueryString("https://service.rmoniweb.rmoni.com/GetSensorsForDevice", parameters);
var response = await client.GetAsync(uri);
await using Stream stream = await client.GetStreamAsync(uri);
var sensors =
await JsonSerializer.DeserializeAsync<List<Sensor>>(stream);
foreach (var sensor in sensors ?? Enumerable.Empty<Sensor>())
{
Console.WriteLine();
Console.WriteLine("Network UnitId = " + sensor.unitId);
Console.WriteLine("Sensor alias = " + sensor.sensorAlias);
Console.WriteLine("Sensor lastest measurement = " + sensor.latestMeasurement);
}
}
public class Sensor
{
public int? unitId { get; set; }
public string? networkAlias { get; set; }
public string? mac { get; set; }
public string? deviceAlias { get; set; }
public string? keyId { get; set; }
public string? sensorAlias { get; set; }
public DateTime? latest_measurement_timestamp { get; set; }
public decimal? latestMeasurement { get; set; }
public string? unit { get; set; }
public int? typeId { get; set; }
public string? type_Desc { get; set; }
public int? errorCode { get; set; }
public string? latest_errorcode_desc { get; set; }
}
7. Hardware topology
The Rmoni hardware is structured as below. Each customer has an account of which you can get the available networks. A network contains devices and each device can have multiple sensors.
8. Sensor information
The following probes are currently available.
Sensors are identified by a keyid.
- Keyid : {attr0}{attr1}
- Attr0 : indicating the type of measurement
- Attr1 : indicating the location of the probe (connected on which pin)
Available Measurements (Range : 00..40) / Pin# = 01, 02, 04, 08, 10, 20, 40, 80
Attr0 | Attr1 | Description | Unit | Decimals |
10 | Pin # | NTC Temperature Measurement | °C | 1 |
11 | Pin # | Humidity Measurement | % | 1 |
12 |
|
|
|
|
13 | Pin # | Current Measurement | mA | 2 |
14 | Pin # | Resistor Measurement | Ohm | 2 |
15 | Pin # | Voltage Measurement | mV | 3 |
16 | Pin # | CO2 Measurement | ppm | 0 |
17 | Pin # | Pressure Measurement | Pa | 1 |
18 |
|
|
|
|
19 | Pin # | Thermocouple Measurement | °C | 1 |
1A | Pin # | O2 Measurement |
| 1 |
1B |
|
|
|
|
1C | Pin # | Particle Measurement | pcs/0.01cf | 0 |
1D | Pin # | Pressure Measurement | kPa | 1 |
1E |
|
|
|
|
1F |
|
|
|
|
20 | Pin # | Distance/Length Measurement | cm | 1 |
21 | Pin # | Soil Moisture Measurement | % | 1 |
22 | Pin # | Leaf Wetness Measurement | .. | 1 |
23 | Pin # | PT100 Measurement | °C | 1 |
24 |
| Preserved for Xbee IO Samples |
|
|
25 | Pin # | Contact Measurement |
| 0 |
26 | Pin # | Energy Measurement | kWh | 2 |
27 | Pin # | Power Measurement | W | 0 |
28 | Pin # | Units Measurement | Pcs | 0 |
29 | Pin # | Units per Hour Measurement | Pcs/h | 0 |
2A | Pin # | Volume Measurement | m³ | 3 |
2B | Pin # | Flow Measurement | m³/h | 3 |
2C | Pin # | CO2 Measurement | % | 1 |
2D | Pin # | Volume Measurement | liter |
|
2E | Pin # | Shelflife |
|
|
Attr0 | Attr1 | Description | Unit | Decimals |
2F | Pin # | Flow Measurement | Liter |
|
33 | Pin # | Dummy Measurement |
| 0 |
34 |
|
|
|
|
3F | Pin # | Relays Measurement |
| 0 |
40 | Pin # | Digital IO Measurement |
| 0 |
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article