# Devices Latest Status

This section lists bulk Uplink API that will help you to retrieve the latest device information and historical events.

# Retrieve latest sensors state

Retrieves the latest status of all devices in the account with their current sensor state, Device Status will hold various values such as battery, firmware version, hardware version, tamper state and different values depending on the device type.

GET  /get-devices-summary?page={page}&itemsPerPage=100 

Example request

$ curl --location --request POST 'https://console.radiobridge.com/api/visualization/v1/get-devices-summary?page={page}&itemsPerPage=100' \
--header 'Organization: <org_id>' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data-raw '{
    "devices": ["8000000000001"]
}'

Example Request Body

{
  "devices": ["8000000000001"]
}
Property Data Type Description
devices Array (Optional) Filters the data for the requested device ids

Example response

{
  "data": {
    "8000000000001": {
      "lastmsg_time": "Jul 25, 2023 17:37:50 (UTC)",
      "battery": "2.8V",
      "tamper": "Yes",
      "tamper_detect_since_reset": "No",
      "config_error": "No",
      "rate_limit_status": "No",
      "current_sensor_state": "25 C",
      "hardware_version": "2.7",
      "firmware_version": "2.2.16",
      "low_battery": "No",
      "last_seen": "1690306670",
      "rssi": null,
      "snr": null,
      "last_downlink_status": null,
      "measurement": "25 C"
    }
  },
  "payload": {
    "page": "1",
    "itemsPerPage": "1"
  },
  "links": {
    "first": "https://console.radiobridge.com/api/visualization/v1/get-devices-summary?page=1",
    "last": "https://console.radiobridge.com/api/visualization/v1/get-devices-summary?page=10",
    "prev": null,
    "next": "https://console.radiobridge.com/api/visualization/v1/get-devices-summary?page=2"
  }
}

# Common response properties

Following properties are applicable to all the Console sensors and will be available in the payload. If there will be no value in the system for the given property then it will hold null value.

Property Data Type Description
lastmsg_time String Timestamp when last message was received from the device
last_seen String Unix Timestamp of when last message was received from the device
battery String Battery voltage based on recent Supervisory event
tamper String Yes - When device enclosure is open and when closed this will hold No value.
tamper_detect_since_reset String Yes - if the device was tampered after the last reset event
config_error String Yes - when config error exists and no when cong error does not exist.
rate_limit_status String Yes - when device exceeds the daily uplink rate limit
current_sensor_state String Holds the current state of sensor
hardware_version String Hardware version from reset message Example: “2.0”
firmware_version String Firmware version from reset message Example: “1.6”
low_battery String Indicates if the sensor battery is lower than recommended level
rssi String Receive Signal Strength Indicator Example: “-93”
snr String Signal to Noise Ratio Example: “10.3”
last_downlink_status String Indicates if the last scheduled downlink was configured successfully.

# Bulk device events retrieval

Retrieves the historical events for each device in the account

GET  /get-devices-summary?page={page}&itemsPerPage=100 

Example request

$ curl --location --request POST 'https://console.radiobridge.com/api/visualization/v1/get-devices-history?page={page}&itemsPerPage=10' \
--header 'Organization: <org_id>' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data-raw '{
    "devices": ["ABCDEF112233445566", "ABCDEF112233445577"]
}'

Example Request Body

{
  "devices": ["ABCDEF112233445566", "ABCDEF112233445566"]
}
Property Data Type Description
devices Array (Optional) Filters the data for the requested device ids

Example response

{
   "data":[
      {
         "device_id":"ABCDEF112233445566",
         "events":[
            {
               "type":"TEMPERATURE_EVENT",
               "temperature":"20C",
               "event_time":"2023-01-01 22:11:11"
            },
            {
               "type":"TEMPERATURE_EVENT",
               "temperature":"21C",
               "event_time":"2023-01-01 22:10:00"
            }
         ]
      },
      {
         "device_id":"ABCDEF112233445577",
         "events":[
            {
               "temperature":"30C",
               "type":"TEMPERATURE_EVENT",
               "event_time":"2023-01-01 22:12:11"
               
            },
            {
               
               "temperature":"32C",
               "type":"TEMPERATURE_EVENT",
               "event_time":"2023-01-01 21:11:00"
            }
         ]
      }
   ],
   "payload":{
      "page":"1",
      "itemsPerPage":"10"
   },
   "links":{
      "first":"https://console.radiobridge.com/api/visualization/v1/get-devices-history?page=1",
      "last":"https://console.radiobridge.com/api/visualization/v1/get-devices-history?page=10",
      "prev":null,
      "next":"https://console.radiobridge.com/api/visualization/v1/get-devices-history?page=2"
   }
}
Property Data Type Description
device_id String Holds the value of device Id
events Object Holds event array with various attributes See attributes based on Device Type table
payload Object Holds the value of page and page per item for pagination
links Object Holds the links of first, last, previous and next page

# Responses by Device Type

With the common properties additional properties will be included in the response depending on the Device type.

# Temperature Sensors

Property Data Type Description
measurement String Holds the last received temperature value with unit

# Air Temperature & Humidity Sensors

Property Data Type Description
measurement String Holds the last received temperature value in degrees celcius
humidity Sting Holds the last received humidity value with unit

# Acceleration Movement Sensors

Property Data Type Description
measurement String Holds the last received temperature value with unit
event_description String Holds the last received description of event

# Contact Sensors

Property Data Type Description
contacts_state String Holds the last received state(shorted, opened) of contact

# Water Sensors

Property Data Type Description
measurement String Holds the last received temperature value with unit

# Tilt Sensors

Property Data Type Description
measurement String Holds the Tilt angle from vertical axis

# Tank Level Sensors

Property Data Type Description
event_description String Indicates the tank state (either full or empty)

# Ambient Light Sensors

Property Data Type Description
measurement String Holds the last received relative temperature value

# High Precision Tilt Sensor

Property Data Type Description
measurement String Holds the Tilt angle from vertical axis with unit
temperature String Holds the last received temperature value with unit

# 4-20mA Current Loop Sensors

Property Data Type Description
measurement String Holds the Current measurement value with unit
event_description String Indicates the latest sensor state

# Voltage Sensors

Property Data Type Description
measurement String Holds the last received voltage measurement value with unit

# Gps Device Sensor - GPS Config

Property Data Type Description
latitude String Holds the last received latitude value
longitude String Holds the last received longitude value

# Magnetometer Sensor

Property Data Type Description
measurement String Holds the last received temperature value with unit
xaxis String Holds the last received x axis value in milliguss
yaxis String Holds the last received y axis value in milliguss
zaxis String Holds the last received z axis value in milliguss

# Compass Sensors

Property Data Type Description
measurement String Holds the last received temperature value with unit
angle String Holds the last received angle value with unit
temperature String Holds the last received temperature value with unit

# Door/Window Sensors

Property Data Type Description
door_state String Indicates the current door state (either opened/closed)

# Thermocouple Temperature Sensors

Property Data Type Description
measurement String Holds the last received temperature value with unit
faults String Holds the last received faults value

# Weather Station Sensors

Property Data Type Description
wind_speed Object Holds min, max and avg value in m/s
station_status Object Holds temperature in Celsius, voltage in volt, supply in volt, reference in volt
hail Object Holds duration in seconds, accumulation in mm and intensity in mm/h
rain Object Holds duration in seconds, accumulation in mm and intensity in mm/h
pressure_temp_humidity Object Holds temperature in Celsius, pressure in pa and humidity in percentage
wind_direction Object Holds min, max and avg value in degrees
error_event String Holds the error value

# Glass Break Sensors

Property Data Type Description
event_description String Holds the last received description of event

# Ultrasonic Level Sensor

Property Data Type Description
measurement String Holds the last received temperature value with unit
event_description String Holds the last received description of event

# High Bandwidth Vibration Sensors

Property Data Type Description
axis Integer Holds the last received axis value
low_freq_peak_velocity Decimal Holds the last received low frequency peak velocity
high_freq_peak_gforce Decimal Holds the last received high frequency peak velocity
bias_voltage Decimal Holds the last received bias voltage value
event_description String Holds the last received description of event
sensor_state String Holds the last received state of sensor

# Condensed FFT

Condensed FFT data is of 2 types and each of these have different axis and each axis have 8 values.

  1. Peak Energy
  2. Total Energy
Property Data Type Description
condensed_fft_peak_energy_axis_<1> Object Holds the type, axis and values object. See the table below.
condensed_fft_total_energy_axis_<1> Object Holds the value of type, values object. See the table below.

Here <1> will change based on the received axis values.

# Peak and Total Energy Object

Property Data Type Description
axis Integer Holds the last received axis value
type String Holds the last received type such as "Peak Energy Values" and "Total Energy Values"
values Object Holds the label for band, freq of each band and value of bands - See the table below.

# Values Object

Property Data Type Description
band String Holds the label for last each band
freq String Holds the value of last received frequency range of each band
value Integer Holds the value of each band