# style.tilde.hacking.sensorReading

> Published by [tilde.style](https://lexicon.garden/identity/did:plc:nikxdzksyzpo4sqk3nzlaaxm)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:nikxdzksyzpo4sqk3nzlaaxm/style.tilde.hacking.sensorReading)
- [Documentation](https://lexicon.garden/lexicon/did:plc:nikxdzksyzpo4sqk3nzlaaxm/style.tilde.hacking.sensorReading/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:nikxdzksyzpo4sqk3nzlaaxm/style.tilde.hacking.sensorReading/examples)

## Definitions

### `style.tilde.hacking.sensorReading`

**Type**: `record`

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

**Key**: `tid`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `unit` | `string` | Yes | Unit for value, e.g. 'celsius', 'percent'. |
| `value` | `integer` | Yes | The reading, scaled to an integer by valueScale (AT Protocol records can't hold floats) — real value = value / valueScale. |
| `deviceId` | `string` | No | Free-form identifier for which physical device produced this — e.g. which Raspberry Pi. |
| `createdAt` | `string` (datetime) | Yes | ATProto-compatible UTC timestamp — use nebra.get_atproto_utc_time(). |
| `sensorType` | `string` | Yes | What kind of sensor this reading came from, e.g. 'temperature', 'humidity'. |
| `valueScale` | `integer` | Yes | Divide `value` by this to recover the real-world reading, e.g. value=238, valueScale=10 means 23.8. |

## Raw Schema

```json
{
  "id": "style.tilde.hacking.sensorReading",
  "defs": {
    "main": {
      "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."
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1,
  "_comment": "NSID authority: style.tilde.hacking (same reversed-domain authority as the existing style.tilde.hacking.checkin/connection/toon — already DNS-_lexicon-proven for hacking.tilde.style, no new DNS step needed). Renamed 2026-09-06 from the placeholder `science.iosp.sensor.reading` (authority `science.iosp`/domain `iosp.science` was never decided by the group, never DNS-proven, not ours — confirmed via mcp__atmosphere__get_lexicon_schema returning not_found for lack of any resolvable authority). This is the real namespace the old lexicon's own _comment said to finalize before the actual event. Modeled on tilde.cards' cards.tilde.card.json lexicon template. `value`/`valueScale`: AT Protocol's on-wire record data model has no floating-point type (verified 2026-07-16 against a real PDS — a float `value` gets a 400 from com.atproto.repo.createRecord), so readings are stored as a scaled integer instead; see each field's description."
}
```
