From b0631261c15d2af9889cad94710002eeea280cc4 Mon Sep 17 00:00:00 2001 From: CCOSTAN Date: Sun, 30 Oct 2016 13:27:41 +0000 Subject: [PATCH] Let there be light - But not too much at night or the monring. --- automation/time_5am_8am.yaml | 6 ++++-- automation/time_8am_8pm.yaml | 4 ++-- automation/time_8pm_5am.yaml | 4 ++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/automation/time_5am_8am.yaml b/automation/time_5am_8am.yaml index aa1ca0d3..6d3768ad 100755 --- a/automation/time_5am_8am.yaml +++ b/automation/time_5am_8am.yaml @@ -23,9 +23,11 @@ - condition: template value_template: "{{ trigger.event.data.new_state.state == 'on' }}" - condition: template - value_template: "{{ trigger.event.data.new_state.attributes is not none }}" + value_template: "{{ trigger.event.data.old_state.state == 'off' }}" - condition: template - value_template: "{{ trigger.event.data.new_state.attributes.brightness|default(0)|int > 50 }}" + 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: - service: light.turn_on data_template: diff --git a/automation/time_8am_8pm.yaml b/automation/time_8am_8pm.yaml index 7cb9a8e3..0cd7bb30 100755 --- a/automation/time_8am_8pm.yaml +++ b/automation/time_8am_8pm.yaml @@ -23,9 +23,9 @@ - condition: template value_template: "{{ trigger.event.data.new_state.state == 'on' }}" - condition: template - value_template: "{{ trigger.event.data.new_state.attributes is not none }}" + value_template: "{{ trigger.event.data.old_state.state == 'off' }}" - condition: template - value_template: "{{ trigger.event.data.new_state.attributes.brightness|default(0)|int > 254 }}" + 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 f84fb2a5..753ea454 100755 --- a/automation/time_8pm_5am.yaml +++ b/automation/time_8pm_5am.yaml @@ -30,8 +30,8 @@ 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 }}" +# - condition: template +# value_template: "{{ trigger.event.data.new_state.attributes.brightness|default(0)|int > 20 }}" action: - service: light.turn_on data_template: