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