style.tilde.hacking.sensorReading

tilde.style

Documentation

A single reading from a live sensor (e.g. temperature, humidity), published via Nebra.

main record

A single reading from a live sensor (e.g. temperature, humidity), published via Nebra.

Record Key tid Timestamp-based ID

Properties

createdAt string datetime Required

ATProto-compatible UTC timestamp — use nebra.get_atproto_utc_time().

deviceId string Optional

Free-form identifier for which physical device produced this — e.g. which Raspberry Pi.

maxLength: 128 bytes
sensorType string Required

What kind of sensor this reading came from, e.g. 'temperature', 'humidity'.

maxLength: 64 bytes
unit string Required

Unit for value, e.g. 'celsius', 'percent'.

maxLength: 32 bytes
value integer Required

The reading, scaled to an integer by valueScale (AT Protocol records can't hold floats) — real value = value / valueScale.

valueScale integer Required

Divide `value` by this to recover the real-world reading, e.g. value=238, valueScale=10 means 23.8.

View raw schema
{
  "key": "tid",
  "type": "record",
  "record": {
    "type": "object",
    "required": [
      "sensorType",
      "value",
      "valueScale",
      "unit",
      "createdAt"
    ],
    "properties": {
      "unit": {
        "type": "string",
        "maxLength": 32,
        "description": "Unit for value, e.g. 'celsius', 'percent'."
      },
      "value": {
        "type": "integer",
        "description": "The reading, scaled to an integer by valueScale (AT Protocol records can't hold floats) — real value = value / valueScale."
      },
      "deviceId": {
        "type": "string",
        "maxLength": 128,
        "description": "Free-form identifier for which physical device produced this — e.g. which Raspberry Pi."
      },
      "createdAt": {
        "type": "string",
        "format": "datetime",
        "description": "ATProto-compatible UTC timestamp — use nebra.get_atproto_utc_time()."
      },
      "sensorType": {
        "type": "string",
        "maxLength": 64,
        "description": "What kind of sensor this reading came from, e.g. 'temperature', 'humidity'."
      },
      "valueScale": {
        "type": "integer",
        "description": "Divide `value` by this to recover the real-world reading, e.g. value=238, valueScale=10 means 23.8."
      }
    }
  },
  "description": "A single reading from a live sensor (e.g. temperature, humidity), published via Nebra."
}

Lexicon Garden

@