[plex] Only restore lights if plex dimmed them

This commit is contained in:
Correl Roush 2018-06-29 10:06:18 -04:00
parent 947376f381
commit 4d57d538c0
1 changed files with 14 additions and 0 deletions

View File

@ -1,8 +1,16 @@
input_boolean:
plex_dimmed_lights:
name: Lights have been dimmed
initial: off
automation:
- alias: Dim lights for movie
action:
- service: scene.turn_on
entity_id: scene.dimmed_brightness
- service: input_boolean.turn_on
data:
entity_id: input_boolean.plex_dimmed_lights
trigger:
- platform: state
entity_id: media_player.plex_ps4
@ -25,6 +33,9 @@ automation:
{% else %}
scene.normal_brightness
{% endif %}
- service: input_boolean.turn_off
data:
entity_id: input_boolean.plex_dimmed_lights
trigger:
- platform: state
entity_id: media_player.plex_ps4
@ -34,6 +45,9 @@ automation:
- condition: state
entity_id: light.living_room
state: 'on'
- condition: state
entity_id: input_boolean.plex_dimmed_lights
state: 'on'
group:
Plex: