---
title: Manage Zigbee connected devices with Scaleway IoT Hub
description: In this tutorial you will learn how to set up and configure Zigbee2mqtt with Scaleway IoT Hub.
products:
  - iot-hub
tags: iot iot-hub zigbee zigbee2mqtt
dates:
  validation: 2025-07-21
  posted: 2022-12-20
  validation_frequency: 12
difficulty: beginner
usecase:
  - iot
ecosystem:
  - third-party
---
import image from './assets/scaleway-download-hub-certificate.webp'
import image2 from './assets/scaleway-validate-configuration.webp'
import image3 from './assets/scaleway-metrics-observability.webp'


Privacy and security concerns should be at the forefront of any deployment of connected devices used to monitor or automate actions in our physical environment. Zigbee is a recognized protocol to create a mesh network of sensors and actuators in houses and apartments. However, a proprietary gateway is often used to send commands and receive information to and from this network. It results in a trade-off in control over the security level and the automation and monitoring capabilities. This tutorial aims to set the foundation of a fully configurable solution based on the open source [zigbee2mqtt](https://github.com/Koenkk/zigbee2mqtt) software and the IoT Hub managed service from Scaleway.

[Scaleway IoT Hub](/iot-hub/quickstart/) is a resilient and MQTT message broker with export capabilities. The use of a message broker will enable us to increase the interoperability of the solution.

# Creating an IoT Hub

1. Create an **IoT Hub** (shared plan) for testing purposes, following the available [documentation](/iot-hub/quickstart/). Dedicated and High availability plans remain recommended for more critical workloads.
2. Add a new device to the Hub, with the option "Deny insecure connection" selected. You need to download <Icon name="download" /> the device certificate and device private key, as well as <Icon name="copy" /> the **Device ID**.
    <Lightbox src={["scaleway-configure-device.webp","scaleway-retrieve-device-parameters.webp"]} size={"medium"}  alt={["",""]} />
3. Download <Icon name="download" /> the certificate used to secure the MQTT endpoint in the **Networks** tabs.
    <Lightbox image={image} size="medium" alt="" />

# Installation and configuration of Zigbee2mqtt

Zigbee2mqtt can be installed on a single board computer such as a Raspberry Pi and you should follow first the [installation instructions](https://www.zigbee2mqtt.io/guide/getting-started/#installation). This tutorial assumes that you have a proper installation of Zigbee2mqtt and that your network of connected devices is configured.

## Configuration of MQTT

Zigbee2MQTT is configured using YAML based `configuration.yaml` file. Modify this configuration file to include the following MQTT settings.
  <Message type="note">
    The `force_disable_retain` should be set to `true` when using the IoT Hub shared service level because this functionality is unavailable on this plan.
  </Message>
  ```
  # Required: MQTT settings
  mqtt:
    server: mqtts://iot.fr-par.scw.cloud:8883 # mqtts endpoint
    base_topic: zigbee2mqtt
    ca: /etc/ssl/mqtt-ca.crt                  # Certificate Authority
    key: /etc/ssl/mqtt-client.key             # Device private key
    cert: /etc/ssl/mqtt-client.crt            # Device certificate
    client_id: <Device_ID>
    keepalive: 60
    version: 4
    force_disable_retain: true
  ```
  <Message type="note">
    Do not forget to copy and paste the certificates, private key and Device ID from previous step:
      - The `/etc/ssl/mqtt-ca.crt` file is the certificate used to secure the MQTT endpoint
      - The `/etc/ssl/mqtt-client.key` file is the device certificate
      - The `/etc/ssl/mqtt-client.crt` file is the device private key
      - The `<Device_ID>` is the Device ID
  </Message>

As soon as the configuration is done, you will see some metrics on the Scaleway console.
  <Lightbox image={image2} size="medium" alt="" />
Thanks to Scaleway built-in integration, similar metrics to monitor the performance of your IoT Hub are also available on your [Scaleway Observability](/cockpit/) dashboard.
  <Lightbox image={image3} size="medium" alt="" />