Refactor turning hallway-lights
This commit is contained in:
parent
09107b626f
commit
59055cf83c
@ -8,58 +8,7 @@
|
||||
type: remote_button_short_press
|
||||
subtype: remote_button_short_press
|
||||
action:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: light.hallway_light
|
||||
state: 'on'
|
||||
sequence:
|
||||
- service: light.turn_off
|
||||
entity_id: light.hallway_light
|
||||
- service: light.turn_off
|
||||
entity_id: light.hallway_lightstrip
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: light.hallway_light
|
||||
state: 'off'
|
||||
sequence:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: input_select.home_mode
|
||||
state: Day
|
||||
sequence:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.sleep_mode
|
||||
state: 'on'
|
||||
sequence:
|
||||
- service: light.turn_on
|
||||
entity_id: light.hallway_light
|
||||
data:
|
||||
brightness: 255
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.sleep_mode
|
||||
state: 'off'
|
||||
sequence:
|
||||
- service: light.turn_on
|
||||
entity_id: light.hallway_light
|
||||
data:
|
||||
brightness: 255
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: input_select.home_mode
|
||||
state: Night
|
||||
sequence:
|
||||
- service: light.turn_on
|
||||
entity_id: light.hallway_lightstrip
|
||||
data:
|
||||
brightness_pct: 10
|
||||
hs_color:
|
||||
- 255
|
||||
- 100
|
||||
- service: script.hallway_lights_toggle
|
||||
|
||||
- id: hallway-button-double
|
||||
alias: '[Hallway] Button double press'
|
||||
|
@ -7,50 +7,7 @@
|
||||
from: 'off'
|
||||
to: 'on'
|
||||
action:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: input_select.home_mode
|
||||
state: Day
|
||||
sequence:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.sleep_mode
|
||||
state: 'on'
|
||||
sequence:
|
||||
- service: light.turn_on
|
||||
entity_id: light.hallway_light
|
||||
- service: light.turn_on
|
||||
entity_id: light.hallway_light
|
||||
data:
|
||||
brightness_pct: 50
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.sleep_mode
|
||||
state: 'off'
|
||||
- condition: numeric_state
|
||||
entity_id: sensor.kitchen_motion_sensor_illuminance
|
||||
below: '21'
|
||||
sequence:
|
||||
- service: light.turn_on
|
||||
entity_id: light.hallway_light
|
||||
- service: light.turn_on
|
||||
entity_id: light.hallway_light
|
||||
data:
|
||||
brightness_pct: 90
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: input_select.home_mode
|
||||
state: Night
|
||||
sequence:
|
||||
- service: light.turn_on
|
||||
entity_id: light.hallway_lightstrip
|
||||
data:
|
||||
brightness_pct: 10
|
||||
hs_color:
|
||||
- 255
|
||||
- 100
|
||||
- service: script.hallway_lights_on
|
||||
|
||||
- id: hallway-motion-off
|
||||
alias: '[Hallway] Motion Off'
|
||||
@ -61,7 +18,4 @@
|
||||
from: 'on'
|
||||
to: 'off'
|
||||
action:
|
||||
- service: light.turn_off
|
||||
entity_id: light.hallway_lightstrip
|
||||
- service: light.turn_off
|
||||
entity_id: light.hallway_light
|
||||
- service: script.hallway_lights_off
|
||||
|
@ -7,43 +7,5 @@
|
||||
device_id: 671a24524db60c56b0a182ac816faf20
|
||||
entity_id: binary_sensor.front_door_open_close
|
||||
domain: binary_sensor
|
||||
condition: [ ]
|
||||
action:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: input_select.home_mode
|
||||
state: Day
|
||||
sequence:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.sleep_mode
|
||||
state: 'on'
|
||||
sequence:
|
||||
- service: light.turn_on
|
||||
entity_id: light.hallway_light
|
||||
data:
|
||||
brightness: 255
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.sleep_mode
|
||||
state: 'off'
|
||||
sequence:
|
||||
- service: light.turn_on
|
||||
entity_id: light.hallway_light
|
||||
data:
|
||||
brightness: 255
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: input_select.home_mode
|
||||
state: Night
|
||||
sequence:
|
||||
- service: light.turn_on
|
||||
entity_id: light.hallway_lightstrip
|
||||
data:
|
||||
brightness_pct: 10
|
||||
hs_color:
|
||||
- 255
|
||||
- 100
|
||||
|
||||
- service: script.hallway_lights_on
|
||||
|
@ -59,9 +59,7 @@
|
||||
type: remote_button_short_press
|
||||
subtype: button_2
|
||||
action:
|
||||
- service: light.turn_on
|
||||
target:
|
||||
entity_id: light.hallway_light
|
||||
- service: script.hallway_lights_on
|
||||
|
||||
- id: kitchen-button-3 # Lower left
|
||||
alias: '[Kitchen] Button 3'
|
||||
|
65
scripts/90.lights-hallway.yaml
Normal file
65
scripts/90.lights-hallway.yaml
Normal file
@ -0,0 +1,65 @@
|
||||
hallway_lights_toggle:
|
||||
alias: '[Hallway] Lights toggle'
|
||||
sequence:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: light.hallway_light
|
||||
state: 'on'
|
||||
sequence:
|
||||
- service: script.hallway_lights_off
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: light.hallway_light
|
||||
state: 'off'
|
||||
sequence:
|
||||
- service: script.hallway_lights_on
|
||||
|
||||
hallway_lights_off:
|
||||
alias: '[Hallway] Lights off'
|
||||
sequence:
|
||||
- service: light.turn_off
|
||||
entity_id: light.hallway_light
|
||||
- service: light.turn_off
|
||||
entity_id: light.hallway_lightstrip
|
||||
|
||||
hallway_lights_on:
|
||||
alias: '[Hallway] Lights on'
|
||||
sequence:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: input_select.home_mode
|
||||
state: Day
|
||||
sequence:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.sleep_mode
|
||||
state: 'on'
|
||||
sequence:
|
||||
- service: light.turn_on
|
||||
entity_id: light.hallway_light
|
||||
data:
|
||||
brightness: 255
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.sleep_mode
|
||||
state: 'off'
|
||||
sequence:
|
||||
- service: light.turn_on
|
||||
entity_id: light.hallway_light
|
||||
data:
|
||||
brightness: 255
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: input_select.home_mode
|
||||
state: Night
|
||||
sequence:
|
||||
- service: light.turn_on
|
||||
entity_id: light.hallway_lightstrip
|
||||
data:
|
||||
brightness_pct: 10
|
||||
hs_color:
|
||||
- 255
|
||||
- 100
|
Loading…
Reference in New Issue
Block a user