home-assistant/packages/plex.yaml

65 lines
1.6 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'
group:
Plex:
view: yes
icon: mdi:television
entities:
- group.plex_players
- group.plex_automations
plex_players:
name: Plex
entities:
- media_player.plex_ps4
plex_automations:
name: Automations
entities:
- automation.dim_when_plex_is_active
- automation.restore_nighttime_lights_after_plex
- automation.restore_normal_lights_after_plex