Back to all articles

Build a custom device integration with Kilo's gRPC API

Kilo gRPC API integration guide for 2026: step-by-step prerequisites, auth, device mapping, telemetry, commands and troubleshooting for custom devices.

KIEditorial TeamNov 19, 2026 — 9 min read
Build a custom device integration with Kilo's gRPC API

Building a custom device integration on the Kilo IoT Platform means getting your device's data and commands into Kilo through a typed gRPC contract instead of a one-off script. This guide walks through a Kilo gRPC API integration in 2026: what to prepare, how to structure the connection, and what breaks first.

TL;DR
  • A Kilo gRPC API integration suits devices or middleware that already speak a typed, streaming protocol.
  • Take service names, methods and message fields from Kilo's developer documentation, never from guesses or copied samples.
  • Map device identity, telemetry and commands separately, then verify each end to end in 2026.
  • An accepted command is not proof the device acted; confirm through feedback or a later measurement.

Written by Tim Kravchunovsky

When a gRPC integration is the right choice

gRPC is a remote procedure call framework that runs over HTTP/2 and describes every call in a Protocol Buffers (.proto) file. You generate client code from that file, so your integration gets typed requests and responses instead of hand-parsed JSON. It also supports streaming in both directions, which is useful for continuous telemetry.

That makes it a strong fit when you run a gateway, a middleware service or a device backend written in a language with solid gRPC tooling. It is a poor fit for a battery-powered sensor with a few kilobytes of memory. Those devices usually reach a platform through a radio network or a lightweight messaging protocol, not through a generated client.

ApproachBest forMain trade-off
gRPC clientBackends and gateways with typed contracts and streamingNeeds generated code and HTTP/2 support
MQTTConstrained devices and publish/subscribe flowsPayload structure is yours to define and map
REST-style API callsSimple scripts, occasional reads and writesNo built-in streaming, more parsing code
LoRaWAN or mioty connectorLow-power radio sensorsDepends on the network server and device support

Verdict: pick gRPC when your integration is software you control and you want a strict contract. Pick a connector when your devices are radio sensors that a network server already handles.

What to know before you start

Gate the work before you write code. Four things need to be settled first.

  • Access to a Kilo workspace with permission to create and manage devices. Your integration inherits the permissions of whatever credential it uses, so use one scoped to the job.
  • The current developer documentation for Kilo's API. It is the source of truth for service names, methods, message fields and authentication. Do not reuse a .proto file from a forum post or an older project.
  • A gRPC toolchain for your language, including the protocol buffer compiler and the language plugin that generates client stubs.
  • A written device model: what your device reports, what it can be told to do, and which of those commands a real actuator can carry out.

The gotcha that bites mid-setup is the last one. A platform can queue a command for any device record you define, but only a compatible device with a working command path can act on it. Decide which commands are real before you define them.

If you also need compatible hardware for a test bench, Kilo Electronics at kiloelectronics.com is a separate online authorised dealer for compatible hardware. It is not part of the platform and the integration does not require it.

Set up your gRPC client

The goal of this unit is a client that can authenticate and make one harmless read call.

  1. Download the .proto files published in Kilo's developer documentation and store them in your repository, pinned to the documented version.
  2. Run the protocol buffer compiler with your language plugin to generate client stubs.
  3. Create the credential the documentation describes for API access, and store it in your secrets manager rather than in source code.
  4. Open a TLS-secured channel to the endpoint listed in the documentation and attach the credential the way the documentation specifies, typically as call metadata.
  5. Make a simple read call, such as listing something your credential is allowed to see.

Expected result: the call returns data for your workspace. If it returns UNAUTHENTICATED, the credential is missing or malformed. If it returns PERMISSION_DENIED, the credential is valid but lacks rights for that resource. Both are standard gRPC status codes and they point at different fixes.

Map your device into Kilo

A custom integration fails most often at identity, not transport. Before you send a single reading, settle three mappings.

  • Identity. Choose one stable identifier per physical device, such as a serial number, and use it every time. A changing identifier creates duplicate device records and splits your history.
  • Telemetry. List each measurement your device reports, with its unit and sampling behavior. Keep names consistent, because dashboards, alarms and rules reference them later.
  • Commands. List each action the device can take, the parameters it accepts, and what feedback it returns.

Here is an illustrative scenario with stated assumptions, not a customer deployment. Suppose you run a gateway that reads a pump controller over a local bus. The controller exposes a flow reading and a running state, and accepts a start and stop instruction. You would define a device identified by the controller's serial number, two telemetry fields (flow, running state) and two commands (start, stop). The running state doubles as the feedback signal for the commands.

Create the device record through the documented API call, then confirm it appears in the Kilo application at app.kiloiot.io with the identity you chose.

Send telemetry from your device

This unit gets live readings flowing and visible.

  1. Convert each reading from your device into the message structure the documentation defines, using the field names from the .proto file exactly.
  2. Attach your device identifier and a timestamp from the source, not from the moment you happen to send.
  3. For a steady feed, use a streaming call if the documentation provides one for telemetry. For occasional readings, a unary call is simpler and easier to retry.
  4. Handle the response on every call. Log failures with the gRPC status code so you can tell a bad credential from a temporary outage.

Expected result: the reading shows up on the device record. Build a dashboard widget on it to confirm the value, unit and timing look right, then compare against the number on the device's own display.

Timestamp discipline matters more than most teams expect. If your gateway buffers readings during a network drop and replays them later, stamping them at send time makes old data look current and corrupts every trend.

Receive and confirm commands

Commands run the opposite direction, and they carry the real-world risk. Treat this unit with more care than the telemetry one.

  1. Use the documented mechanism for your integration to receive commands addressed to your device.
  2. Validate every command against your own limits before touching hardware. Your integration is the last check before something physical moves.
  3. Execute the action on the device, then report the result back through the documented path.
  4. Confirm the outcome with feedback from the device or a following measurement, such as the running state changing in the pump example.

Expected result: a command issued from Kilo reaches your service, your device acts, and the running state telemetry confirms it. Accepted, queued or delivered status on its own is not proof of a physical outcome. Only device feedback or a later reading is.

Once commands work, they can also take part in automation. A deliberately configured rule can issue a command without a person in the loop, so test every command path with the same care you would give an unattended action. Debugger Execute runs real operations on supported side-effect nodes, so choose Skip or Mock deliberately when you do not want a live action.

Variant: react to platform events instead of polling

If your goal is to push Kilo data outward rather than pull devices in, the same client works in reverse. Subscribe to or read the data your integration needs, then forward it to your own system. For a lighter option that needs no generated client, the guide on integrating sensor data with your dashboard via API covers the simpler path.

Troubleshooting

  • UNAUTHENTICATED on every call. The credential is missing, expired or sent in the wrong place. Re-check how the documentation attaches it and confirm the channel uses TLS.
  • PERMISSION_DENIED on one resource. The credential is valid but scoped too narrowly. Adjust its permissions rather than switching to a broader credential.
  • DEADLINE_EXCEEDED or UNAVAILABLE. The network dropped or the call timed out. Set an explicit deadline on every call, retry with increasing delays, and make writes safe to repeat.
  • Duplicate devices appear. Your identifier changed between runs. Fix the source of the identifier and merge or remove the duplicates.
  • Generated code stops compiling after an update. The .proto file changed. Pin the version you built against, read the latest changelog entries before upgrading, and regenerate deliberately.

Customize your workflow

A working integration is the base layer, and the platform features sit on top of it. Add dashboards to visualize the new telemetry, alarms to notify the right person when a value leaves its range, and rules to automate responses. Keep threshold alarms honest: they flag a condition, they do not predict failure.

If your devices are low-power radio sensors, you may not need a custom client at all. Kilo connects to LoRaWAN and mioty networks, and the walkthrough on connecting an existing LoRaWAN network server to Kilo covers that route.

FAQ

What is a Kilo gRPC API integration?

It is a custom connection where your software talks to Kilo through a typed gRPC contract. You generate a client from Kilo's published definitions and use it to register devices, send telemetry and handle commands.

Where do I find the exact gRPC service and method names?

Kilo's developer documentation is the source of truth. Take service names, methods and message fields from there, because copied or older definitions can drift from the current API.

Is gRPC better than MQTT for connecting devices to Kilo?

Neither wins outright. gRPC suits backends and gateways that want a strict contract and streaming, while MQTT suits constrained devices and publish/subscribe flows.

Can I send commands to my device through a custom integration?

Yes, if you define the command and your integration can carry it out on real hardware. The platform cannot act on a device that has no compatible command path.

Does a delivered command mean the device acted?

No. Delivered status shows the command reached its destination, not that the physical action happened. Confirm with device feedback or a following measurement.

Do I need to buy hardware to build a custom integration in 2026?

No. You can develop against your own devices or a simulated source. Compatible hardware is available separately through Kilo Electronics if you want a test bench.

One last thing

Write the device model on paper before you generate a single line of client code. Most failed integrations in 2026 are not transport problems; they are identity and command problems that a one-page model would have caught. Decide what each device is called, what it reports, and what it can really do, then let the gRPC contract enforce it.

You might also like