main
Reporting OFF made Adaptive Lighting stop adapting the monitor. The screen never really turns off, so "off" now sets the minimum brightness and the light stays on at brightness 1. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ha-monitor-brightness
Makes the PC monitor's brightness controllable from Home Assistant: the monitor appears as
light.pc_monitor (MQTT discovery) and its brightness is set over DDC/CI.
- Home Assistant 1-255 maps onto monitor brightness
min_level..max_level(default 5-100). - "Off" sets the minimum brightness and the light stays reported as on (1%), so Adaptive Lighting keeps adapting it; the monitor itself stays on.
- Brightness changed with the monitor's own buttons is reported back every
poll_seconds(default 30). - When the PC is off the light shows as unavailable.
Setup
- In Home Assistant create a user for the service (Settings → People → Users → Add user,
e.g.
pc-monitor, "Can only log in from the local network"). The Mosquitto add-on accepts Home Assistant users. - Create the virtual environment and install the dependencies:
py -m venv .venvthen.venv\Scripts\pip install -r requirements.txt - Copy
config.example.jsontoconfig.jsonand put that user's name and password in it.config.jsonis ignored by git, so the credentials stay out of the repo. - Run once to test:
.venv\Scripts\python.exe pc_monitor_mqtt.py(Ctrl+C to stop). - Start it at login (no console window):
start.vbsin the Startup folder or a scheduled task.
The log is written to pc_monitor.log next to the script.
Languages
Python
96.4%
VBScript
3.6%