# Read device payload

Normalises the trigger payload into a validated Device reading.

Canonical URL: https://opennodeflow.dev/wiki/reference-app-core-demo-reading/
JSON reference: https://opennodeflow.dev/wiki/reference-app-core-demo-reading/index.json
Source snapshot: 2026-10-23

# Read device payload

Converts an incoming object into the demo Device reading shape and exposes its numeric value separately. It is a normalization example, not a connection to physical equipment or a live monitoring API.

## Sockets and defaults
- **exec** (control): optional execution gate.
- **payload** (object, required): source fields.
- **reading** (Device reading custom type): deviceId, numeric value, unit and a freshly generated ISO timestamp.
- **value** (number): the same normalized measurement magnitude.
- **next** (control): automatic success route. No configuration schema.

deviceId uses String(payload.deviceId || "meter-01"); unit uses String(payload.unit || "kW"). Thus empty/falsy values use those demo fallbacks. value uses Number(payload.value ?? 87.4), preserving a supplied numeric zero. timestamp is execution time; an incoming timestamp is not copied. Unknown payload fields are not included in the reading.

## Example
Input `{"deviceId":"meter-example","value":95,"unit":"kW"}` produces a reading with that identity/value/unit and a current timestamp, plus value 95. Even an empty object creates the demo default reading; do not confuse that fallback with a real acquired measurement.

The selected executor is Instrumented executor, adding timing logs. The body logs measurement, unit and device identity. There is no external fetch, secret read or checkpoint write. Bad numeric conversions fail runtime output validation; this asset has no error control route. Connect value to a threshold Condition and reading to Compose alert, with the desired control route gating the alert. Custom type and executor versions are pinned by definition publication.

## Catalog identity

| Field | Value |
| --- | --- |
| Source key | `app.core.demo.reading` |
| Kind | node |
| Family | app-core |
| Pack | See library discovery |

[Integration guide](/wiki/first-workflow/) · [Browse the catalog](/wiki/integration-catalog/)

## Inputs

| Socket ID | Label | Type | Required | Meaning |
| --- | --- | --- | --- | --- |
| `exec` | Execute | control | No |  |
| `payload` | Payload | object | Yes |  |

## Outputs

| Socket ID | Label | Type | Required | Meaning |
| --- | --- | --- | --- | --- |
| `next` | Next | control | No |  |
| `reading` | Reading | type.device-reading | No |  |
| `value` | Value | number | No |  |

## Configuration schema


```json
{}
```





## Source and installed versions

This reference describes the maintained source catalog snapshot, not a live export of your installation. Published definitions use immutable versions; installed graphs retain their exact pins. Discover and read the installed definition and selected version before wiring it. See [versioning](/wiki/versioning/), [connections](/wiki/connections/) and [integration setup](/wiki/integration-setup/).

---

## Documentation provenance

- `../OpenNodeFlow-Library/work/catalog-all.mjs`
- `../OpenNodeFlow-Library/work/azure-pack-consolidation-20261022/catalog-policy.mjs`
- `../OpenNodeFlow-Library/work/developer-packs-20261022/catalog.mjs`
- `shared/seed.ts`
- `shared/storage-library.ts`
- `shared/variable-library.ts`
- `shared/control-flow.ts`
- `shared/remote-routes.ts`
- `server/runtime-library.ts`
- `shared/error-library.ts`
- `shared/storage-model.ts`
- `shared/builtin-documentation.ts`

This page describes maintained source, not a live inventory or an authorization to perform actions.
