Move plex automations into their own package

This commit is contained in:
Correl Roush 2018-05-17 13:27:46 -04:00
parent 5729eac7ac
commit 7868455b80
3 changed files with 47 additions and 46 deletions

View File

@ -80,49 +80,3 @@
- condition: state
entity_id: device_tracker.homeassistant_pixel
state: not_home
- action:
- service: scene.turn_on
entity_id: scene.dimmed_brightness
alias: Dim when Plex is active
trigger:
- platform: state
entity_id: media_player.plex_ps4
to: playing
from: idle
condition:
- condition: state
entity_id: light.living_room
state: 'on'
- action:
- service: scene.turn_on
entity_id: scene.nighttime_brightness
alias: Restore nighttime lights after Plex
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'
- action:
- service: scene.turn_on
entity_id: scene.normal_brightness
alias: Restore normal lights after Plex
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'

View File

@ -12,6 +12,7 @@ homeassistant:
time_zone: America/New_York
# Customization file
customize: !include customize.yaml
packages: !include_dir_named packages
# Show links to resources in log and frontend
# introduction:

46
packages/plex.yaml Normal file
View File

@ -0,0 +1,46 @@
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'