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, 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.

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 and unzip it anywhere.

  2. From a normal PowerShell window, not an admin one, run the installer in that folder:

    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

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

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.

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:

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, saves the levels first and only restores them in waking hours. All of that YAML is in the presence sensor post.

Dim the screens after sunset

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:

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:

$ 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.

TopicDirectionPayload
<base>/statusnodoff publishes, retainedonline / offline, also the last will
<base>/<id>/availablenodoff publishes, retainedonline / offline
<base>/<id>/powernodoff publishes, retainedON / OFF
<base>/<id>/power/setyou publishON / OFF
<base>/<id>/brightnessnodoff publishes, retained0 to 100
<base>/<id>/brightness/setyou publish0 to 100

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

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 I wrote years ago, which existed to stop screens sleeping.

If your monitor does something odd over DDC/CI, open an issue 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.

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. ✌️