This is my first walkthrough on here so I hope I’m doing it right.
I have linked my desktop RGB (motherboard, CPU cooler, RGB strips, etc) to home assistant so it can be controlled like any other light. I did this using openRGB running as a service on Linux and a python script to link it to MQTT. I used ghomasHudson’s openrgb_to_mqtt, but It didn’t work properly for me so I forked it and added MQTT authentication.
I have a link to a demo in the comments
- Have Linux
- Have RGB
- Have python installed
- Have MQTT already set up on home assistant
Step 1. Install openRGB. Personally, I had issues installing it through apt so i ended up building openRGB through QT Creator. (Guide)
Step 2. Download my script here https://gist.github.com/buttercheetah/6cf0c81a5a45404f00736f4ce52aaf97
Step 2.5 Download requirements
pip install openrgb-python paho-mqtt
Step 3. Edit my script to enter your details. NOTE: make sure to place the script in a permanent location, don’t just throw it in your downloads.
Things to change:
- ENTITY_NAME - This will set the entity in home assistant
- mqtt_user - This will need to be a user on your home assistant installation
- mqtt_pass - This will need to be the associated password with the designated username.
Step 4. Launch them to make sure they work correctly
Step 5. optional - Make the program and script run as a system service.
Personally i use POP os which is based off of Ubuntu. I dont know how to do this on other distributions.
CodeMAKE SURE TO EDIT User, working directory, and execstart to properly reflect your linux user and the path to the sctipt
Description=Open RGB to MQTT (Home assistant bridge)
ExecStart=/usr/bin/python3 /path/to/script/openrgb_to_mqtt.py 192.168.0.123
- paste apt install or built myself
built myselfMAKE SURE TO EDIT execstart to properly reflect the path to the sctipt
- Enable both services so they start at boot
systemctl enable openrgb.service
systemctl enable openrgb-mqtt.service
- Start them
systemctl start openrgb.service
systemctl start openrgb-mqtt.service
- Check them
systemctl status openrgb.service
systemctl status openrgb-mqtt.service