Hi everyone! ![]()
I’m sharing a new external integration that I just published: Plex, to connect your Plex server to Gladys. If, like me, you have a NAS running Plex and you’ve been dreaming of connecting your playbacks to your automations, here it is! ![]()
What it does
A « server » device with monitoring sensors:
number of active streams and sessions in transcoding
streaming bandwidth (kbps)
a « now playing » text that summarizes who is watching what
a counter per library: movies, series (+ episodes), music (+ tracks) — can be disabled if you don’t want them
A device per Plex player (TV app, phone, etc.):
the controls: play, pause, stop, previous, next, fast forward/rewind, volume, mute
the playback state, compatible with the Music widget on the dashboard
the current title (Series S01E02 - Episode,Artist - Title,Movie (year)) and the remaining time
my favorites: two binary sensors « in the intro » and « in the closing credits », based on the markers detected by Plex!
This last point opens up nice scenarios:
When the credits start in the living room → turn on the lights
When a playback starts after 10 p.m. → dim to 20 %
A « general pause » button at mealtime
The states update in a few seconds: the integration listens to the Plex server’s real-time stream (WebSocket), with a configurable fallback polling. Players are automatically discovered — even on the fly as soon as a device starts a playback.
Installation
- In Gladys: Integrations → Multimedia category → Plex (while the store indexer passes, you can also install via the repository URL)
- Enter the URL of your server (
http://nas-ip:32400) and your X-Plex-Token (how to find it) - « Test connection » button, then Discovery tab → add your devices, that’s all

A small but important detail: to control a phone/tablet, remember to enable « Announce as a player » in the relevant Plex app. Without this, only the Stop button works (it cuts the session on the server side).
Under the hood
- Based on the official template and the JS SDK for external integrations
- Everything goes through the local API of the Plex server (no cloud, your token stays with you)
- Source code, FR/EN documentation, and tests: GitHub - guim31/gladys-plex · GitHub
This is a v1.0.0: tested at my place (NAS + SHIELD + mobiles), but I count on you to push it to its limits
Feedback, ideas, and PRs are welcome — tell me what you’re missing (launching a specific media? additional sensors?).
Happy reading… of movies! ![]()
