API and Software

MQTT Topic Design and Telemetry Guide

Design a scalable MQTT topic structure and command flow for NetRelay, Home Assistant, and custom software.

NetRelay Teknik Ekibi1 min readGüncellendi: August 4, 2026

Consistent topic hierarchy

Use a hierarchy that separates site, device, and resource, such as site/device/telemetry and site/device/command. Keep channel identifiers stable and manage user-facing descriptions as metadata rather than changing topic identity.

State and command channels

Separate the command topic from the reported-state topic. After publishing a command, clients should verify the actual value from the state channel. This reduces inconsistency when multiple automation systems control one device.

Retained messages, QoS, and offline state

Use retained messages where new subscribers need the latest known state, but avoid retained commands that could be replayed. Select QoS according to message importance and broker load, and publish online/offline status separately.

Local broker security

Keep the broker on a trusted LAN, assign per-device users and topic permissions, disable anonymous access, and use encrypted transport where available. Include password rotation, connection limits, and log review in the operating plan.

İlgili yazılar

Teknik desteğe mi ihtiyacınız var?

Projeniz için bağlantı, API veya otomasyon yaklaşımını birlikte değerlendirebiliriz.

Bize sorun