razer-logo
Advertisement

Lately, the popularity of mechanical keyboards, mice, headsets, and desk pads with RGB lighting has exploded. Razer has been at the forefront of this development with their line-up of mainly gaming peripherals. Things certainly have changed since I was the proud owner of the Razer Copperhead mouse, which was fitted only with single colour LEDs. The American-Singaporean technology company has been adding various LEDs to its products since 2004 and joined the RGB craze just ten years later.

Advertisement
The Razer Firefly V2 mouse mat with RGB illumination provided by Chroma.
The Razer Kraken X USB headset.
The Razer Deathadder V2 Pro mouse with RGB illumination provided by Chroma.

The glue that binds Razer’s RGB-enabled peripherals together is what it describes as the world’s largest lighting ecosystem for gaming devices: Razer Chroma. On a desktop computer, the applications Razer Synapse 3 and Chroma Studio control the individually addressable LEDs in all its products. Thanks to a talented community member, Home Assistant users that also happen to enjoy Razer products, are no longer bound to the desktop.

Table of Contents

How to Chroma integration with Home Assistant works

For the integration to work, developer Yevhenii Vaskivskyi created the Python library AIOChroma. This library, which is already available on PyPI, can be used by anyone wanting to communicate with Chroma devices using one of the world’s most popular programming languages. AIOChroma is described as an “API wrapper for communication with [Chroma] devices”. The custom Home Assistant integration uses this library for exactly that purpose.

Advertisement

Even though using a custom component always carries a certain amount of risk, as it might be abandoned or using a hacky way to access data, this one does things better than many others. On the one hand, the main components of the custom integration are kept separate. This allows those not interested in Home Assistant to contribute to AIOChroma too. On the other hand, were new maintainers ever needed, it would also make finding them a lot easier.

Another thing AIOChroma, and consequently the Chroma integration with Home Assistant does right, is using official means for communication with the hardware. Because there is an official SDK for Chroma available, it can be used without any workarounds. Additionally, and this will please many of you, everything is kept local. In less positive news, this means that Linux users who rely on Polychromatic or OpenRazer won’t be able to use the integration.

Advertisement

Why integrate Razer Chroma and Home Assistant?

Now that you know how Razer Chroma’s integration with Home Assistant works, you might be interested in exactly what it can do. At the time of writing, the integration allows you to control effects, display notifications, and send messages. While the first point on the list might be obvious, the latter two might need some explaining.

YouTube video

The messaging function literally allows you to send messages from Home Assistant to a Razer keyboard with Chroma. Your message will light up individual keys, which ultimately spell what you have sent. The providing service does allow you to customize many parameters, such as the time between symbols, the colour of the highlighted key, the colour of the inactive keys, and how many times the messages should be repeated, if at all. Notifications allow you to grab the Razer user’s attention by highlighting certain keys. This can be useful if you don’t want desktop notifications popping up.

Advertisement

How to integrate Razer Chroma with Home Assistant

As with most custom components for Home Assistant, the Razer Chroma integration is available in the Home Assistant Community Store (HACS). Alternatively, there is the possibility of manually adding the files, though I don’t recommend this as they won’t be automatically updated when a new release is pushed.

Once installed, the integration can be configured through the Home Assistant Dashboard. Before you can do so, you might need to adjust your firewall’s port settings, as described in the repository. Without this adjustment, you could get stuck in an endless loop, while the integration attempts to reach your Razer peripherals.

How you can help the development of this integration

One thing the developer of this custom integration can’t do, is to verify all peripherals that support Chroma. Thus, you potentially can help further the development, without having to know any code. If you do have a mouse, keyboard, headset, or any other peripheral supporting Chroma that isn’t on the list of supported devices, please open an appropriate issue on GitHub.

Advertisement
Advertisement
Liam Alexander Colman, the author and maintainer of Home Assistant Guides.

About Liam Alexander Colman

Liam Alexander Colman has been using Home Assistant for various projects for quite some time. What started off with a Raspberry Pi quickly became three Raspberry Pis and eventually a full-blown server. I now use Unraid as my operating system, and Home Assistant happily runs in a Docker container. My personal setup includes many Zigbee devices as well as integrations with existing products such as my Android TV box. Read on to find out more on how I got started with Home Assistant.

Leave a comment

Advertisement
Share to...