RipeWise Ripening Data Specification
Version 1.0 · Last updated 2026-11-24
The chapter Room status is a draft: it is in production use but not yet final, and can still change within version 1.
A Publisher — your site gateway, SCADA server or cloud bridge — connects to the RipeWise broker with a client certificate and publishes one JSON message per sensor reading. It also reports the status of its rooms. Every imperative sentence in this document is a requirement. Everything on the wire is in these canonical, English terms; your controller’s own tag names never appear on it.
Contents
This specification is one document in several files:
- Connecting, onboarding, renewal and access
- Measurements
- Room status
What does not exist yet
Assume nothing beyond the topics above exists.
- No reject feedback. A rejected measurement is reported to no one over MQTT; a lost time reference or a sensor gone silent neither.
- No per-sensor metadata. Beyond the quantity and
unit its name implies (see Sensor names),
nothing declares a sensor’s cadence, or whether its
tsis exact or approximated. - No setpoint topic.
- No sandbox broker, no payload validator.
Versions
Versions are MAJOR.MINOR. A minor version only adds — optional
fields, new topics — and asks nothing of an existing Publisher. A major
version is a new topic root, gateway/v2/..., run beside the
old one so a tenant migrates room by room. Nothing breaks within a major
version, except in a chapter that says it is a
draft.
The gateway/ root also carries RipeWise topics that a
Publisher never uses; use only the topics under Access. provisioning/ and
renewal/ carry only the exchanges under Onboarding and Renewal.
Connecting, onboarding, renewal and access
Connecting
| Broker | mqtt.ripewise.app, port 443, TLS only. TLS 1.2 and 1.3
are accepted; use 1.3, and do not depend on 1.2 staying available. |
| Protocol | MQTT 3.1.1 or 5.0. Nothing here needs a 5.0-only feature, but use 5.0 where you can: only 5.0 tells you when a publish is refused (see Access). |
| Authentication | Your client certificate, obtained under Onboarding. Send no username or password. |
| Client Identifier | Globally unique. Use your publisher_id — the
certificate’s CN — optionally with a suffix. |
| Session | Clean Session true. On MQTT 5.0: Clean Start 1 and Session Expiry Interval 0. |
| Keep Alive | 60 s recommended, 300 s maximum. |
| Reconnect | Exponential backoff with jitter, 1 s to 60 s. Never a tight loop. |
Verify the broker. Its certificate must chain to the RipeWise CA bundle and its subjectAltName must match the host you connected to. Abort on any failure, and offer no setting that turns verification off. Do not pin the broker’s leaf or intermediate certificate. If you pin the CA, accept a bundle holding more than one CA: RipeWise adds a successor CA at least 90 days before issuing from it, so refresh your copy of the bundle at least every 30 days.
Take the CA bundle from the credential bundle, or ask your RipeWise contact for the current one. Never transcribe it from a document.
Guard the key. Keep the private key readable only by
the publishing process, and never copy it off the Publisher. Never share
a key between two Publishers: two connections need two keys and two
publisher_ids. Report a suspected compromise to your
RipeWise contact at once; RipeWise then withdraws your access and
onboards you again under a new publisher_id.
When access ends. An expired certificate fails the TLS handshake: back off and alert an operator rather than treating it as a network fault. A certificate whose access RipeWise has withdrawn still connects, but everything it does is refused, as described under Access.
Onboarding
RipeWise gives each tenant — one customer organisation — a
tenant_id as part of onboarding. It is an RFC 1123 label,
fixed for as long as the tenant exists, and it is the
{tenant_id} in every topic and identifier below; never
choose or change it yourself.
Your publisher_id is
{tenant_id}.{publisher}: your tenant_id, a
dot, and a name RipeWise assigns to this Publisher — usually its site,
such as {tenant_id}.rotterdam-1. The name is an RFC 1123
label of at most 27 characters, so the CN fits X.509’s 64.
Generate your own key. Create an EC P-256 key on the Publisher and a PKCS#10 certificate signing request (CSR) from it, with the identity it is for as its CN:
openssl req -new -newkey ec -pkeyopt ec_paramgen_curve:P-256 -nodes \
-keyout publisher.key -out publisher.csr -subj "/CN={publisher_id}"
The certificate carries the CN of your CSR. RipeWise signs only an EC
P-256 key, in a CSR of at most 8 KB; anything else is
denied.
Send the CSR, never the key, by one of these routes:
- By hand. Use as CN the
publisher_idyour RipeWise contact gives you, orbootstrap.{tenant_id}for a bootstrap certificate, and send the CSR to your contact. RipeWise returns the certificate and the PEM CA bundle. - Over MQTT. RipeWise gives your organisation a
bootstrap certificate with CN
bootstrap.{tenant_id}. A Publisher without a certificate does not know itspublisher_idyet, so its first CSR has CNpending(-subj "/CN=pending"). It connects with the bootstrap certificate, publishes the CSR toprovisioning/bootstrap.{tenant_id}/{temp_id}/request, then waits on…/{temp_id}/response.temp_idis your own unique label for this request, 1 to 63 lowercase letters, digits and hyphens; tell it to your RipeWise contact, who approves each request by hand. The bootstrap certificate can do nothing else.
provisioning/bootstrap.{tenant_id}/{temp_id}/request Publisher → RipeWise · QoS 1 · not retained
{"temp_id": "rotterdam-gw-2", "label": "Rotterdam, cell block B",
"csr_pem": "-----BEGIN CERTIFICATE REQUEST-----\n…", "nonce": "q7Xn…",
"requested_at": 1790251200000}
provisioning/bootstrap.{tenant_id}/{temp_id}/response RipeWise → Publisher · QoS 1 · not retained
{"status": "approved", "publisher_id": "{tenant_id}.rotterdam-1",
"certificate_pem": "-----BEGIN CERTIFICATE-----\n…", "ca_chain_pem": "…",
"expires_at": 1798027200000, "nonce": "q7Xn…"}
nonce is 24 random bytes, base64url-encoded; ignore any
response whose nonce is not yours. status is
pending (keep waiting; it may come more than once),
assigned, approved or denied
(with a reason; stop and alert an operator). Without an
answer within 10 minutes, start over with a new nonce after
60 s. Once approved, disconnect and reconnect with your own
certificate.
assigned comes once an operator approves your request,
and carries your publisher_id:
{"status": "assigned", "publisher_id": "{tenant_id}.rotterdam-1", "nonce": "q7Xn…"}
Generate a new key and a CSR with that publisher_id as
CN, and publish it to the same …/{temp_id}/request with a
new nonce. It is signed without a second approval and
answered approved; a CSR with any other CN is answered
assigned again.
A tenant has at most 50 open onboarding requests; one more is
denied. A request expires 7 days after it was last sent,
without a message. Retrying keeps it open, so only an abandoned request
expires; a later request on the same temp_id is a new one
and needs approval again.
Only if your Publisher cannot generate a key — some controllers can only import one — RipeWise can deliver a passphrase-protected PKCS#12 bundle instead. RipeWise does not keep the key it generated. Import the bundle, then delete the delivered file and every copy of it.
Renewal
| Renewed | Validity | |
|---|---|---|
| Automatically, over MQTT | 90 days | Request a new certificate from day 60. |
| By hand | 365 days | RipeWise reminds you 30, 14 and 7 days before expiry; send a new CSR by hand. |
Tell RipeWise at onboarding which applies. Each renewal uses a new
key, other than your current certificate’s: generate a key and CSR as
under Onboarding, with your
publisher_id as CN, and keep the old certificate in use
until the new one arrives. The publisher_id stays the same,
so nothing else changes.
renewal/{publisher_id}/request Publisher → RipeWise · QoS 1 · not retained
{"csr_pem": "-----BEGIN CERTIFICATE REQUEST-----\n…", "nonce": "Zt3p…"}
renewal/{publisher_id}/response RipeWise → Publisher · QoS 1 · not retained
{"status": "approved", "certificate_pem": "…", "ca_chain_pem": "…",
"expires_at": 1798027200000, "nonce": "Zt3p…"}
Subscribe to the response topic before publishing the request.
nonce and status work as in onboarding,
without pending and assigned; a CSR whose CN
is not your publisher_id is denied. Without an
answer within 10 minutes, retry hourly with the same CSR; retrying it is
always safe. If its key was signed already, the same certificate is sent
again, approved. RipeWise signs at most one renewal per
hour: a CSR with yet another key within the hour gets no answer, and
your hourly retry picks it up. A Publisher whose certificate expires
before renewing must be onboarded again.
Access
The broker grants a Publisher exactly this, for
{tenant_id} its own tenant from its
publisher_id:
| Topics | |
|---|---|
| Publish | gateway/v1/{tenant_id}/+/+/measurement, …/+/status, and
renewal/{publisher_id}/request |
| Subscribe | gateway/v1/{tenant_id}/+/status/refresh and
renewal/{publisher_id}/response |
Everything else is refused, and how you learn of it depends on the protocol:
| Refused | MQTT 3.1.1 | MQTT 5.0 |
|---|---|---|
| Publish | PUBACK as usual; the message is silently discarded | PUBACK reason 0x87 (Not authorized) |
| Subscribe | SUBACK return code 0x80 (Failure) | SUBACK reason 0x87 (Not authorized) |
Check your subscription. After each connect,
subscribe to your renewal/{publisher_id}/response and
inspect the SUBACK. A refusal means your certificate, your tenant or
your access is wrong: alert an operator, because on MQTT 3.1.1 your
measurements are being discarded without notice too.
Measurements
Publishing
gateway/v1/{tenant_id}/{room}/{sensor}/measurement QoS 1 · not retained
{"value": 23.5, "ts": 1789992000000}
This is the only measurement topic. A room is one ripening cell; a
sensor is one instrument or one input/output channel of the room’s
controller, reporting one quantity. Digital inputs and outputs (a door
signal, a valve) are sensors that report 0 or
1. tenant_id is the one RipeWise gave you at
onboarding. tenant_id and
room are RFC 1123 labels — 1 to 63 lowercase letters,
digits and hyphens, starting and ending with a letter or digit.
sensor follows the same rule but may also contain
underscores, so it can carry the names under Sensor names:
tenant_id, room: ^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$
sensor: ^[a-z0-9](?:[a-z0-9_-]{0,61}[a-z0-9])?$
Identifiers are permanent: never reassign a sensor to
different hardware, because history is keyed on it. A room
is unique across your tenant, not just your Publisher: two sites never
share a room name, or their readings overwrite each other. Three names
are reserved:
cmdastenant_id.recipeassensor.publisherasroom: reserved for future publisher-level topics.
Any other name that satisfies the patterns is free to use.
The payload is one strict JSON object: UTF-8 with no byte-order mark, no comments, no trailing commas, no duplicate keys, at most 256 KiB.
| Field | |
|---|---|
value |
The reading, as a finite JSON number. 23 and
23.0 are the same reading. |
ts |
When the reading was taken — not when it was published — as Unix
epoch milliseconds in a JSON integer: -?(0\|[1-9][0-9]*),
no fraction, no exponent, not a string. It must lie within 7 days before
to 5 minutes after the moment RipeWise receives it. |
Any other field is ignored and not stored. Stay under 100 messages per second per connection.
- No reading, no message. When a sensor has no valid numeric value, publish nothing. A consumer never treats an older measurement as current.
- Measurements only. Publish every input and output
channel as a sensor; controller alarms are also
listed in the room
status. There is no topic for events. - Steady cadence. Publish each sensor at a regular interval.
- A synchronised clock. Sync to NTP, PTP or equivalent. Stay within 1 s of UTC and never more than 60 s off, and keep publishing while unsynchronised. When the exact acquisition instant is unknowable — a SCADA tag cache, a change-of-value report with no time of its own — send your best approximation.
- Buffer through outages. The session is not persistent, so the broker retransmits nothing for you. Keep every message until its PUBACK arrives, buffer for up to 7 days while disconnected, and flush oldest first on reconnection. Drop any message over 256 KiB; it is refused every time.
- Duplicates are harmless, conflicts are not. QoS 1
is at-least-once. A measurement is identified by
(
tenant_id,room,sensor,ts). Resending one is fine; publishing two different values under one key is not. Consumers order byts, never by arrival.
Sensor names
Name every sensor after what it measures, in English:
- a measured value is
<quantity>_<n>, numbered from 1 per room:temperature_1,co2_1,humidity_2; - a setpoint is
<quantity>_setpoint, never numbered:c2h4_setpoint; - gases use their chemical formula (
co2,o2,c2h4); everything else is written out (temperature,humidity); - an alarm the controller exposes as a channel is
alarm_<condition>,0or1; - the door is always
door_open,0or1.
The unit is fixed by the name; nothing in the message carries it.
| Sensor | Value |
|---|---|
temperature_<n>,
temperature_setpoint |
°C |
humidity_<n>, humidity_setpoint |
%RH |
co2_<n>, co2_setpoint |
% (0.42 is 0.42 %, i.e. 4200 ppm) |
o2_<n>, o2_setpoint |
% |
c2h4_<n>, c2h4_setpoint |
ppm |
door_open |
0 closed, 1 open |
alarm_control_sensor_fail |
0/1: a control sensor has failed |
alarm_temperature_min,
alarm_temperature_max |
0/1: temperature below / above its
absolute limit |
alarm_temperature_relative_min,
alarm_temperature_relative_max |
0/1: temperature below / above its limit
relative to the setpoint |
CO2 is in percent, not ppm: a CO2 reading sent in ppm is stored 10 000 times too high, and nothing in the contract can catch it.
What RipeWise does with it
Every message is checked in the order below, and the first failing check names the reject reason. A rejected message is kept for RipeWise’s own tooling and never reported back over MQTT: ask your RipeWise contact for your rejects.
| Reason | |
|---|---|
bad_topic |
Not six levels of
gateway/v1/{tenant_id}/{room}/{sensor}/measurement. |
bad_tenant_id, bad_room_id,
bad_sensor_id |
That segment does not match its pattern under Publishing. |
payload_too_large |
Over 256 KiB. The broker normally discards these before RipeWise sees them: silently on MQTT 3.1.1, with PUBACK reason 0x95 on 5.0. |
bad_json |
Not strict JSON, or not an object. |
bad_value |
value missing, not a number, or not finite. |
missing_ts, bad_ts |
ts missing, or not an int64 JSON integer. |
ts_out_of_range |
ts outside the window of 7 days back to 5 minutes
forward. |
RipeWise records its own receive time beside every accepted
ts, and collapses duplicates in storage.
Room status
Status: Draft. This chapter is in production use but not yet final: it can still change within version 1.
The topics below sit beside measurement under the same
tenant and use the same identifiers. Every timestamp in this document —
ts, issued_at — is Unix epoch milliseconds in
a JSON integer, exactly like a measurement’s ts, and every
duration — fields ending in _ms — is milliseconds in a JSON
integer, so a duration adds directly to a timestamp.
gateway/v1/{tenant_id}/{room}/status QoS 1 · retained
{"name": "001", "status": "ONLINE", "ts": 1790251200000, "mode": "ripening",
"fruit": "banana", "recipe_name": "5 Day", "phase": 2, "phase_name": "Ripening",
"progress_pct": 57, "started_at": 1789992000000, "ends_at": 1790596800000,
"alarms": ["FanTripped"]}
status says whether you can reach the room’s controller and, while you can, what the room is doing.
statusisONLINEorOFFLINE;nameis the room id;reasonis free text, set whenOFFLINE. The remaining fields are present only whileONLINE:Field tsWhen the controller was read, epoch ms. modeoff,ripening(running phases),storage(holding one climate),pausedoremergency_stop.fruit,recipe_nameThe fruit in the room and the name of the recipe it runs. phase,phase_nameThe running phase’s number and the controller’s own name for it (keep that name as the controller spells it). Omitted when modeisoff.progress_pctProgress of the whole recipe, %. phase_progress_pctProgress of the running phase, % of its duration. Omitted when unknown. started_at,ends_atStart and planned end of the recipe, epoch ms. A storage recipe has no ends_at.program_finishedtrueonce a ripening recipe has run all its phases (progress 100 % orends_atpassed). The room keeps holding the last phase’s end temperature until it is stopped, somodestaysripening. Omitted when false.alarmsActive alarms, by the controller’s own alarm names. low_o2_lamptruewhile the room’s low-oxygen warning is lit. Omitted when unknown.n2_activetruewhile nitrogen injection is on for what the room runs now: the running phase, or the storage climate.falsewhile the room isoff,pausedor inemergency_stop. Omitted when unknown.A field that is unknown or zero is omitted, except where the table says otherwise. Publish whenever any field other than
tschanges, once after each connect, and at least once a minute with a freshts, so the age of the retained status tells how current it is. Always retained, so a late subscriber sees the current state.
RipeWise stores the latest status per room and the
latest value per sensor, and serves them to its own clients. None of
them is acknowledged.
Refresh
gateway/v1/{tenant_id}/{room}/status/refresh RipeWise → Publisher · QoS 0 · not retained
{"request_id": "9b2c…", "issued_at": 1790251200000}
RipeWise asks for a fresh status while someone has the
room on screen, at most once per room every 5 seconds. Answering is
recommended, not required; subscribe to
gateway/v1/{tenant_id}/+/status/refresh if you do. To
answer, read the room now and publish its status, even when
nothing changed. Both fields are optional, and an empty payload is a
valid request. Ignore a request whose issued_at is more
than 30 seconds old, and one for a room you do not serve. Read a room’s
controller at most once every 5 seconds, however many requests
arrive.
RipeWise waits up to 2 seconds for a status whose
ts is at least the request’s issued_at;
without one, it shows the retained status as it is.