Time Sensitive lighting thanks to @DALE3H!

This commit is contained in:
CCOSTAN
2016-10-30 18:37:32 +00:00
parent b0631261c1
commit f8dfcab6ae
4 changed files with 6 additions and 33 deletions

View File

@@ -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:

View File

@@ -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:

View File

@@ -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: