Refactor turning hallway-lights
This commit is contained in:
parent
09107b626f
commit
59055cf83c
@ -8,58 +8,7 @@
|
|||||||
type: remote_button_short_press
|
type: remote_button_short_press
|
||||||
subtype: remote_button_short_press
|
subtype: remote_button_short_press
|
||||||
action:
|
action:
|
||||||
- choose:
|
- service: script.hallway_lights_toggle
|
||||||
- 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
|
|
||||||
|
|
||||||
- id: hallway-button-double
|
- id: hallway-button-double
|
||||||
alias: '[Hallway] Button double press'
|
alias: '[Hallway] Button double press'
|
||||||
|
@ -7,50 +7,7 @@
|
|||||||
from: 'off'
|
from: 'off'
|
||||||
to: 'on'
|
to: 'on'
|
||||||
action:
|
action:
|
||||||
- choose:
|
- service: script.hallway_lights_on
|
||||||
- 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
|
|
||||||
|
|
||||||
- id: hallway-motion-off
|
- id: hallway-motion-off
|
||||||
alias: '[Hallway] Motion Off'
|
alias: '[Hallway] Motion Off'
|
||||||
@ -61,7 +18,4 @@
|
|||||||
from: 'on'
|
from: 'on'
|
||||||
to: 'off'
|
to: 'off'
|
||||||
action:
|
action:
|
||||||
- service: light.turn_off
|
- service: script.hallway_lights_off
|
||||||
entity_id: light.hallway_lightstrip
|
|
||||||
- service: light.turn_off
|
|
||||||
entity_id: light.hallway_light
|
|
||||||
|
@ -7,43 +7,5 @@
|
|||||||
device_id: 671a24524db60c56b0a182ac816faf20
|
device_id: 671a24524db60c56b0a182ac816faf20
|
||||||
entity_id: binary_sensor.front_door_open_close
|
entity_id: binary_sensor.front_door_open_close
|
||||||
domain: binary_sensor
|
domain: binary_sensor
|
||||||
condition: [ ]
|
|
||||||
action:
|
action:
|
||||||
- choose:
|
- service: script.hallway_lights_on
|
||||||
- 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
|
|
||||||
|
|
||||||
|
@ -59,9 +59,7 @@
|
|||||||
type: remote_button_short_press
|
type: remote_button_short_press
|
||||||
subtype: button_2
|
subtype: button_2
|
||||||
action:
|
action:
|
||||||
- service: light.turn_on
|
- service: script.hallway_lights_on
|
||||||
target:
|
|
||||||
entity_id: light.hallway_light
|
|
||||||
|
|
||||||
- id: kitchen-button-3 # Lower left
|
- id: kitchen-button-3 # Lower left
|
||||||
alias: '[Kitchen] Button 3'
|
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