home-assistant: turn of presents_tracking when opening door

This commit is contained in:
Ingolf Wagner 2020-05-12 22:52:51 +02:00
parent 93fa05acd8
commit 308ba8463b
Signed by: palo
GPG key ID: 76BF5F1928B9618B
2 changed files with 27 additions and 9 deletions

View file

@ -60,7 +60,6 @@ in {
"bed_room_present" "bed_room_present"
"floor_room_present" "floor_room_present"
"bath_room_present" "bath_room_present"
"outside"
]; ];
}; };
@ -219,7 +218,7 @@ in {
let let
otherRoomPresentGroups = otherRoomPresentGroups =
(builtins.filter (name: name != presentGroup) (builtins.filter (name: name != presentGroup)
allRoomPresentGroups) ++ [ "outside" ]; allRoomPresentGroups);
in [ in [
{ {
alias = alias =
@ -294,8 +293,7 @@ in {
}]; }];
} }
]; ];
in (flatMap switchPresentsTracking allRoomPresentGroups) in (flatMap switchPresentsTracking allRoomPresentGroups);
++ (switchPresentsTracking "outside");
# change light scene in rooms when changing situation # change light scene in rooms when changing situation
# --------------------------------------------------- # ---------------------------------------------------
@ -461,6 +459,30 @@ in {
}; };
}; };
} }
# trigger outside
{
alias = "set essential";
trigger = [
{
platform = "state";
entity_id = "group.outside";
from = "off";
to = "on";
}
{
platform = "state";
entity_id = "group.outside";
from = "on";
to = "off";
}
];
action = {
service = "input_boolean.turn_off";
data.entity_id = "input_boolean.presents_tracking";
};
}
]; ];
group = let group = let
@ -542,7 +564,6 @@ in {
"group.living_room" "group.living_room"
"group.kitchen_room" "group.kitchen_room"
"group.bath_room" "group.bath_room"
"group.outside"
]; ];
}; };
@ -554,14 +575,11 @@ in {
"group.living_room_present" "group.living_room_present"
"group.kitchen_room_present" "group.kitchen_room_present"
"group.bath_room_present" "group.bath_room_present"
"group.outside"
]; ];
}; };
outside = { outside = {
control = "hidden";
name = "Draußen"; name = "Draußen";
view = false;
entities = [ ]; entities = [ ];
}; };

View file

@ -9,7 +9,7 @@ let
}; };
"door_sensor_2" = { "door_sensor_2" = {
id = "0x00158d000316d5bf"; id = "0x00158d000316d5bf";
groups = [ "outside" ]; groups = [ "floor_room" "floor_room_present" "outside" ];
}; };
"window_sensor_3" = { "window_sensor_3" = {
id = "0x00158d0002f9516f"; id = "0x00158d0002f9516f";