# Control Windows Monitor Brightness and Power from Home Assistant over MQTT (DDC/CI)

> nodoff is a free Windows tray app that makes each PC monitor a Home Assistant light over MQTT, with real DDC/CI brightness, sleep and wake, and no admin rights.

Source: https://exitcode0.net/posts/nodoff-windows-monitor-brightness-home-assistant-mqtt/
Author: Tom Cocking (https://tomcocking.com)
Published: 2026-12-01
Updated: 2026-12-01
Tags: home-assistant, mqtt, ddc-ci, windows, monitor-brightness, nodoff, presence-sensor, mosquitto


Home Assistant can dim every lamp in my study, and until recently it couldn't touch the two brightest things in the room. PC monitors don't show up anywhere. Windows has no brightness slider for an external screen, and the usual workarounds either draw a dark overlay on top of the picture or need a hardware smart plug that cuts the power.

So I wrote [nodoff](https://github.com/Tombo1001/nodoff), a small Windows tray app that publishes each monitor to Home Assistant as a `light`. On and off sleep and wake the screen. The brightness slider moves the real backlight. It's free, MIT licensed, and this is the write-up I promised in the [presence sensor post](https://exitcode0.net/posts/home-assistant-presence-sensor-desk-screens/).

**The short version:**

- nodoff talks to monitors over DDC/CI, the control channel already inside your HDMI and DisplayPort cables.
- Each monitor becomes a Home Assistant light through MQTT discovery, with no YAML.
- It's one exe that runs as you, never as admin.
- I've tested it on one PC with two Lenovo L28u-30 monitors. DDC/CI varies between monitors, so test yours before you automate anything.

## What you need

- Windows 10 or 11, 64-bit.
- An external monitor with DDC/CI turned on in its own menu. Laptop screens don't have it.
- Home Assistant with the MQTT integration and a broker. The Mosquitto add-on is the usual one.
- A broker login for nodoff. A dedicated user is tidier, because you can remove it later without touching anything else.

## Install nodoff

1. Download `nodoff-<version>-windows-amd64.zip` from the [latest release](https://github.com/Tombo1001/nodoff/releases/latest) and unzip it anywhere.
2. From a normal PowerShell window, not an admin one, run the installer in that folder:

   ```powershell
   powershell -ExecutionPolicy Bypass -File install.ps1
   ```

3. The settings window opens.

The installer copies `nodoff.exe` to `%LOCALAPPDATA%\Programs\nodoff`, adds a per-user start-at-sign-in entry and a Start menu shortcut. Nothing goes system-wide.

> **Note:** the exe isn't code-signed yet, so SmartScreen may warn the first time. Each release lists SHA-256 checksums. Check yours with `Get-FileHash nodoff.exe -Algorithm SHA256`.

## Connect it to your MQTT broker

On the **MQTT** tab, enter the broker's host name or IP, the port, and the username and password. Set **This PC's name**, which becomes the device name in Home Assistant. Leave discovery on, turn on **Connect to MQTT** and press **Save and connect**.

![nodoff's MQTT tab with the broker set to homeassistant.local on port 1883, a saved password, the PC named Desk PC and Home Assistant discovery switched on](https://exitcode0.net/images/nodoff-windows-monitor-brightness-home-assistant-mqtt-mqtt.jpg)

The password goes into Windows Credential Manager. It's never written to the settings file or the log, and the panel can set or clear it but can't read it back.

The tray icon turns amber when the broker connection is up and stays grey when it isn't.

## Publish your monitors

On **Devices**, press **Discover**. nodoff asks every connected monitor what it supports, which takes a few seconds. For each one you want in Home Assistant, give it a name such as "Left screen" and turn on **Publish to MQTT**.

![nodoff's Devices tab listing two Lenovo L28u-30 monitors, each with a Publish to MQTT toggle, a name box, a brightness slider at 90% and Wake, Sleep and Test sleep and wake buttons](https://exitcode0.net/images/nodoff-windows-monitor-brightness-home-assistant-mqtt-devices.jpg)

Name them before you publish. Home Assistant fixes an entity ID the first time it sees the entity, and `light.desk_pc_left_screen` is nicer to automate than a model number.

Then press **Test sleep and wake** on each monitor. It sends the screen to sleep, waits five seconds and wakes it. Some monitors stop listening on DDC/CI once they're asleep, and you want to find that out while you're sat in front of the power button.

## What appears in Home Assistant

One device named after the PC, under **Settings > Devices & services > MQTT**, with one light per published monitor:

- **On and off** wake the monitor or send it to standby (VCP code `D6`).
- **Brightness** from 0 to 100% sets the backlight (VCP code `10`), the same as pressing the monitor's own buttons.
- **Availability** greys the light out when the PC is off or asleep, nodoff isn't running, or the monitor is unplugged.

That third one deserves a second look before you build automations on it. A light that's `unavailable` can't be turned on, so an automation that fires while the PC is asleep does nothing. The presence post covers [how I handled that](https://exitcode0.net/posts/home-assistant-presence-sensor-desk-screens/).

## Turn the monitors off when you leave the desk

This is the reason nodoff exists. With any presence sensor that gives you a `binary_sensor`:

```yaml
automation:
  - alias: Desk screens follow presence
    triggers:
      - trigger: state
        entity_id: binary_sensor.desk_presence
        to: "on"
      - trigger: state
        entity_id: binary_sensor.desk_presence
        to: "off"
        for: "00:02:00"
    actions:
      - action: "light.turn_{{ trigger.to_state.state }}"
        target:
          entity_id:
            - light.desk_pc_left_screen
            - light.desk_pc_right_screen
```

The two-minute wait on "off" stops the screens going dark when the sensor loses you for a moment. Waking has no wait.

That's the plain version. Mine fades the monitors with a wall screen, a strip light and an [Android photo frame dashboard](https://exitcode0.net/posts/android-photo-frame-home-assistant-dashboard/), saves the levels first and only restores them in waking hours. All of that YAML is in the [presence sensor post](https://exitcode0.net/posts/home-assistant-presence-sensor-desk-screens/).

## Dim the screens after sunset

```yaml
automation:
  - alias: Dim the desk screens after sunset
    triggers:
      - trigger: sun
        event: sunset
    actions:
      - action: light.turn_on
        target:
          entity_id:
            - light.desk_pc_left_screen
            - light.desk_pc_right_screen
        data:
          brightness_pct: 35
```

`light.turn_on` with a brightness also wakes a sleeping monitor. If you only want to dim screens that are already on, add a condition on the light's state.

## A dashboard card

The built-in tile card gives each screen a toggle and a slider:

```yaml
type: tile
entity: light.desk_pc_left_screen
name: Left screen
icon: mdi:monitor
features:
  - type: light-brightness
```

## Using it without Home Assistant

Everything is plain MQTT under a base topic, which defaults to `nodoff/<computer name>`. This is what a subscriber sees:

```text
$ mosquitto_sub -v -t 'nodoff/#'
nodoff/DESK-PC/status online
nodoff/DESK-PC/len65fa_v9k27xqa/available online
nodoff/DESK-PC/len65fa_v9k27xqa/power ON
nodoff/DESK-PC/len65fa_v9k27xqa/brightness 90
```

The ID is built from the monitor's EDID (maker, product code and serial), so it stays the same across reboots and cable swaps, and two identical monitors still get different IDs.

| Topic | Direction | Payload |
|---|---|---|
| `<base>/status` | nodoff publishes, retained | `online` / `offline`, also the last will |
| `<base>/<id>/available` | nodoff publishes, retained | `online` / `offline` |
| `<base>/<id>/power` | nodoff publishes, retained | `ON` / `OFF` |
| `<base>/<id>/power/set` | you publish | `ON` / `OFF` |
| `<base>/<id>/brightness` | nodoff publishes, retained | `0` to `100` |
| `<base>/<id>/brightness/set` | you publish | `0` to `100` |

So Node-RED or a shell script can drive it just as well:

```bash
mosquitto_pub -h homeassistant.local -u nodoff -P 'your-password' \
  -t 'nodoff/DESK-PC/len65fa_v9k27xqa/brightness/set' -m 40
```

## Two extras on the General tab

Both are off by default, and both are new enough that they've had little testing.

- **Lock the PC** a set number of minutes after every screen has gone to sleep. The timer only starts when nodoff itself slept the screens, so pressing a monitor's own power button doesn't count.
- **Double-tap Ctrl to wake the screens**, for when you sit down and the presence sensor hasn't caught up. This installs a low-level keyboard hook, which by its nature sees every key press. nodoff checks whether the key is Ctrl, keeps two timestamps and nothing else, and removes the hook when you turn the setting off.

## Why it doesn't need admin rights

A tool that sits in the tray all day and listens to the network should ask for as little as it can.

- The manifest asks for `asInvoker` and the installer is per-user. nodoff has no service and no elevated parts.
- It loads Windows DLLs from System32 only, so a DLL dropped next to the exe isn't picked up.
- The settings panel listens on a random `127.0.0.1` port, checks the `Host` header and needs a random key that changes on every start.
- It only acts on its own command topics, for monitors you've published, with short payloads in range.
- TLS to the broker uses TLS 1.2 or later and checks the certificate against the ones Windows trusts. Without TLS, the MQTT password crosses your network in the clear, as with any MQTT client.

## What's coming

The next release adds a "desktop" switch per monitor. It takes a screen off the Windows desktop the way **Disconnect this display** does, so a monitor with a second source plugged in can show that for a while, then puts it back on the PC's input. It's working on my desk and not yet published.

## Troubleshooting

Start with the log. The **About** tab has **Show log**, or open `%LOCALAPPDATA%\nodoff\nodoff.log`.

- **No monitors found, or "didn't answer over DDC/CI".** Turn DDC/CI on in the monitor's on-screen menu. Docks, KVM switches and some USB-C or HDMI adaptors drop the channel, so plug the monitor straight into the PC to check. Some TVs ignore DDC/CI altogether.
- **A monitor sleeps but doesn't wake.** Keep **"Off" puts a monitor in** on **Standby**, because fewer monitors wake from power off. Turn off any deep sleep option in the monitor's menu. Try the other cable type if it has both.
- **The light flips back to on a few seconds after you turn it off.** The monitor refused the command or woke again. Try **Power off** instead of **Standby**.
- **The lights are `unavailable`.** Correct when the PC is off or asleep. If the PC is on, a grey tray icon means MQTT is disconnected.
- **MQTT won't connect.** The panel's footer gives the reason. "The broker refused the username or password" means re-enter the password. A self-signed broker certificate needs its CA adding to the Windows certificate store.
- **Left and right are the wrong way round.** nodoff takes them from the layout in **Settings > System > Display**. Fix it there, or type your own names.

## Screens that behave like lights

The monitors on my desk now behave like every other light in the room. They fade when I leave, come back at 90% when I sit down, and the PC has no idea any of it is clever. It's the opposite of the [PowerShell keep-awake script](https://exitcode0.net/posts/prevent-screensavers-and-lock-screens-with-powershell/) I wrote years ago, which existed to stop screens sleeping.

If your monitor does something odd over DDC/CI, [open an issue](https://github.com/Tombo1001/nodoff/issues) with the model. Two Lenovos is a small sample.

## Or just hand this page to your agent

The Windows side is clicks in a settings window, but the Home Assistant side is YAML an agent can write for you.

```text
Read https://exitcode0.net/posts/nodoff-windows-monitor-brightness-home-assistant-mqtt/ and set up nodoff so my Windows PC's monitors appear in Home Assistant as lights. Walk me through the install and the MQTT and Devices tabs one step at a time, because those are clicks I have to do myself. Never ask me to paste my MQTT password into this chat: I'll type it into nodoff. Before you write any automation, ask me for my real entity IDs (the monitor lights and my presence sensor) and how long the room should be empty before the screens sleep. Show me the YAML before you save it, and don't edit my live automations.yaml or reload Home Assistant without asking. Remind me to press "Test sleep and wake" on each monitor before the automation goes live.
```

The page gives the agent the install steps, the topic table and three working automations. Only you know your broker's address, your entity IDs and whether your monitors wake from sleep.

Set the "off" delay to ten seconds for the first evening and walk out of the room a few times, so you see it work before you trust it.

Enjoy. ✌️


---
Markdown version of https://exitcode0.net/posts/nodoff-windows-monitor-brightness-home-assistant-mqtt/ for agents and readers who prefer plain text. The HTML page has the comments, cover image and related posts.
