Refactor conditions and triggers based on sun

This commit is contained in:
2020-05-03 15:52:26 +03:00
parent c0c0beafd0
commit d6ad40a621
3 changed files with 6 additions and 8 deletions
@@ -5,9 +5,7 @@ automation:
entity_id: binary_sensor.motion_2_ias_zone entity_id: binary_sensor.motion_2_ias_zone
to: "on" to: "on"
condition: condition:
condition: and condition: state
conditions:
- condition: state
entity_id: input_select.house_mode entity_id: input_select.house_mode
state: 'day' state: 'day'
action: action:
@@ -35,6 +35,7 @@ automation:
color_temp: "{{ 400 if is_state('sun.sun', 'above_horizon') else 500 }}" color_temp: "{{ 400 if is_state('sun.sun', 'above_horizon') else 500 }}"
- alias: Lighting · Temperature · Adjust based on time - alias: Lighting · Temperature · Adjust based on time
# TODO: this trigger is not good. Figure out something else.
trigger: trigger:
platform: state platform: state
entity_id: sun.sun entity_id: sun.sun
+2 -3
View File
@@ -23,9 +23,8 @@ script:
routine_coming_home_after_sunset: routine_coming_home_after_sunset:
alias: Routine · Coming home · After sunset alias: Routine · Coming home · After sunset
sequence: sequence:
- condition: state - condition: sun
entity_id: sun.sun after: sunset
state: "below_horizon"
- service: light.turn_on - service: light.turn_on
entity_id: light.on_after_dark entity_id: light.on_after_dark
data: data: