From 981cdcdbd4b434afd54087b5e828c8b2e1d26397 Mon Sep 17 00:00:00 2001 From: Przemek Grondek Date: Tue, 17 May 2022 19:01:31 +0200 Subject: [PATCH] Handle lights differently when guest are at home --- configuration/groups.yaml | 9 ++++++++- templates/lights.yaml.j2 | 10 ++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/configuration/groups.yaml b/configuration/groups.yaml index 588ab29..2e0f1f2 100644 --- a/configuration/groups.yaml +++ b/configuration/groups.yaml @@ -7,4 +7,11 @@ vacuum_rooms: - input_boolean.vacuum_kitchen - input_boolean.vacuum_hallway - input_boolean.vacuum_bedroom - - input_boolean.vacuum_bathroom \ No newline at end of file + - input_boolean.vacuum_bathroom + +guests: + entities: + - person.mariusz_ablewicz + - person.andrzej_legowski + - person.matka + - person.piotr_madej \ No newline at end of file diff --git a/templates/lights.yaml.j2 b/templates/lights.yaml.j2 index e4d266b..388d3b5 100644 --- a/templates/lights.yaml.j2 +++ b/templates/lights.yaml.j2 @@ -5,10 +5,20 @@ trigger: - platform: time at: input_datetime.sleep_mode + - platform: state + entity_id: + - group.guests + to: not_home condition: - condition: state entity_id: {{ light.entityId }} state: 'on' + - condition: state + entity_id: group.guests + state: not_home + - condition: time + before: input_datetime.day_mode + after: input_datetime.sleep_mode action: - service: light.turn_on data: