From 5b5413432bf4f9ef5c4fe3186b67c5ffb5e757bd Mon Sep 17 00:00:00 2001 From: CCOSTAN Date: Mon, 19 Dec 2016 21:10:30 +0000 Subject: [PATCH] Move some holiday stuff to a reusable script.. --- automation/holiday.yaml | 10 ++-------- configuration.yaml | 1 + script/holiday_switches_on.yaml | 23 +++++++++++++++++++++++ script/monthly_front_house_scene.yaml | 2 +- 4 files changed, 27 insertions(+), 9 deletions(-) create mode 100755 script/holiday_switches_on.yaml diff --git a/automation/holiday.yaml b/automation/holiday.yaml index 92a54a4a..2bdac5e9 100755 --- a/automation/holiday.yaml +++ b/automation/holiday.yaml @@ -10,14 +10,8 @@ event_type: holiday_lights_on action: - - service: switch.turn_on - entity_id: switch.den_outlet - - delay: 00:00:30 - - service: switch.turn_on - entity_id: switch.living_room_outlet - - service: switch.turn_on - entity_id: switch.dining_room_outlet - - delay: 00:00:30 + - service: script.holiday_switches_on + - alias: 'Holiday Stuff off' trigger: diff --git a/configuration.yaml b/configuration.yaml index 38454d82..4eae8c67 100755 --- a/configuration.yaml +++ b/configuration.yaml @@ -13,6 +13,7 @@ http: ssl_key: !secret ssl_key trusted_networks: - 192.168.10.0/24 + - 127.0.0.1 ip_ban_enabled: True login_attempts_threshold: 3 diff --git a/script/holiday_switches_on.yaml b/script/holiday_switches_on.yaml new file mode 100755 index 00000000..3bf791cc --- /dev/null +++ b/script/holiday_switches_on.yaml @@ -0,0 +1,23 @@ +###################################################################################################### +###Script to shut switches with a 30 second delay to not trample codes +### Sample Call +# action: +# - service: script.holiday_switches_on +###################################################################################################### + +holiday_switches_on: + sequence: + - service: switch.turn_on + entity_id: switch.living_room_outlet + - delay: 00:00:30 + - service: switch.turn_on + entity_id: switch.foyer_outlet + - delay: 00:00:30 + + - condition: sun + after: sunset + - service: switch.turn_on + entity_id: switch.den_outlet + - delay: 00:00:30 + - service: switch.turn_on + entity_id: switch.dining_room_outlet diff --git a/script/monthly_front_house_scene.yaml b/script/monthly_front_house_scene.yaml index 3b7db8a7..a241ff56 100755 --- a/script/monthly_front_house_scene.yaml +++ b/script/monthly_front_house_scene.yaml @@ -1,5 +1,5 @@ ###################################################################################################### -###Script to turn on scene for the appropriate month for the front of the house. +###Script to turn on scene for the appropriate month for the front of the house but only when the sun is down. (Minus 3 Hours) # action: # - service: script.monthly_front_house_scene #