rubenpeters91 / rgb2mqtt

Python script to make OpenRGB lights available in MQTT
MIT License
6 stars 0 forks source link
home-automation mqtt openrgb

RGB2MQTT

PyPI Latest Release GitHub Code style: black Imports: isort

This is a Python script that will act as a brige between an OpenRGB server and an MQTT broker (like Mosquitto). Useful for if you want to control your PC RGB lights via Home Assistant for example.

This script is inspired by the original script from ghomasHudson and the fork from buttercheetah. This script is licensed under the MIT license, so feel free to try or change it yourself!

Installation

Use pip install rgb2mqtt to install the package. If you are running an older Python version (<3.11) you also need to install tomli: pip install tomli

Configuration

Configuration is stored in a config.toml file, see the config.toml.example file.

To generate a configuration file run the rgb2mqtt-config script after installing. To find the location of the saved config file see Logs and config location

Be aware that in the device map section, you need to list the name of the OpenRGB device exactly as key. To figure out which devices are supported by OpenRGB, see the notebooks/tryout_openrgb_sdk.ipynb file.

Logs and config location

The log file and config file will be written to a folder under:

Usage

The run the script, use python src/rgb2mqtt/rgb2mqtt.py, or use rgb2mqtt-run after installing. All logging will be written to the log file, unless you use the verbose option (rgb2mqtt-run -v) in which case the logging is written to stdout.

If you want this script to autostart when your PC turns on (on Windows), use the rgb2mqtt-autostart command.