- Drive light changes based on player status. For instances turn off the lights when movie starts playing and turn them back on when movie is stopped/paused
- Create a page that displays currently played media of one or more player connected to the server.
- Send social media messages when player plays new media
- Inform what the end time of the currently played media is
-`server`: The PLEX server will act as a bridge to read out the information from all connected players
-`player`: A PLEX client of any type / os connected to the server.
## Discovery
For the auto discovery to work correctly you first need to configure and add the `PLEX Server` Thing.
Next step is to *PLAY* something on the desired player. Only when media is played on the player it will show up in the auto discovery!
## Thing Configuration
The PLEX Server needs to be configured first. The hostname of the PLEX server is mandatory and the either the PLEX token (recommended) or the username/password of the PLEX server (not recommended).
| host | text | PLEX host name or IP address | N/A | yes | no |
| portNumber | integer | Port Number (leave blank if PLEX installed on default port) | 32400 | no | no |
| refreshRate | integer | Interval in seconds at which PLEX server status is polled | 5 | no | no |
| username | text | If you're using Plex Home you need to supply the username and password of your Plex account here. If you don't want to enter your credentials you can also directly set your account token below instead. | N/A | no | no |
| password | text | If you're using Plex Home you need to supply the username and password of your Plex account here. If you don't want to enter your credentials you can also directly set your account token below instead. | N/A | no | no |
| token | text | The authentication token when username/password is left blank | N/A | no | no |
### `PLEX Player` Thing Configuration
You can add multiple PLEX players. You can choose to find the player by autodiscovery or add them manually.
#### Autodiscovery
Turn on the player you want to add and *play* some media on it. Navigate to `/settings/things/add/plex` and start the auto discover.
When you want to add them manually go to the following url [https://plex.tv/devices.xml] and login when needed.
It will display the following XML file.
```xml
<MediaContainerpublicAddress="XXX.XXX.XXX.XXX">
<Devicename="iPhone"publicAddress="XXX.XXX.XXX.XXX"product="Plex for iOS"productVersion="8.4"platform="iOS"platformVersion="15.5"device="iPhone"model="14,5"vendor="Apple"provides="client,controller,sync-target,player,pubsub-player,provider-playback"clientIdentifier="B03466F7-BEEB-405F-A315-C7BBAA2D3FAE"version="8.4"id="547394701"token="XXX"createdAt="1633194400"lastSeenAt="1655715607"screenResolution="1170x2532"screenDensity="3">
<Devicename="BRAVIA 4K UR2"publicAddress="XXX.XXX.XXX.XXX"product="Plex for Android (TV)"productVersion="8.26.2.29389"platform="Android"platformVersion="9"device="BRAVIA 4K UR2"model="BRAVIA_UR2_4K"vendor="Sony"provides="player,pubsub-player,controller"clientIdentifier="97d2510bd3942159-com-plexapp-android"version="8.26.2.29389"id="403947762"token="XXX"createdAt="1601489892"lastSeenAt="1655701261"screenResolution="1920x1080"screenDensity="320">
<Connectionuri="http://192.168.1.19:32500"/>
</Device>
<Devicename="SHIELD Android TV"publicAddress="XXX.XXX.XXX.XXX"product="Plex for Android (TV)"productVersion="8.26.2.29389"platform="Android"platformVersion="11"device="SHIELD Android TV"model="mdarcy"vendor="NVIDIA"provides="player,pubsub-player,controller"clientIdentifier="2c098c67afd0ca79-com-plexapp-android"version="8.26.2.29389"id="508114660"token="XXX"createdAt="1625317867"lastSeenAt="1655693424"screenResolution="1920x1080"screenDensity="320">
<Connectionuri="http://192.168.1.6:32500"/>
</Device>
<Devicename="iPad"publicAddress="XXX.XXX.XXX.XXX"product="Plex for iOS"productVersion="8.0"platform="iOS"platformVersion="14.7.1"device="iPad"model="5,3"vendor="Apple"provides="client,controller,sync-target,player,pubsub-player,provider-playback"clientIdentifier="D9629798-4B91-4375-8844-C62400573E42"version="8.0"id="617442968"token="XXX"createdAt="1646760020"lastSeenAt="1647973844"screenResolution="2048x1536"screenDensity="2">
<Devicename="MacBook-Pro.local"publicAddress="XXX.XXX.XXX.XXX"product="Plex for Mac"productVersion="1.41.0.2876-e960c9ca"platform="osx"platformVersion="12.2"device=""model="standalone"vendor=""provides="client,player,pubsub-player"clientIdentifier="5ehipgz2ca60ikqnv9jrgojx"version="1.41.0.2876-e960c9ca"id="507110703"token="XXX"createdAt="1625081186"lastSeenAt="1647973509"screenResolution="1680x1050,1680x1050"screenDensity=""></Device>
</MediaContainer>
```
Find the `Device` block of the player you want to add and fill in the `clientIdentifier` as `playerID`
| Name | Type | Description | Default | Required | Advanced |