From fcbe56f443d8d2a0f0b6ca04ad754a2970640ab3 Mon Sep 17 00:00:00 2001 From: Przemek Grondek Date: Wed, 13 Sep 2023 19:51:41 +0200 Subject: [PATCH] Update automation to turn off tv at night --- configuration/automations/bedroom-tv.yaml | 14 +++++++++++--- scripts/91.lights-bedroom.yaml | 9 ++++----- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/configuration/automations/bedroom-tv.yaml b/configuration/automations/bedroom-tv.yaml index 263ac02..30fba86 100644 --- a/configuration/automations/bedroom-tv.yaml +++ b/configuration/automations/bedroom-tv.yaml @@ -29,7 +29,7 @@ mode: single trigger: - platform: time - at: "02:00:00" + at: "01:30:00" action: - service: media_player.turn_off target: @@ -44,9 +44,17 @@ to: 'on' condition: - condition: time - before: "06:00:00" - after: "02:00:00" + before: "09:00:00" + after: "01:30:00" action: - service: media_player.turn_off target: entity_id: media_player.bedroom_tv + - service: switch.turn_off + target: + entity_id: switch.bedroom_tv + - service: light.turn_off + entity_id: + - light.bedroom_lights + - light.bed_lightstrip + - light.bed_lamps diff --git a/scripts/91.lights-bedroom.yaml b/scripts/91.lights-bedroom.yaml index 27ec3b2..1482acf 100644 --- a/scripts/91.lights-bedroom.yaml +++ b/scripts/91.lights-bedroom.yaml @@ -50,11 +50,10 @@ bedroom_all_lights_off: alias: '[Bedroom] All lights off' sequence: - service: light.turn_off - entity_id: light.bedroom_lights - - service: light.turn_off - entity_id: light.bed_lightstrip - - service: light.turn_off - entity_id: light.bed_lamps + entity_id: + - light.bedroom_lights + - light.bed_lightstrip + - light.bed_lamps bedroom_bed_lamp_toggle: alias: '[Bedroom] Bed lamps toggle'