Refactor using sequence choosers

This commit is contained in:
2020-08-15 21:19:43 +03:00
parent fb7ca0108b
commit 82146b7346
4 changed files with 335 additions and 537 deletions
@@ -1,74 +1,53 @@
automation:
- alias: Lighting · Hallway · Day mode · Motion · Turn lights on
- alias: Lighting · Hallway · Motion On
trigger:
platform: state
entity_id: binary_sensor.hallway_motion_occupancy
to: "on"
condition:
condition: state
entity_id: input_select.house_mode
state: 'day'
action:
- service: light.turn_on
entity_id: light.hallway
- choose:
- conditions:
- condition: state
entity_id: input_select.house_mode
state: 'day'
sequence:
- service: light.turn_on
entity_id: light.hallway
- alias: Lighting · Hallway · Day mode · Motion · Turn lights off
default:
- service: light.turn_on
entity_id: light.light_lohas_6
data:
brightness_pct: 30
- service: light.turn_on
entity_id: light.light_le_8
data:
brightness_pct: 13
- alias: Lighting · Hallway · Motion Off
trigger:
platform: state
entity_id: binary_sensor.hallway_motion_occupancy
to: "off"
for:
minutes: 5
condition:
condition: state
entity_id: input_select.house_mode
state: 'day'
action:
- service: light.turn_off
entity_id: light.hallway
- alias: Lighting · Hallway · Night mode · Motion · Turn lights on
trigger:
platform: state
entity_id: binary_sensor.hallway_motion_occupancy
to: "on"
condition:
condition: not
conditions:
- condition: state
entity_id: input_select.house_mode
state: 'day'
action:
- service: light.turn_on
entity_id: light.light_lohas_6
data:
brightness_pct: 30
- service: light.turn_on
entity_id: light.light_le_8
data:
brightness_pct: 13
- alias: Lighting · Hallway · Night mode · Motion · Turn lights off
trigger:
platform: state
entity_id: binary_sensor.hallway_motion_occupancy
to: "off"
for:
minutes: 5
condition:
condition: not
conditions:
- condition: state
entity_id: input_select.house_mode
state: 'day'
action:
- service: light.turn_on
entity_id:
- light.light_le_8
- light.light_lohas_6
data:
brightness_pct: 100
- service: light.turn_off
entity_id:
- light.light_lohas_6
- light.light_le_8
- choose:
- conditions:
condition: state
entity_id: input_select.house_mode
state: 'day'
sequence:
- service: light.turn_off
entity_id: light.hallway
default:
- service: light.turn_on
entity_id:
- light.light_le_8
- light.light_lohas_6
data:
brightness_pct: 100
- service: light.turn_off
entity_id:
- light.light_lohas_6
- light.light_le_8