From f8dfcab6ae81ee2d51965559ca7ba8161843bd3f Mon Sep 17 00:00:00 2001 From: CCOSTAN Date: Sun, 30 Oct 2016 18:37:32 +0000 Subject: [PATCH] Time Sensitive lighting thanks to @DALE3H! --- README.md | 4 ++-- automation/time_5am_8am.yaml | 10 ---------- automation/time_8am_8pm.yaml | 12 +----------- automation/time_8pm_5am.yaml | 13 +++---------- 4 files changed, 6 insertions(+), 33 deletions(-) diff --git a/README.md b/README.md index 1e123e00..3242f3a7 100755 --- a/README.md +++ b/README.md @@ -33,6 +33,7 @@ Software on the Pi : [Home Assistant](https://home-assistant.io/) , [Dasher](htt * Turn off lights when Nest detects we are away. (Upstairs and Downstairs) * Turn on some lights when we get home * Turn on Holiday Lights at Sunset, Turn off 4 hours before sunrise. Turn off interior Holiday lights when we go to sleep. +* Detects when lights are turned on and adjusts them to correct brightness based on time of day. * (IFTTT) Blink ALL lights at 9:30 to remind me to take medicine. (also Alexa Alert) * (IFTTT) Blink Office lights 15 minutes before ANY meeting on my calendar (using IFTTT) * (IFTTT) Stop watering grass via Rachio if winds are greater than 20 MPH. @@ -48,7 +49,6 @@ Software on the Pi : [Home Assistant](https://home-assistant.io/) , [Dasher](htt * Put Dash Buttons out there. * Put door sensor on garage door ([Garadget](garadget.com) is on the way!) * Put Door Sensor in Mailbox -* Put Door Sensor in Attic trap door to trigger light (GE LINK) * Add Pi-Hole (Ad blocking) to the network with the Pi Zero. (Add to Home Assistant) * Add LetsEncrypt and [CertBot](https://certbot.eff.org/#debianjessie-other) for auto renewals. (or buy cheapo SSL cert) for advanced Alexa stuff. * Flash backyard lights when doorbell rings. @@ -58,7 +58,7 @@ Software on the Pi : [Home Assistant](https://home-assistant.io/) , [Dasher](htt * Motion after midnight and the sprinklers go on. * Bathroom lights flash when door bell is pressed. * Vacation mode and mocupancy scenes to simulate being here. -* Time based automations - light brightness, blink light notifications (location), dash button options (https://github.com/dale3h/homeassistant-config/blob/master/examples/%40CCOSTAN/detect_state_change.yaml) +* Time based automations - blink light notifications (location), dash button options (https://github.com/dale3h/homeassistant-config/blob/master/examples/%40CCOSTAN/detect_state_change.yaml) * This : http://groundp.in/2016/10/18/step-by-step-guide-to-setting-up-esp-easy-with-home-assistant/ * http://www.pibakery.org/ diff --git a/automation/time_5am_8am.yaml b/automation/time_5am_8am.yaml index 6d3768ad..a797bccf 100755 --- a/automation/time_5am_8am.yaml +++ b/automation/time_5am_8am.yaml @@ -10,22 +10,12 @@ after: '05:00:00' - condition: time before: '7:59:00' - - condition: template - value_template: "{{ trigger.event.data is not none }}" - - condition: template - value_template: "{{ trigger.event.data.entity_id is not none }}" - condition: template value_template: "{{ trigger.event.data.entity_id.split('.')[0] == 'light' }}" - - condition: template - value_template: "{{ trigger.event.data.new_state is not none }}" - - condition: template - value_template: "{{ trigger.event.data.new_state.state is not none }}" - condition: template value_template: "{{ trigger.event.data.new_state.state == 'on' }}" - condition: template value_template: "{{ trigger.event.data.old_state.state == 'off' }}" - - condition: template - value_template: "{{ trigger.event.data.new_state.attributes is not none }}" # - condition: template # value_template: "{{ trigger.event.data.new_state.attributes.brightness|default(0)|int > 50 }}" action: diff --git a/automation/time_8am_8pm.yaml b/automation/time_8am_8pm.yaml index 0cd7bb30..97f43713 100755 --- a/automation/time_8am_8pm.yaml +++ b/automation/time_8am_8pm.yaml @@ -1,4 +1,4 @@ -- alias: detect_light_between 8am and 12pm +- alias: detect_light_between 8am and 8pm trigger: - platform: event event_type: state_changed @@ -10,22 +10,12 @@ after: '08:00:00' - condition: time before: '20:00:00' - - condition: template - value_template: "{{ trigger.event.data is not none }}" - - condition: template - value_template: "{{ trigger.event.data.entity_id is not none }}" - condition: template value_template: "{{ trigger.event.data.entity_id.split('.')[0] == 'light' }}" - - condition: template - value_template: "{{ trigger.event.data.new_state is not none }}" - - condition: template - value_template: "{{ trigger.event.data.new_state.state is not none }}" - condition: template value_template: "{{ trigger.event.data.new_state.state == 'on' }}" - condition: template value_template: "{{ trigger.event.data.old_state.state == 'off' }}" - - condition: template - value_template: "{{ trigger.event.data.new_state.attributes is not none }}" action: - service: light.turn_on data_template: diff --git a/automation/time_8pm_5am.yaml b/automation/time_8pm_5am.yaml index 753ea454..8034bec0 100755 --- a/automation/time_8pm_5am.yaml +++ b/automation/time_8pm_5am.yaml @@ -11,25 +11,18 @@ after: '20:00:00' - condition: time before: '12:00:00' + - condition: state + entity_id: sun.sun + state: 'below_horizon' - condition: state entity_id: group.family state: home - - condition: template - value_template: "{{ trigger.event.data is not none }}" - - condition: template - value_template: "{{ trigger.event.data.entity_id is not none }}" - condition: template value_template: "{{ trigger.event.data.entity_id.split('.')[0] == 'light' }}" - - condition: template - value_template: "{{ trigger.event.data.new_state is not none }}" - - condition: template - value_template: "{{ trigger.event.data.new_state.state is not none }}" - condition: template value_template: "{{ trigger.event.data.new_state.state == 'on' }}" - condition: template value_template: "{{ trigger.event.data.old_state.state == 'off' }}" - - condition: template - value_template: "{{ trigger.event.data.new_state.attributes is not none }}" # - condition: template # value_template: "{{ trigger.event.data.new_state.attributes.brightness|default(0)|int > 20 }}" action: