Skip to content
Awawa edited this page Dec 31, 2024 · 24 revisions

1. Installing & configuring Mosquitto and Zigbee2MQTT

Start HyperHDR, select the Adalight LED driver but do not save changes and expand the output port list.
You should find your Zigbee coordinator. Note the path, in this example it is /dev/ttyACM0:

Install necessary components:

sudo apt update && sudo apt install -y curl
sudo curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt install -y mosquitto nodejs git make g++ gcc libsystemd-dev

Caution

You must install our Zigbee2MQTT fork which is optimized for sending frequent color refreshes.
The original Zigbee2MQTT will get clogged with message queue after a few seconds and the lamps will lag so currently it is not suitable for our purposes.

Install our Zigbee2MQTT fork:

sudo mkdir /opt/zigbee2mqtt
sudo chown -R ${USER}: /opt/zigbee2mqtt
git clone --depth 1 https://github.com/awawa-dev/zigbee2mqtt.git /opt/zigbee2mqtt
cd /opt/zigbee2mqtt && npm i --package-lock-only && npm ci && npm run build

Mosquitto configuration example (replace user hyperhdr and password with your choice ⚠️):

echo "allow_anonymous false" | sudo tee /etc/mosquitto/conf.d/default.conf
echo "password_file /etc/mosquitto/passwd" | sudo tee -a /etc/mosquitto/conf.d/default.conf
# this will open mosquitto port for external connections
echo "listener 1883" | sudo tee -a /etc/mosquitto/conf.d/default.conf
echo "hyperhdr:CHANGE_THIS_PASSWORD" | sudo tee /etc/mosquitto/passwd
sudo mosquitto_passwd -U /etc/mosquitto/passwd
sudo systemctl restart mosquitto

Configure Zigbee2MQTT:

cp /opt/zigbee2mqtt/data/configuration.example.yaml /opt/zigbee2mqtt/data/configuration.yaml
nano /opt/zigbee2mqtt/data/configuration.yaml

Set up the MQTT user and password, and also set the serial port you discovered in the first step of the tutorial.
I also added frontend at the end to have access to the Zigbee2MQTT configuration panel via a web browser

# Home Assistant integration (MQTT discovery)
homeassistant: false

# allow new devices to join
permit_join: true

# MQTT settings
mqtt:
  # MQTT base topic for zigbee2mqtt MQTT messages
  base_topic: zigbee2mqtt
  # MQTT server URL
  server: 'mqtt://localhost'
  # MQTT server authentication, uncomment if required:
  user: hyperhdr
  password: CHANGE_THIS_PASSWORD

# Serial settings
serial:
  # Location of CC2531 USB sniffer
  port: /dev/ttyACM0

# Enable Web frontend
frontend: true

Run Zigbee2MQTT, you should have the interface available at port 8080.
Terminate the program later (CTRL - C):

cd /opt/zigbee2mqtt
npm start

If this works, you can create a Zigbee service using this instruction: https://www.zigbee2mqtt.io/guide/installation/01_linux.html#optional-running-as-a-daemon-with-systemctl

Then you can start adding lamps using e.g. the Touchlink function via the Zigbee2MQTT web interface at port 8080. You must put the lamps really close (<10cm) to the USB Zigbee stick. Otherwise Touchlink won't find them.

2. Configuring HyperHDR Zigbee2MQTT driver

Go to the Advanced tab and open the Network Services tab. Configure the MQTT service by entering the previously selected user and password. I entered localhost as the host because HyperHDR and MQTT broker are running on the same unit in this example. For security reasons, you can block access to the HyperHDR API via MQTT if you do not use it.

After saving the MQTT settings, check the HyperHDR logs. It should have a status of: connected, just like in the screenshot

Open the "LED hardware" tab. There, select the Zigbee2MQTT driver and run the wizard. HyperHDR should find the lamps you previously configured in Zigbee2MQTT.

Now select an area on the TV for each lamp. You can click identify if you don't know which lamp has what name. Save the configuration and that's it.