Files
sarah/config/packages/modules/media/plex.yaml
2020-04-25 23:20:53 +03:00

69 lines
2.1 KiB
YAML

# https://www.home-assistant.io/integrations/plex
plex:
host: !secret plex_host
token: !secret plex_token
media_player:
use_episode_art: true
ignore_new_shared_users: false
automation:
- alias: TV · Plex · Setup house for Plex
trigger:
- platform: state
entity_id:
- media_player.plex_shield_chromecast
- media_player.plex_shield_player
- media_player.plex_lg
to: "playing"
action:
- service: sonos.unjoin
entity_id: media_player.living_room
- service: media_player.select_source
entity_id: media_player.living_room
data:
source: TV
- service: media_player.media_pause
entity_id: media_player.master_bedroom
- service: scene.create
data:
scene_id: plex_before_start
snapshot_entities:
- light.living_room_main_lights
- light.pc
- light.master_bedroom_main_lights
- light.tuya_kitchen_main_lights
- light.tuya_kitchen_secondary_lights
- light.hallway_entrance_lights
- light.tuya_hallway_main_lights
- service: light.turn_off
entity_id:
- light.living_room_main_lights
- light.pc
- light.master_bedroom_main_lights
- light.tuya_kitchen_main_lights
- light.tuya_kitchen_secondary_lights
- light.hallway_entrance_lights
- light.tuya_hallway_main_lights
- alias: TV · Plex · Restore house after Plex
trigger:
- platform: state
entity_id:
- media_player.plex_shield_chromecast
- media_player.plex_shield_player
- media_player.plex_lg
from: "playing"
action:
- service: scene.turn_on
# FIXME: Light colors are not being snapshotted/restored properly.
entity_id: scene.plex_before_start
- delay: 00:00:01
- condition: state
entity_id: light.pc
state: "on"
# FIXME: There is nothing else to fix the temperature of the PC light
- service: light.turn_on
entity_id: light.pc
data:
color_temp: 250