Home Assistant compatible program to control PC monitors via MQTT.
- Control laptop built-in screen brightness (via Windows API, using
screen-brightness-controllibrary) - Control external monitors brightness, contrast and input source (via DDC/CI, using
monitorcontrollibrary) - Multiple monitor support
- Home Assistant compatible MQTT discovery
- Windows 10 or later (older versions may work but are not tested)
- Python (tested on 3.14, but some older versions should work)
- Git (optional, for cloning the repository)
- MQTT broker
- Home Assistant with Mosquitto broker app and MQTT integration
- or something simpler like Eclipse Mosquitto
- Clone the repository or download the source code.
git clone https://github.com/bartekl1/monitor-control-mqtt.git
cd monitor-control-mqtt- Install PIP dependencies.
pip install -r requirements.txt- Create configuration file
config.yaml.
Minimal example:
mqtt:
host: 192.168.1.123
username: user
password: passSee config.template.yaml for all available options.
- Run the script.
python main.py- (Optional) Configure script to run on startup. For example, you can use
HKCU\Software\Microsoft\Windows\CurrentVersion\Runregistry key or Task Scheduler.