hass: automatic configure to be home

This commit is contained in:
Ingolf Wagner 2020-11-14 00:46:45 +01:00
parent 5821402d13
commit 590a11b531
No known key found for this signature in database
GPG key ID: 76BF5F1928B9618B

View file

@ -108,44 +108,11 @@ in {
platform = "state"; platform = "state";
entity_id = "input_boolean.situation_toggle"; entity_id = "input_boolean.situation_toggle";
}; };
condition = {
condition = "template";
value_template =
''{{ states.input_select.scene.state != "outside" }}'';
};
action = { action = {
service = "input_select.select_next"; service = "input_select.select_next";
data.entity_id = "input_select.scene_button"; data.entity_id = "input_select.scene_button";
}; };
} }
{
alias = "Button -> Default Scene";
trigger = {
platform = "state";
entity_id = "input_boolean.situation_toggle";
};
condition = {
condition = "template";
value_template =
''{{ states.input_select.scene.state == "outside" }}'';
};
action = [
{
service = "input_select.select_option";
data = {
entity_id = "input_select.scene_button";
option = "default";
};
}
{
service = "input_select.select_option";
data = {
entity_id = "input_select.scene";
option = "default";
};
}
];
}
{ {
alias = "Button Scene -> Scene"; alias = "Button Scene -> Scene";
trigger = { trigger = {
@ -160,6 +127,8 @@ in {
}; };
}; };
} }
# outside and home
{ {
alias = "Set Scene To Outside when opening door"; alias = "Set Scene To Outside when opening door";
trigger = [ trigger = [
@ -187,6 +156,37 @@ in {
}; };
} }
{
alias = "Set default for motion inside";
trigger = map (entity_id: {
platform = "state";
entity_id = entity_id;
from = "off";
to = "on";
}) [
"binary_sensor.motion_sensor_1"
"binary_sensor.motion_sensor_2"
"binary_sensor.motion_sensor_3"
"binary_sensor.motion_sensor_4"
"binary_sensor.motion_sensor_5"
"binary_sensor.motion_sensor_6"
"binary_sensor.motion_sensor_7"
"binary_sensor.motion_sensor_8"
];
condition = {
condition = "template";
value_template =
''{{ states.input_select.scene.state == "outside" }}'';
};
action = {
service = "input_select.select_option";
data = {
entity_id = "input_select.scene";
option = "default";
};
};
}
# window roles # window roles
{ {
alias = "windows state = down in the evening"; alias = "windows state = down in the evening";