home-assistant/packages/plex.yaml

47 lines
1.2 KiB
YAML
Raw Normal View History

automation:
- alias: Dim when Plex is active
action:
- service: scene.turn_on
entity_id: scene.dimmed_brightness
trigger:
- platform: state
entity_id: media_player.plex_ps4
to: playing
from: idle
condition:
- condition: state
entity_id: light.living_room
state: 'on'
- alias: Restore nighttime lights after Plex
action:
- service: scene.turn_on
entity_id: scene.nighttime_brightness
trigger:
- platform: state
entity_id: media_player.plex_ps4
to: idle
from: playing
condition:
- condition: state
entity_id: light.living_room
state: 'on'
- condition: state
entity_id: sun.sun
state: 'below_horizon'
- alias: Restore normal lights after Plex
action:
- service: scene.turn_on
entity_id: scene.normal_brightness
trigger:
- platform: state
entity_id: media_player.plex_ps4
to: idle
from: playing
condition:
- condition: state
entity_id: light.living_room
state: 'on'
- condition: state
entity_id: sun.sun
state: 'above_horizon'