diff --git a/configuration/automations/hallway-button.yaml b/configuration/automations/hallway-button.yaml index 4989698..236bbbb 100644 --- a/configuration/automations/hallway-button.yaml +++ b/configuration/automations/hallway-button.yaml @@ -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' diff --git a/configuration/automations/hallway-motion.yaml b/configuration/automations/hallway-motion.yaml index 9e2b57f..64d3e78 100644 --- a/configuration/automations/hallway-motion.yaml +++ b/configuration/automations/hallway-motion.yaml @@ -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 diff --git a/configuration/automations/hallway-open-close.yaml b/configuration/automations/hallway-open-close.yaml index 4e13684..c4d8f38 100644 --- a/configuration/automations/hallway-open-close.yaml +++ b/configuration/automations/hallway-open-close.yaml @@ -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 diff --git a/configuration/automations/kitchen-button.yaml b/configuration/automations/kitchen-button.yaml index 382fdac..ebc8edb 100644 --- a/configuration/automations/kitchen-button.yaml +++ b/configuration/automations/kitchen-button.yaml @@ -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' diff --git a/scripts/90.lights-hallway.yaml b/scripts/90.lights-hallway.yaml new file mode 100644 index 0000000..8736e48 --- /dev/null +++ b/scripts/90.lights-hallway.yaml @@ -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