From f16fe1fe4c0a6d35aeab70ff5251055ad7326114 Mon Sep 17 00:00:00 2001 From: CCOSTAN Date: Sun, 30 Oct 2016 06:02:26 +0000 Subject: [PATCH] Let there be light - But not too much at night. --- automation/time_8pm_5am.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/automation/time_8pm_5am.yaml b/automation/time_8pm_5am.yaml index cb2c454d..f84fb2a5 100755 --- a/automation/time_8pm_5am.yaml +++ b/automation/time_8pm_5am.yaml @@ -26,12 +26,14 @@ 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 > 254 }}" + value_template: "{{ trigger.event.data.new_state.attributes.brightness|default(0)|int > 20 }}" action: - service: light.turn_on data_template: entity_id: "{{ trigger.event.data.entity_id }}" - brightness: 255 \ No newline at end of file + brightness: 20 \ No newline at end of file