From 9e73a9180debe9efeb8318e5e42d3ffec239a471 Mon Sep 17 00:00:00 2001 From: Jeffrey Stone Date: Fri, 9 Mar 2018 08:36:43 -0500 Subject: [PATCH] Attempting a house lights up solution --- automation/media.yaml | 26 +++++++++++++------------- scripts/house_lights_up.yaml | 9 +++++++++ 2 files changed, 22 insertions(+), 13 deletions(-) create mode 100644 scripts/house_lights_up.yaml diff --git a/automation/media.yaml b/automation/media.yaml index 5d78219..b04ea79 100644 --- a/automation/media.yaml +++ b/automation/media.yaml @@ -31,19 +31,19 @@ - service: scene.turn_on entity_id: scene.livingroom_dim -# - alias: "Movie Stopped - Lights On" -# trigger: -# - platform: state -# entity_id: media_player.apple_tv -# from: 'playing' -# to: 'idle' -# condition: -# - condition: state -# entity_id: sun.sun -# state: 'below_horizon' -# action: -# - service: scene.turn_on -# entity_id: scene.livingroom_normal +- alias: "Movie Stopped - Lights On" + trigger: + - platform: state + entity_id: media_player.apple_tv + from: 'playing' + to: 'idle' + condition: + - condition: state + entity_id: sun.sun + state: 'below_horizon' + action: + - service: sript.house_lights_up + # - alias: "Movie Resumed - Lights Off" # trigger: diff --git a/scripts/house_lights_up.yaml b/scripts/house_lights_up.yaml new file mode 100644 index 0000000..9b636e4 --- /dev/null +++ b/scripts/house_lights_up.yaml @@ -0,0 +1,9 @@ +house_lights_up: + sequence: + - delay: + seconds: 3 + - condition: state + entity_id: media_player.apple_tv + state: "idle" + - service: scene.turn_on + entity_id: scene.livingroom_normal \ No newline at end of file