{"id":13583505,"url":"https://github.com/mpbzh/homebridge-plex","last_synced_at":"2025-10-27T09:31:27.342Z","repository":{"id":27338530,"uuid":"113450492","full_name":"mpbzh/homebridge-plex","owner":"mpbzh","description":"Plex plugin for homebridge: https://github.com/nfarina/homebridge","archived":false,"fork":false,"pushed_at":"2022-12-07T17:37:32.000Z","size":497,"stargazers_count":59,"open_issues_count":7,"forks_count":6,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-02-04T06:38:22.684Z","etag":null,"topics":["home-automation","homebridge","homebridge-plugin"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mpbzh.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-12-07T12:51:31.000Z","updated_at":"2024-11-21T04:24:18.000Z","dependencies_parsed_at":"2023-01-14T06:31:37.410Z","dependency_job_id":null,"html_url":"https://github.com/mpbzh/homebridge-plex","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpbzh%2Fhomebridge-plex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpbzh%2Fhomebridge-plex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpbzh%2Fhomebridge-plex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpbzh%2Fhomebridge-plex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mpbzh","download_url":"https://codeload.github.com/mpbzh/homebridge-plex/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238472012,"owners_count":19478144,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["home-automation","homebridge","homebridge-plugin"],"created_at":"2024-08-01T15:03:31.658Z","updated_at":"2025-10-27T09:31:26.945Z","avatar_url":"https://github.com/mpbzh.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# Plex Plugin for Homebridge\n[![npm](https://img.shields.io/npm/v/homebridge-plex.svg)](https://www.npmjs.com/package/homebridge-plex)\n[![npm](https://img.shields.io/npm/dt/homebridge-plex.svg)](https://www.npmjs.com/package/homebridge-plex)\n\nUse the active sessions on your Plex server as a sensor in Homebridge. Enable your cozy cinema light scene when Plex starts playing and go back to your normal lighting when playback stops.\n\n## Installation\n\nYou install the plugin the same way you installed Homebridge - as a global NPM module:\n\n```bash\nsudo npm install -g homebridge-plex\n```\n\nIf you don't have a Homebridge installation yet, head over to the [project documetation](https://github.com/nfarina/homebridge) for more information.\n\n## Configuration\n\nThe plugin uses the following config values:\n\nVariable | Description\n-------- | -----------\n`accessory` | Must be `Plex`\n`name` | Whatever you want the accessory to be named in Homekit\n`plex_token` | The X-Plex-Token used to access your Plex server API. See [Finding an authentication token / X-Plex-Token](https://support.plex.tv/hc/en-us/articles/204059436-Finding-an-authentication-token-X-Plex-Token)\n`host` | The hostname / IP address of your Plex server. Defaults to `localhost`, can be omitted if Homebridge runs on the same server as your Plex.\n`port` | The port of your Plex server. Defaults to `32400`\n`filter` | An array of filter rules. See [filtering sessions](#filtering-sessions)\n`polling_interval` | Interval in seconds in which the play state is checked. Default is `3`, lower values are discuraged.\n`debug` | Set this to true to receive detailed debug information about active sessions and filtering. This is not recommended for permanent installations as it [fills up your log files pretty quickly](https://github.com/mpbzh/homebridge-plex/issues/6).\n\nTypical config example:\n```json\n{\n  \"accessories\": [\n    {\n      \"accessory\": \"Plex\",\n      \"name\": \"Plex\",\n      \"plex_token\": \"...\",\n      \"filter\": [\n        {\n            \"user\": \"your-plex-username\",\n            \"player\": \"your-favorite-player\"\n        }\n      ]\n    }\n  ]\n}\n```\n\n## Filtering Sessions\n\nPlex will show up in your [Home app](https://www.apple.com/ios/home/) as an \"Occupancy Sensor\". You can use this sensor in any automation you like.\n\nLet's assume you have a home cinema with an Apple TV and the Plex app installed. You want to switch to your cinema light scene when you start watching a movie, so that all the lights dim down.\nNow you probably also have a smartphone or a tablet from which you occasionally stream a movie. To avoid these devices or even other users triggering the light scene in your home cinema, you can configure your sensor ignore everything other than the Apple TV.\n\nYou can configure an array of objects (we'll call that object a \"filter rule\"), each containing either a `user` or a `player` key or both. If any of the filter rules match an active session on your Plex server, the sensor in your Homekit will trigger and keep being triggered until you pause or stop the playback. So you can attach a scene to the \"occupancy detected\" event as well as the \"occupancy stopped being detected\" event.\n\nIf you define a filter rule only containing a `user` value, any device of that user will trigger the sensor. If you only define a `player` (e.g. my-apple-tv), then any player with that name will trigger the sensor, regardless of the user (This makes sense if multiple users use the same Apple TV).\n\n### Finding your user and player name\n\nJust start a movie on the device you want to trigger the sensor and head over to the [Plex web app](https://app.plex.tv/desktop). Navigate to Status -\u003e Dashoard -\u003e Current playback. Toggle \"show details\" on the top right and find the player name here:\n\n![Now Playing in the Plex web app](doc/now-playing.png)\n\nThe `player` is in the upper left corner (in this example it's \"TVBox\") and the `name` is next to your profile picture in the bottom (not depicted).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmpbzh%2Fhomebridge-plex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmpbzh%2Fhomebridge-plex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmpbzh%2Fhomebridge-plex/lists"}