RAPT Pill#
Cloud Hosted
The RAPT Pill is a floating hydrometer that reports gravity, temperature and battery to the rapt.io cloud. This page shows two ways to get those readings into BrewGraph: a rapt.io custom stream, or a GravityMon Gateway that reads the Pill over BLE. Use one of them for a given Pill, not both.
RAPT Pill support is available on every plan during the beta. Both ways work on Cloud Hosted: the rapt.io custom stream posts to your endpoint URL with the token in the URL, and a GravityMon Gateway forwards what it reads over BLE.
Note
A RAPT Pill reports a meaningless gravity until it is calibrated in the RAPT app, and BrewGraph stores what it receives. See the note on data stored as sent.
Read the Pill with a GravityMon Gateway#
A GravityMon Gateway with firmware 0.9.3 or later can read a RAPT Pill over BLE and forward the readings to the standard GravityMon endpoint in BrewGraph. This works without the rapt.io cloud, as long as the Pill is within BLE range of the Gateway.
Set up the Gateway, including its BLE sources and push target, as described on GravityMon Gateway. BLE devices do not send a token, so their readings report under the Gateway’s own token; that page explains how the Gateway is added in BrewGraph.
If you use the Gateway, skip the rapt.io custom stream below.
Use the rapt.io custom stream#
What you need#
A RAPT Pill device added in BrewGraph under Devices. BrewGraph shows its device token on the device page. See Device Tokens.
A RAPT Pill that already reports to your rapt.io account.
Configure the rapt.io custom stream#
In rapt.io, open Manage Account, then My Integrations, and create a Custom stream for the RAPT Pill.
Set the HTTP method to
POST.
Field |
Value |
|---|---|
Endpoint URL |
|
Query String Parameter |
Key |
Payload |
The template below. |
If the portal offers no query-string field, end the endpoint URL with the token
as a path segment instead:
https://ingest.brewgraph.com/ingest/rapt-pill/<token>.
The token is carried in the address, never in the payload.
Payload#
Use this template as the payload. The variables are not wrapped in quotes:
{
"name": "@device_name",
"gravity": @gravity,
"temperature": @temperature,
"battery": @battery,
"rssi": @rssi
}
@gravity must stay without quotes. A quoted gravity ("1.048") is
refused with 422.
A payload as BrewGraph receives it:
{
"name": "RAPT Pill",
"gravity": 1.048,
"temperature": 20.1,
"battery": 87,
"rssi": -68
}
Field |
Meaning |
|---|---|
|
Required. Specific gravity as a JSON number. Stored as sent, with no unit conversion. |
|
Optional. Degrees Celsius, as rapt.io sends it. Stored as sent. |
|
Optional. Battery percentage, stored and shown as reported. No voltage is calculated from it. |
|
Optional. Signal strength in dBm, stored as a whole number. |
|
Optional. The device name set in rapt.io. |
A temperature, battery or rssi that is not a number is dropped and
the rest of the reading is stored.
Accepted and ignored#
The portal can also send device_id, device_name, device_type,
created_date, target_temperature, temp_unit and gravity_unit.
BrewGraph accepts them and ignores them. The reading is timestamped when it
arrives, not with the time rapt.io reports.
To test the address by hand, save a payload as payload.json and send it:
curl -X POST 'https://ingest.brewgraph.com/ingest/rapt-pill?token=<token>' \
-H 'Content-Type: application/json' --data-binary @payload.json
Check that it works#
Save the stream. rapt.io forwards a reading each time the RAPT Pill transmits.
Open the device in BrewGraph. The latest reading, with its gravity, temperature and battery, should appear on the device page.
Assign the device to the batch that is fermenting to see the readings on the batch chart.
Troubleshooting#
401: the token is missing or mistyped. Check thetokenquery parameter, or the path segment, and copy the token again from the device page.422:gravityis missing, or it is quoted. Remove the quotes around@gravityin the payload.Readings are refused while the address and token are right: RAPT Pill support is not open yet on Cloud Hosted.
429: readings arrive faster than your plan’s reporting interval and are not stored.
For every status code and what to do about it, see Ingest error codes.