I had no idea Home Assistant and Plex could work this well together

I’ve manually turned lights off for movie nights for the last time. While I had a HomeKit scene to semi-automate this, I had no idea that I could integrate Plex into my smart home through Home Assistant, and I wish I had done this sooner.
I used to use Siri to turn off lights whenever we watched a TV show or movie
Hey Siri, watch TV
While I don’t have every single light in the house converted to being smart yet, I have all the important lights on smart plugs or switches. This includes all the lamps in my living room.
The problem is, we have two lights that reflect off the TV. They’re lights that we want on at all times normally, but whenever my wife or I sit down to watch TV, one lamp and one overhead light have to turn off.
I built out a HomeKit automation called “Watch TV” that turns just those two lights off and can be triggered either via the Apple Home app or through Siri. This automation has worked for us for years. I’ve always wanted a way to automate this further, make it something that we don’t have to manually trigger, but there just wasn’t a great way.
Often, when we have YouTube on the TV, we don’t want the lights to shut off. It’s really only when watching Plex together do we want the lights off, so I’ve not really tried to automate it with the TV itself. Our TV is part of our HomeKit home, as is the Apple TV—both of which could be used as triggers for the Watch TV scene already.
That just doesn’t work for what we want, though. However, finding out Plex works with Home Assistant was just the upgrade that my smart home needed.
Home Assistant’s native Plex integration is powerful
I had no idea Home Assistant and Plex worked so well together
I’m an avid user of both Home Assistant and Plex—but I had no idea they worked so well together. When I first started out trying to figure out how to make this lights off automation happen without me manually triggering it, Home Assistant was definitely a thought, but it didn’t cross my mind that Plex would have a native plugin.
Once I found it, though, I immediately installed it and set it up. The Plex Home Assistant plugin is actually super powerful. The amount of detail that it can extract is impressive.
For instance, there’s a binary sensor called plex_credits_marker that turns “on” the moment credits start rolling on whatever you’re watching. This can be used to turn the room lights up a little when the credits start, just like at a movie theater. A similar binary sensor called plex_intro_marker detects if you’re in an intro.
Of course, there’s other metadata, like the username of someone playing something, the media title, series title, season/episode, and much more. Really, the Plex Home Assistant integration gives you anything you could want to know about your Plex server when it comes to creating custom automations.
This is the missing automation designer that Home Assistant needs
See your whole automation as a diagram.
This simple automation turns my lights off (and back on) whenever we watch a movie or TV show
No more voice commands for me
Using the Plex Home Assistant add-on, I was able to completely automate turning my lights off whenever my wife or I start watching a movie or TV show. The automation is actually pretty simple.
For starters, you need to actually make a scene that you want Home Assistant to trigger. I called mine “living room dim,” and you could also make the reverse scene called “living room bright” if you wanted to set up a trigger for when content stopped playing.
Once I had that scene created, I used this code to create the automation to automatically turn off the lights whenever my user started watching a movie on just the living room Apple TV. To find the specific media player to monitor, go to the developer options of Home Assistant, then the states tab, and start watching something on Plex on the TV you want to monitor. This will give you the entity ID for the automation.
alias: "Plex: Cinema Mode (Patrick Only)"
description: "Dims lights when Patrick starts a movie, but ignores other users."
mode: single
trigger:
- platform: state
entity_id: media_player.plex_living_room_tv # <--- REPLACE THIS with your client ID
to: "playing"
condition:
# Condition 1: Check if it's Patrick watching
- condition: state
entity_id: media_player.plex_living_room_tv # <--- REPLACE THIS
attribute: username
state: "pcamp96" # <--- REPLACE THIS with the username from Step 2
# Condition 2: set to movie for movies, tv_show for TV shows, or remove this condition entirely for all media
- condition: state
entity_id: media_player.plex_living_room_tv # <--- REPLACE THIS
attribute: media_content_type
state: "movie"
action:
- service: scene.turn_on
target:
entity_id: scene.living_room_dim # <--- Your target scene
As you can see above, this automation is pretty simple. It simply looks at the Plex client on the living room TV, and watches for when the state changes to “playing.” From there, it checks to make sure that it’s my user, and then checks to see what type of media it is. When it finishes verifying that, it triggers the scene that I created to turn off the two light sources that reflect off the TV.
This only took me about 15 minutes to set up, and now this scene is completely automated. The great part is that Home Assistant and HomeKit keep each other updated with the status of devices. If Home Assistant triggers this scene, but I tell HomeKit to turn those lights on mid-movie because I need them, then it already knows they’re off instead of getting confused.
- Brand
-
Plex
- Free trial
-
Free version available
With Plex, you can keep a single, unified Watchlist for any movie or TV show you hear about, on any service—even theater releases! You can finally stop hopping between watchlists on all your other streaming services, and add it all on Plex instead.
This is just one way to integrate Plex with your Home Assistant and smart home setup. I’m planing on exploring more automation opportunities with Plex and Home Assistant in 2026.
I specifically want to look into the credits one and expand this automation to trigger multiple things: shut off just the two reflecting lights for TV shows, turn all lights off for movies, and turn just one or two lights back on once credits roll (only for movies).



