Search…
Using Ruuvi Station as a Gateway
With this feature you can let the app act as a gateway, forwarding RuuviTag measurements to a http endpoint using POST requests.

Setup

The app will act as a gateway when:
  1. 1.
    Background scanning is enabled
  2. 2.
    A valid URL has been set in app settings
If the 2 points are fulfilled the app will POST background scanning results to the URL. The app only sends measurements for tags added in the app.

Data format

Every POST contains 2 blocks: tags data and device information. Tags data can contain one or few tag scan results after "tags".
"tags":[{tagdata1},{tagdata2}, ... ,{tagdataN}]

Tag fields description

Field name
Data format
Unit/Format
Description
accelX
Double
G
Acceleration along X axis, including gravity
accelY
Double
G
Acceleration along Y axis, including gravity
accelZ
Double
G
Acceleration along Z axis, including gravity
createDate
String
yyyy-MM-dd'T'HH:mm:ssZ
Date when tag added to Ruuvi Station
dataFormat
Int
Data format from tag firmware
defaultBackground
Int
Id of curent background used in Ruuvi Station for this tag
favorite
boolean
Always true for tags added to Ruuvi Station
humidity
Double
Percentage
Current relative humidity
id
String
MAC address of tag
measurementSequenceNumber
Int
Value gets incremented by one for every measurement from 0 to 2^16
movementCounter
Int
How many times tag has detected movement from 0 to 2^8
name
String
Name of tag specified by user (can be absent)
pressure
Int
Pa
Current pressure
rssi
Int
dB
Received signal strength indication
temperature
Double
Celsius
Current temperature
txPower
Int
dBm
Transmission power of tags
updateAt
String
yyyy-MM-dd'T'HH:mm:ssZ
Date of current measurments
voltage
Double
V
Battery voltage from tag

Device information fields description

Field name
Data format
Unit/Format
Description
batteryLevel
Int
Percentage
Current battery charge percentage of device running Ruuvi Station
deviceId
String
Configurable in app settings, default is UUID generated on first start
eventId
String
UUID for this request
accuracy
Double
meters
horizontal accuracy of this location, radial (OPTIONAL)
altitude
Double
meters
altitude (added in app version 1.7.4) (OPTIONAL)
latitude
Double
degrees
latitude (OPTIONAL)
longitude
Double
degrees
longitude (OPTIONAL)
time
String
yyyy-MM-dd'T'HH:mm:ssZ
Gateway request send date

Example

1
{
2
"tags": [
3
{
4
"accelX": 0.012,
5
"accelY": -0.004,
6
"accelZ": 1.008,
7
"createDate": "2020-08-11T18:51:58+0300",
8
"dataFormat": 5,
9
"defaultBackground": 2,
10
"favorite": true,
11
"humidity": 32.8425,
12
"id": "E5:F1:98:34:C0:0F",
13
"measurementSequenceNumber": 62865,
14
"movementCounter": 21,
15
"name": "Kitchen",
16
"pressure": 98702,
17
"rssi": -43,
18
"temperature": 25.58,
19
"txPower": 4,
20
"updateAt": "2020-08-18T19:57:48+0300",
21
"voltage": 3.013
22
}
23
],
24
"batteryLevel": 35,
25
"deviceId": "yxftd9pnitd-156xhref9g69a",
26
"eventId": "c07e3f9f-f6bb-4792-be6f-a9be95cdff38",
27
"location": {
28
"accuracy": 35.369,
29
"altitude": 208.59999084472656,
30
"latitude": 55.8256671,
31
"longitude": 37.5962931
32
},
33
"time": "2020-08-18T19:57:48+0300"
34
}
Copied!

Ruuvi Station gateway API Server

Open source gateway server can be found at: https://github.com/ruuvi/ruuvi-station-influx-gateway