hass: improve heater state when outside

This commit is contained in:
Ingolf Wagner 2020-11-16 22:04:21 +01:00
parent 512dfbec39
commit 4025c81739
No known key found for this signature in database
GPG key ID: 76BF5F1928B9618B

View file

@ -66,10 +66,8 @@ in {
input_boolean.windows_up.icon = "mdi:toggle-switch"; input_boolean.windows_up.icon = "mdi:toggle-switch";
# heater scenes # heater scenes
input_select.heater_state = { input_select.heater_state.options = [ "off" "on1" "on2" ];
#icon = "mdi:brightness-auto"; input_select.heater_state_memory.options = [ "off" "on1" "on2" ];
options = [ "off" "on1" "on2" ];
};
automation = [ automation = [
@ -130,7 +128,7 @@ in {
# outside and home # outside and home
{ {
alias = "Set Scene To Outside when opening door"; alias = "when opening door I'm outside";
trigger = [ trigger = [
{ {
platform = "state"; platform = "state";
@ -147,17 +145,39 @@ in {
to = "off"; to = "off";
} }
]; ];
action = { action = [
{
service = "input_select.select_option"; service = "input_select.select_option";
data = { data = {
entity_id = "input_select.scene"; entity_id = "input_select.scene";
option = "outside"; option = "outside";
}; };
}
{
service = "input_select.select_option";
data_template = {
entity_id = "input_select.heater_state_memory";
option = ''
{% if not is_state("input_select.heater_state", "off") %}
{{ states('input_select.heater_state') }}
{%- else -%}
{{ states('input_select.heater_state_memory') }}
{%- endif %}
'';
}; };
} }
{
service = "input_select.select_option";
data = {
entity_id = "input_select.heater_state";
option = "off";
};
}
];
}
{ {
alias = "Set default for motion inside"; alias = "reset everything when back home";
trigger = map (entity_id: { trigger = map (entity_id: {
platform = "state"; platform = "state";
entity_id = entity_id; entity_id = entity_id;
@ -178,14 +198,23 @@ in {
value_template = value_template =
''{{ states.input_select.scene.state == "outside" }}''; ''{{ states.input_select.scene.state == "outside" }}'';
}; };
action = { action = [
{
service = "input_select.select_option"; service = "input_select.select_option";
data = { data = {
entity_id = "input_select.scene"; entity_id = "input_select.scene";
option = "default"; option = "default";
}; };
}
{
service = "input_select.select_option";
data_template = {
entity_id = "input_select.heater_state";
option = "{{ states('input_select.heater_state_memory') }}";
}; };
} }
];
}
# window roles # window roles
{ {
@ -212,12 +241,12 @@ in {
}]; }];
} }
{ {
alias = "enforce window_up state"; alias = "handle windows up state";
trigger = [ trigger = [
{ #{
platform = "time_pattern"; # platform = "time_pattern";
minutes = "/5"; # every 5 minutes # minutes = "/5"; # every 5 minutes
} #}
{ {
platform = "state"; platform = "state";
entity_id = "input_boolean.windows_up"; entity_id = "input_boolean.windows_up";
@ -242,13 +271,22 @@ in {
platform = "time"; platform = "time";
at = "09:00:00"; at = "09:00:00";
}]; }];
action = [{ action = [
{
service = "input_select.select_option"; service = "input_select.select_option";
data = { data = {
entity_id = "input_select.heater_state"; entity_id = "input_select.heater_state";
option = "on1"; option = "on1";
}; };
}]; }
{
service = "input_select.select_option";
data = {
entity_id = "input_select.heater_state_memory";
option = "on1";
};
}
];
} }
{ {
alias = "heater state = on2 in the early evening"; alias = "heater state = on2 in the early evening";
@ -256,13 +294,22 @@ in {
platform = "time"; platform = "time";
at = "22:30:00"; at = "22:30:00";
}]; }];
action = [{ action = [
{
service = "input_select.select_option"; service = "input_select.select_option";
data = { data = {
entity_id = "input_select.heater_state"; entity_id = "input_select.heater_state";
option = "on2"; option = "on2";
}; };
}]; }
{
service = "input_select.select_option";
data = {
entity_id = "input_select.heater_state_memory";
option = "on2";
};
}
];
} }
{ {
alias = "heater state = off in the evening"; alias = "heater state = off in the evening";
@ -270,20 +317,29 @@ in {
platform = "time"; platform = "time";
at = "23:30:00"; at = "23:30:00";
}]; }];
action = [{ action = [
{
service = "input_select.select_option"; service = "input_select.select_option";
data = { data = {
entity_id = "input_select.heater_state"; entity_id = "input_select.heater_state";
option = "off"; option = "off";
}; };
}];
} }
{ {
alias = "enforce heater state"; service = "input_select.select_option";
data = {
entity_id = "input_select.heater_state_memory";
option = "off";
};
}
];
}
{
alias = "handle heater state";
trigger = [ trigger = [
{ {
platform = "time_pattern"; platform = "time_pattern";
minutes = "/5"; # every 5 minutes minutes = "/10"; # every 5 minutes
} }
{ {
platform = "state"; platform = "state";