Skip to main content
Version: Next

MQTT data streaming for HVAC control

note

You are currently looking at a work in progress version of the Relynk API documentation. Consider the underlying APIs and messaging formats as stable, but we strive to make the documentation as developer friendly as possible. If you feel anything is missing please reach out to hello@relynk.io, any feedback would be much appreciated.

Implementing Edge Messages with MQTT

This page provides a detailed guide on how to implement the Real Estate Core (RealEstateCore) Edge Message format using MQTT for real-time messaging between systems.

caution

Prerequisites

This guide assumes you are familiar with the Real Estate Core Edge Message format and MQTT. If you are not, please refer to the following documentation: Real Estate Core Edge Messaging Format and MQTT Essentials.

MQTT Version and Authentication

  • MQTT Version: We support MQTT versions 3.1.1 and 5. This guide assumes familiarity with the basic concepts and operation of MQTT.
  • Authentication: Authentication is performed using X.509 certificate authentication. Clients will receive the necessary certificates and keys from us, ensuring secure communication between devices and the MQTT broker.
  • Device ID: Each client is assigned a unique device ID, which is used to identify the client and its messages on the MQTT broker. Only the allowed observations and actuations for the device are sent to the client. This will be provided together with the certificates and keys.

Broker URL and Port

Connect to our MQTT broker using the following URL and port:

  • URL: mqtt://mqtt-streaming.relynk.io
  • Port: 8883

Ensure that your MQTT client is configured to use SSL/TLS with the provided X.509 certificates for secure communication.

MQTT Topics

Our MQTT implementation uses specific topics for subscribing and publishing messages:

  • Subscribe to: devices/{device-id}/messages/events/ for receiving Observations, Actuation Responses, and Exceptions.
  • Publish to: devices/{device-id}/messages/devicebound for sending Actuation Commands.

Refer to the Real Estate Core Edge Message format documentation for detailed information on the structure and content of messages on these topics.

Integration with Relynk

We suggest not to worry about the API integration details to fetch the available points and their metadata. Relynk will provide a CSV file including all available points (sensors and actuators) that can be utilized with the connection. This streamlines the process of integrating your systems with our MQTT streams.

End-to-End Example

Consider an optimization platform that subscribes to our MQTT streams to receive Observations. Upon receiving data, it runs its algorithms to determine necessary actuations and publishes these Actuation Commands back. Here's a simplified end-to-end example:

Subscribing to Observations

Subscribe to the devices/{device-id}/messages/events/ topic to receive Observations and other messages. Your client should handle incoming messages according to their type and payload, as specified in the Edge Message format documentation.

Publishing Actuation Commands

After processing Observations, publish Actuation Commands to the devices/{device-id}/messages/devicebound topic. Ensure that your messages conform to the Edge Message format, specifying the appropriate actuator ID and desired action.

Receiving Actuation Responses

Continue subscribing to the devices/{device-id}/messages/events/ topic to receive Actuation Responses. These messages indicate whether the actuations have been successfully received and executed by the end-system, helping you confirm the outcome of your commands.