From 4dd88af3fad79aef0632a4bb1517c554515ddbd4 Mon Sep 17 00:00:00 2001 From: Przemek Grondek Date: Thu, 8 Dec 2022 08:53:47 +0100 Subject: [PATCH] Behaviour automations for bedroom tvb --- configuration/automations/bedroom-tv.yaml | 27 +++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/configuration/automations/bedroom-tv.yaml b/configuration/automations/bedroom-tv.yaml index 421e5a7..fb077e3 100644 --- a/configuration/automations/bedroom-tv.yaml +++ b/configuration/automations/bedroom-tv.yaml @@ -23,3 +23,30 @@ state: Day action: - service: script.bedroom_tv_off_scene + +- id: bedroom-tv-turn-off-at-night + alias: '[Bedroom] TV turn off at night' + mode: single + trigger: + - platform: time + at: "02:00:00" + action: + - service: media_player.turn_off + target: + entity_id: media_player.bedroom_tv + +- id: bedroom-tv-off-at-night + alias: '[Bedroom] TV stay off at night' + mode: single + trigger: + - platform: state + entity_id: switch.bedroom_tv + to: 'on' + condition: + - condition: time + before: "06:00:00" + after: "02:00:00" + action: + - service: media_player.turn_off + target: + entity_id: media_player.bedroom_tv