From 4c769240fadb5fb9bb782573db42d1bb6c06ec35 Mon Sep 17 00:00:00 2001 From: Przemek Grondek Date: Sat, 9 Apr 2022 14:29:26 +0200 Subject: [PATCH] Change living room button to table lights --- .../automations/living-room-button.yaml | 51 +--------------- scripts/93.lights-table.yaml | 61 +++++++++++++++++++ 2 files changed, 62 insertions(+), 50 deletions(-) create mode 100644 scripts/93.lights-table.yaml diff --git a/configuration/automations/living-room-button.yaml b/configuration/automations/living-room-button.yaml index 515250a..24c1f1b 100644 --- a/configuration/automations/living-room-button.yaml +++ b/configuration/automations/living-room-button.yaml @@ -10,56 +10,7 @@ type: remote_button_alt_short_press subtype: button_1 action: - - choose: - - conditions: - - condition: state - entity_id: light.office - state: 'on' - sequence: - - service: light.turn_off - entity_id: light.office - - conditions: - - condition: state - entity_id: light.office - 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.office - data: - brightness_pct: 100 - kelvin: 2000 - - conditions: - - condition: state - entity_id: input_boolean.sleep_mode - state: 'off' - sequence: - - service: light.turn_on - entity_id: light.office - data: - brightness_pct: 100 - kelvin: 3200 - - conditions: - - condition: state - entity_id: input_select.home_mode - state: Night - sequence: - - service: light.turn_on - entity_id: light.office - data: - brightness_pct: 5 - kelvin: 2700 + - service: script.table_lights_toggle - id: living-room-button-2 # Upper right alias: '[Living Room] Button 2 - Couch Light' diff --git a/scripts/93.lights-table.yaml b/scripts/93.lights-table.yaml new file mode 100644 index 0000000..fe1c652 --- /dev/null +++ b/scripts/93.lights-table.yaml @@ -0,0 +1,61 @@ +table_lights_toggle: + alias: '[Table] Lights toggle' + sequence: + - choose: + - conditions: + - condition: state + entity_id: light.table_lamp_lights + state: 'on' + sequence: + - service: script.table_lights_off + - conditions: + - condition: state + entity_id: light.table_lamp_lights + state: 'off' + sequence: + - service: script.table_lights_on + +table_lights_on: + alias: '[Table] Lights on' + sequence: + - choose: + - conditions: + - condition: state + entity_id: input_select.home_mode + state: Day + sequence: + - service: light.turn_on + entity_id: light.table_lamp_lights + data: + kelvin: 3200 + - service: light.turn_on + entity_id: light.table_lamp_lights + data: + brightness: 255 + - conditions: + - condition: state + entity_id: input_select.home_mode + state: Night + sequence: + - service: light.turn_on + entity_id: light.table_lamp_lights + data: + kelvin: 2000 + - service: light.turn_on + entity_id: light.table_lamp_lights + data: + brightness_pct: 10 + +table_lights_off: + alias: '[Table] Lights off' + sequence: + - service: light.turn_off + entity_id: light.table_lamp_lights + - service: light.turn_off + entity_id: light.bathroom_mirror_lights + - service: light.turn_off + entity_id: light.shower_lights + - service: light.turn_off + entity_id: light.bathroom_color_zha_group_0x0007 + - service: media_player.media_pause + entity_id: media_player.bathroom