- License the project under GPL-3.0-or-later (LICENSE + SPDX headers). - CI workflow builds every push and pull request and checks manifest.json. - Release workflow: an annotated v* tag builds that version, creates a Gitea release with the zip attached and adds it to manifest.json. - Release zips now live in Gitea releases instead of dist/; build.sh is a local test build only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Lights Off Timer — Jellyfin sleep timer that turns off your Home Assistant lights
A Jellyfin plugin that adds a sleep-timer button next to the volume control in the web player. Pick End of this episode/movie (the default) or a number of minutes; when playback stops, the plugin tells Home Assistant, which turns the lights off after a cooldown (15 minutes by default). Starting playback again cancels the countdown.
- End of this episode/movie — when the item finishes, the next autoplayed episode is stopped.
- 15 / 30 / 45 / 60 / 90 minutes (configurable) — playback is stopped when the time is up.
- Lights off — on that stop (or when you stop playback yourself while the timer is on), Home Assistant starts its countdown and turns the lights off when it runs out.
Built for Jellyfin 12.2 (targetAbi 12.2.0.0).
Install
- In Jellyfin: Dashboard → Plugins → Repositories → +
- Name:
Lights Off Timer - URL:
https://git.piskot.si/nikrozman/jellyfin-lights-out-ha/raw/branch/master/manifest.json
- Name:
- Catalog → Lights Off Timer → Install, then restart Jellyfin.
- Plugins → Lights Off Timer → Settings:
- Home Assistant webhook URL —
https://<your-home-assistant>/api/webhook/<webhook id> - Lights off after (minutes) — the cooldown, default 15
- Timer presets — minutes shown in the menu, default
15,30,45,60,90 - Start the countdown on every playback stop — off by default (only when the sleep timer was on)
- Home Assistant webhook URL —
- Reload the Jellyfin web page. The moon button appears next to the volume slider while a video plays.
Home Assistant
Copy home-assistant/jellyfin_lights.yaml into a package,
set a long random webhook_id, reload Timers and Automations, and put the matching URL in the plugin settings.
It creates timer.movie_lights_off, which you can show on a dashboard.
The plugin sends:
| When | Payload |
|---|---|
| Playback starts (any item) | {"event": "started"} |
| Playback stops with the sleep timer on (or every stop, if enabled) | {"event": "stopped", "cooldown_minutes": 15, "user": "…", "device": "…", "item": "…"} |
The webhook id is the only secret: anyone who knows it can trigger the automation.
Limitations
- The button only exists in Jellyfin Web (browser and Jellyfin Media Player). Native apps (Swiftfin, Android TV, Apple TV…) can't be extended by plugins.
- Stopping playback uses Jellyfin's remote-control command, so the client must support remote control (Jellyfin Web does).
- Timers live in memory: restarting Jellyfin clears them.
How it works
TimerManagerkeeps a timer per playback session and listens to Jellyfin'sPlaybackStart/PlaybackStoppedevents. It stops playback withSendPlaystateCommand(Stop)and posts to the webhook.ScriptInjectionadds<script src="../LightsOffTimer/client.js">to/web/index.htmlas it is served (nothing in the web client folder is modified).Web/client.jsadds the button and menu to the player and talks to the plugin API with the logged-in user's token:GET /LightsOffTimer/State— timer for the caller's own sessionPOST /LightsOffTimer/Set—{"mode": "end" | "minutes" | "off", "minutes": 30}
- A
client.jsplaced in the plugin's data folder overrides the built-in one, for styling tweaks without rebuilding.
Build / release
Every push and pull request is built by the CI workflow.
To release, push an annotated tag; its message becomes the release notes:
git tag -a v1.0.3.0 -m "What changed"
git push origin v1.0.3.0
The release workflow builds that version against the
Jellyfin.Controller 12.2.0 NuGet package, creates a release
with lightsofftimer_<version>.zip attached, and adds the version (download URL + MD5) to manifest.json,
so every Jellyfin server using the repository is offered the update.
Local test build (needs only Docker): ./build.sh → out/lightsofftimer_dev.zip.
For another Jellyfin version, change the package versions in the .csproj and TARGET_ABI in the release workflow.
License
Copyright © 2026 Nik Rozman and contributors.
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. See LICENSE.
Contributions are welcome under the same license.