Integrating Plex with Home Assistant

In this tutorial, we will be showing you how to integrate your Plex media server with Home Assistant.

Home Assistant Plex Integration

Plex is one of the most popular solutions for managing and streaming your media. It has support for a wide variety of devices, as well as an API that Home Assistant can hook into.

By integrating Plex and Home Assistant, you will be able to perform automation based on your Plex server or clients.

For example, you could use this integration to turn off smart lights when you start playing a movie or TV show. You can even add your Plex clients to your dashboard to control the currently playing media.

Over the next few steps, we will show you how to add the Plex integration to Home Assistant and connect your media server.

To simplify this process, you should have your Plex Media Server linked to a Plex.tv account.

Installing and Configuring the Plex Integration in Home Assistant

Luckily for us, this process will be super straightforward because the Plex integration for Home Assistant is part of the core.

Being part of the core means we don’t have to install it through a marketplace such as HACS. It also means updates to this integration will be delivered through updates to Home Assistant.

Adding the Plex Integration to Home Assistant

1. To add your Plex Media Server to Home Assistant using its integration, you must first change to the “Settings” page.

You can access this page by clicking the “Settings” option in the sidebar.

Open Settings Screen

2. Once within the settings, click the “Devices & services” option.

Change to Devices and Services

3. Now, to begin adding the Plex integration to Home Assistant, click the “+ ADD INTEGRATION” button in the bottom-right corner.

Open Add New Integration Screen

4. With the “Add Integration” box option, type “plex” into the search bar at the top (1.).

Eventually, you should see “Plex Media Server” as an option. Click this option to continue (2.).

Search for Plex Integration for Home Assistant

Connecting your Plex Media Server to Home Assistant

5. We can now connect your Plex Media Server to Home Assistant.

The simplest way to do this is to choose the “Obtain a new token from plex.tv” option. The downside is that you must have a Plex account, which makes this process incredibly simple.

If you refuse to use a “plex.tv” account, select the other option and follow the official Plex guide on finding an authentication token. Our tutorial will assume you have a Plex account.

Obtain Plex token from Plex.tv

6. You will be prompted to sign in to your Plex account. The Plex integration for Home Assistant does this to grab the required tokens for your media server easily and quickly.

Click the “Sign In” button and follow the prompts to log in to your account.

Log in to Plex Account

7. After signing into your account, the Plex integration will immediately pull data from your server.

The screenshot below shows that it has already picked up the Plex Media Server itself and a client currently being used to watch a TV show.

You can click the “Finish” button to finalize the setup of the Home Assistant Plex integration.

Detected Plex Devices

Viewing your Plex Integration Devices

8. Now that you have set up the Plex integration, let us quickly check out the devices it has picked up.

We can do this by clicking the “Devices” link under the “Plex Media Server” heading. This will be located within the “Configured” section of the “Integrations” tab.

Open Devices screen for Home Assistant Plex installation

9. Here, you can see that it currently has our Plex Media Server and the Plex client running on my personal PC.

Selecting any of these will give you additional information about that client.

List of Plex Devices

10. For example, by clicking on our Media Server, we can see that it is tracking how many people are watching media from the server. In this example, it is just the one person watching from the media server.

You can also find a button here to tell the Plex integration to scan for clients. Doing this will add more devices to the Plex integration and allow you to track other clients.

Plex Home Assistant Integration Overview

11. Switching over to the client, you can see that the Plex integration handles this client as a “Media control“.

You can hook this control into your dashboard to allow you to start, pause, stop, or play media for this particular client. You can also hook into the status to perform automation.

Plex Client Overview

12. We highly recommend checking out their official documentation to integrate Plex into your Home Assistant automation.

This documentation explains how each element is handled and how to hook into it within your configuration.

Conclusion

Hopefully, you have successfully integrated your Plex Media Server with Home Assistant.

This neat integration allows you to track your media server and its clients’ status. You can easily automate tasks or add controls to your Home Assistant dashboard using the data it tracks.

Please feel free to comment below if you have had any issues integrating Plex with your home automation.

If you found this tutorial helpful, we highly recommend checking out our many other Home Assistant tutorials.

Leave a Reply

Your email address will not be published. Required fields are marked *