This automation suite intelligently controls your living room lighting based on the playback status of your Plex media player (e.g. Plex running on a Samsung TV). It creates a cozy, cinema-like atmosphere by dimming the lights and turning off fans when a movie starts, and restoring full brightness and normal settings when the movie is paused or stopped. Smooth brightness transitions and system log messages keep you informed about the current state.
🔧 Requirements
- A configured
media_playerentity for your Plex player (e.g.,media_player.plex_plex_for_samsung_tv_2020). - Smart lights and fans integrated into Home Assistant.
- Optional: Netflix app detection via a sensor like
sensor.wohnzimmer_fernsehsender_nameto extend functionality.
🎬 Automation: Living Room Light Control Based on Plex Movie Status
How it works:
- When a movie starts playing: - Certain bright lights and fans are turned off to minimize distractions. - Other lights are dimmed to low brightness levels (between 10% and 40%) with smooth 3-second transitions to create a relaxing theater ambiance. - A system log entry is written to document the movie start and the lighting change. - After a 10-minute delay (allowing the user to settle in), the kitchen hood (exhaust fan) switch is turned off automatically to reduce background noise.
- When the movie is paused, stopped, or idle: - All affected lights are restored to full brightness with smooth transitions. - Another system log entry confirms the lights are back to normal.
alias: Living Room Light Control Based on Plex Movie Status
description: >
Controls living room lighting based on Plex playback state.
- When playing: dims lights, turns off fan, logs event, then after 10 minutes
turns off kitchen hood.
- When paused/stopped/idle: restores full brightness and logs event.
triggers:
# Trigger when Plex player changes state to playing
- entity_id: media_player.plex_plex_for_samsung_tv_2020
to: playing
trigger: state
# Trigger when Plex player leaves playing state to paused/off/idle
- entity_id: media_player.plex_plex_for_samsung_tv_2020
from: playing
to:
- paused
- "off"
- idle
trigger: state
conditions: []
actions:
- choose:
- conditions:
- condition: state
entity_id: media_player.plex_plex_for_samsung_tv_2020
state: playing
sequence:
- parallel:
# Turn off bright ceiling and spotlight lights for cinema feel
- target:
entity_id:
- light.a7936d80caa019ec2ce84a2c51c50a02
- light.1df39f453fd981ff0576529085067789
- light.05d30dfa72978e686a55cadeea7bcc50
action: light.turn_off
data: {}
# Turn off the living room fan to minimize distractions
- target:
entity_id: fan.250e37c9d2d41d709b36e1e775cf99
action: fan.turn_off
data: {}
# Dim ambient lights to 25% brightness with smooth transition (3 seconds)
- target:
entity_id:
- light.wohnzimmer_led_2
- light.tv_led
- light.stehlampe_led_2
data:
brightness_pct: 25
transition: 3
action: light.turn_on
# Set a fan light to 10% brightness with smooth transition
- target:
entity_id: light.han_fun_1_f1
data:
brightness_pct: 10
transition: 3
action: light.turn_on
# Set bookshelf or accent light to 40% brightness with smooth transition
- target:
entity_id: light.bcc7cc2e68a4318e8946e6674b617333
data:
brightness_pct: 40
transition: 3
action: light.turn_on
# Log the lighting change to the Home Assistant system log for transparency
- data:
message: >-
🎬 Movie started – lights dimmed, fan off, kitchen hood will turn off after 10 minutes.
level: info
action: system_log.write
# Wait 10 minutes before turning off the kitchen hood to reduce noise gradually
- delay: "00:10:00"
# Turn off kitchen hood (exhaust fan) after delay
- target:
entity_id: switch.a77978ab818643c5455ae6563230f92b
action: switch.turn_off
data: {}
- conditions:
- condition: template
value_template: |
{{ trigger.to_state.state in ['paused', 'off', 'idle'] and
trigger.from_state.state == 'playing' }}
sequence:
- parallel:
# Restore lights affected by movie mode to full brightness with smooth transitions
- target:
entity_id:
- light.han_fun_1_f1
- light.wohnzimmer_led_2
- light.tv_led
- light.stehlampe_led_2
data:
brightness_pct: 100
transition: 3
action: light.turn_on
# Turn on other lights that were turned off during movie mode
- target:
entity_id:
- light.1df39f453fd981ff0576529085067789
- light.a7936d80caa019ec2ce84a2c51c50a02
- light.05d30dfa72978e686a55cadeea7bcc50
- light.bcc7cc2e68a4318e8946e6674b617333
data: {}
action: light.turn_on
# Log the restoration to system log
- data:
message: ⏸️ Movie paused/stopped – lights set to 100%.
level: info
action: system_log.write
mode: restart📌 Notes
- You can customize all entity IDs (
entity_id) in the automation to match your exact smart home setup. - The
mode: restartensures the automation restarts cleanly if triggered multiple times quickly. - System log messages help you keep track of lighting changes without checking UI.
- Optional: If you use apps like Netflix, you can integrate additional sensors (e.g.,
sensor.wohnzimmer_fernsehsender_name) to trigger or condition the automation for better coverage.