Integration of the Plex Media Server in ioBroker (with or without Plex Pass). Furthermore, Tautulli integration.
Table of contents
- Receive detailed media information about the current played media item (such as video bitrate, codec, subtitle information, audio; see Advanced setup for a full list)
- Receive
events
from Plex (via Plex Webhook and Plex Notifications using Plex Pass or via Tautulli, see setup!) - Playback control for players
- Retrieve
servers
- Retrieve
libraries
- Retrieve all items within a library
- Retrieve
users
(only with Tautulli) - Retrieve
statistics
(only with Tautulli) - Retrieve
playlists
- Retrieve
settings
- Retrieve all data from controllable clients
- Web Interface that shows the recent events from Plex:
For the basic setup it is required to provide the IP address (and port) of your Plex installation. Furthermore, you have to retrieve a dedicated token for the adapter to retrieve data from Plex.
Once this is given, ioBroker.plex will retrieve all the basic data (incl. Servers, Libraries). See Channels & States for the full list of basic data.
Webhook
If you are a Plex Pass user, you may setup a webhook in the Plex Settings to retrieve the current event / action from your Plex Media Server (play, pause, resume, stop, viewed and rated).
Navigate to your Plex Media Server and go to Settings
and Webhook
. Created a new webhook by clicking Add Webhook
and enter your ioBroker IP adress with the custom port specified in the ioBroker.plex settings and trailing /plex
path, e.g. http://192.168.178.29:41891/plex
:
Events
For information regarding the Plex Notifications, please see the official documentation. To turn on Notifications on your Plex Media Server, go to Settings
> Server
> General
and then enable the Push Notifications
preference.
Tautulli is a 3rd party application that you can run alongside your Plex Media Server to monitor activity and track various statistics. Most importantly, these statistics include what has been watched, who watched it, when and where they watched it, and how it was watched. All statistics are presented in a nice and clean interface with many tables and graphs, which makes it easy to brag about your server to everyone else. Check out Tautulli Preview and install it on your preferred system if you are interested.
This adapter connects to the Tautulli API and also receives webhook events from Tautulli.
Once Tautulli is installed, open the Settings page from Tautulli dashboard and navigate to Web Interface. Scroll down to the API section and make sure Enable API
is checked. Copy the API key
and enter it in the ioBroker.plex settings. Furthermore, add the Tautulli IP address and port to allow API communication.
To setup a webook using Tautulli, following the instrucutions below and make sure you have completed all 4 steps:
- Add Notification Agent
- Configure Webhook in Notification Agent
- Configure Triggers in Notification Agent
- Configure Data in Notification Agent
- Configure Notification options
Once installed open the settings page from Tautulli dashboard and navigate to Notification Agents as seen below:
-
Click Add a new notification agent and Webhook.
-
Enter your ioBroker IP adress with the custom port specified in the ioBroker.plex settings and trailing
/tautulli
path, e.g.http://192.168.178.29:41891/tautulli
:Furthermore, choose
POST
for the Webhook Method and enter any description you like in Description. -
Next, go to the Triggers tab, select your desired (or simply all) notification agents. An enabled notification agent will trigger an event which will then be sent to ioBroker. Make sure to provide the necessary data for each of the enabled notification agent in the next step!
-
Now, most importantly, fill in the respective data payload in the Data tab according to the Notification configuration found here. Copy the notification configuration of the relevant notification agents from the previous step (e.g.
Playback Start
,Playback Stop
,Playback Pause
andPlayback Resume
) in each of the text boxes as shown below forPlayback Start
: -
Finally, check the option
Allow Consecutive Notifications
to enable to allow sending of consecutive notifications (e.g. both watched & stopped notifications):
Having both the basic and advanced setup configured, the following channels will appear (libraries, servers and users are only examples of course). See further below for full list of channels & states.
After sucessful basic setup the channels according to the following table will be created. For a list of all states which will be created, please see dedicated list of states.
Channel / Folder | Description |
---|---|
libraries | Plex Libraries |
servers | Plex Servers |
settings | Plex Settings |
After sucessful advanced setup the following channels will additionally be created. For a list of all states which will be created, please see dedicated list of states.
Channel / Folder | Description | Remark |
---|---|---|
_playing | Plex Media being played | with Plex Pass or Tautulli |
statistics | Plex Watch Statistics | only with Tautulli |
users | Plex Users | only with Tautulli |
This adapter would not have been possible without the great work of @Zefau (https://github.com/Zefau), who create and maintained it until 2021 .
- (ticaki) State _playing.*.Metadata.viewOffset is created.
- (ticaki) Dependencies updated
- (mcm1957) Adapter requires nodejs >= 18 now
- (ticaki) move logmessage into debug
- (ticaki) fixed: bug in readable offset
- (ticaki) prevent Plex from crashing due to incorrect tautulli configuration
- (ticaki) Fixed: State common.name english/german
- (ticaki) some minor improvements
- (ticaki) Added: Lyrics are written as link and text in _playing.device.Metadata.Music.Lyric
- (ticaki) Added: Connection to players with refresh of playerdetail
- (ticaki) Added: New states with player data.
- (ticaki) Added: Refresh of player can be activate by set _Controls.timeline.refreshDetails to true
- (ticaki) Fixed: Control did not work with Plexamp.
- (ticaki) some minor improvements.
- (ticaki) Fixed: #184
- (ticaki) Fixed: Don't add empty notifications to history #183
- (ticaki) Fixed: prevent the creation of duplicate history entries in most cases
- (ticaki) Added: a play/pause switch for mediaplayer
- (ticaki) Added: links to artworks (ready to use)
- (ticaki) Added: state viewOffsetSeconds refresh every second while playing media(internal counter)
- (ticaki) Xmlparser call fixed
- (ticaki) fixed: several minor issues have been fixed
- (ticaki) fixed: common.type warnings have been fixed and missing state definitions have been added #114 #101 #100
- (ticaki) fixed: player controls
- (ticaki) fixed: history page has been fixed
- (ticaki) fixed: translation error has been fixed #108
- (Zefau) added option for webhook IP address in case Plex is running in a Docker environment (see #53)
- (Zefau) updated dependencies
- (Zefau) fixed error with state retrieval on startup when no states are given
- (Zefau) updated dependencies
- (Zefau) fixed error with state retrieval on startup when no states are given
- (Zfeau) fixed incorrect handling of certificates when using secure connection
- (Zefau) updated dependencies
- (Zefau) updated dependencies
- (Zefau) fixed missing spaces in events (and thus Adapter Web View)
- (Zefau) fixed using username instead of email for statistics (see #17)
- (Zefau) fixed player controls
- (Zefau) fixed error with http / https settings
- (Zefau) added further states to Tautulli Notification (see README-tautulli.md)
- (Zefau) fixed design issue with select-box in the adapter settings
- (Zefau) fixed not showing thumbnails in adapter web view (when not using a secure connection)
- (Zefau) fixed missing user / library statistics
- (Zefau) fixed using username instead of email for statistics (see #17)
- (Zefau) added support for remote player control via cloud / iot adapter
- (Zefau) added thumbnail to notifications as well as web interface of adapter
- (Zefau) fixed icons within the web interface of adapter
- (Zefau) fixed player controls (error when triggering
start
,stop
, etc.) - (Zefau) added additional states to
event
channel
- (Zefau) fixed error
Cannot read property 'forEach' of undefined
- (Zefau) added support for Plex Notifications including customization in adapter settings
- (Zefau) added count of streams (see #14)
- (Zefau) reworked cleaning up states when new webhook is received (see #11)
- (Zefau) reworked duty cycle (clean up of outdated / old states)
- (Zefau) fixed incorrect states (see #15)
- (Zefau) replaced password with token authentication
- (Zefau) added support for Plex Notifications (see #9)
- (Zefau) added support for all Tautulli triggers
- (Zefau) added Adapter Web Interface that shows the recent events
- (Zefau) Performance improvements (dutyCycleRun and state comparison)
- (Zefau) added refresh button (to scan library files) to libraries
- (Zefau) fixed newly introduced playback control not working for certain players
- (Zefau) removed unnecessary dependencies
- (Zefau) added playback control for players
- (Zefau) added configuration options to only retrieve specific objects from Plex
- (Zefau) added file, streaming and transcoding information to Tautulli event
- (Zefau) fixed bug when no playlists exist
- (Zefau) fixed missing
EVENTS.json
- (Zefau) updated dependencies to fix security vulnerabilities in depending packages
- (@Apollon77) updated testing for Node.js v12 (see #6)
- (Zefau) added support / discovery in iobroker.discovery (see #62)
- (Zefau) added playlists to states
- (Zefau) added state description for object tree
_playing
- (Zefau) updated German translation (instead of generating it from English)
- (Zefau) added authentication method (using Plex user and Plex password)
- (Zefau) fixed @iobroker/adapter-core dependency
- (Zefau) get initial data from Plex API
- (Zefau) receive events from Plex Webhook (Plex Pass only)
- (Zefau) receive events from Tatulli (if used)
The MIT License (MIT)
Copyright (c) 2023-2024 iobroker-community-adapters Copyright (c) 2019-2020 Zefau [email protected]
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.