Skip to main content
Entities are the user-facing values and controls exposed by a device. Use them for sensor readings, relay state, status values, counters, and dashboard commands. [image:device entity list with temperature, relay, status, and command controls]

Define entities

Use an Entity object when you want a typed reference to an entity key.
You can also use string or int keys directly when the sketch is small.

Push state

Use pushEntity() for a single value update. This is useful for sensors, relay feedback, or any state that changes over time.
For multiple values at once, use the batch builder.

Receive commands

Use entity callbacks to receive commands sent from Firmngin to the device. The command includes an entity key and value, so the firmware can route it to the correct GPIO or component.
For multiple entity commands, register one global entity command callback and switch by key.

Request init

Call requestInit() when the firmware needs the latest device configuration after connection or reconnect.

Typed callbacks

The Arduino library supports typed callback objects for common flows. Use the typed objects instead of parsing raw payloads unless you specifically need raw metadata.