home-assistant/packages/plex.yaml

54 lines
1.3 KiB
YAML
Raw Normal View History

automation:
2018-06-14 22:26:31 +00:00
- alias: Dim lights for movie
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'
2018-06-14 22:26:31 +00:00
- condition: template
value_template: >-
{{ state_attr('media_player.plex_ps4', 'media_content_type') == 'movie'}}
- alias: Restore lights after movie
action:
- service: scene.turn_on
2018-06-14 22:26:31 +00:00
data_template:
entity_id: >-
{% if is_state('sun.sun', 'below_horizon') %}
scene.nighttime_brightness
{% else %}
scene.normal_brightness
{% endif %}
trigger:
- platform: state
entity_id: media_player.plex_ps4
to: idle
from: playing
condition:
- condition: state
entity_id: light.living_room
state: 'on'
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:
2018-06-14 22:26:31 +00:00
- automation.dim_lights_for_movie
- automation.restore_lights_after_movie