Handle AC power transitions

This commit is contained in:
ltadeu6 2026-05-17 15:06:43 -03:00
parent 36d838ca86
commit dfe891345d
2 changed files with 18 additions and 2 deletions

View file

@ -622,6 +622,7 @@ Estado atual:
- O tempo maximo de execucao e 6 horas; ao expirar, o script desliga `climate.ar` e desliga `input_boolean.secar_roupas`.
- Fan mode e definido apenas se o valor existir em `state_attr('climate.ar', 'fan_modes')`; a integracao atual aceita niveis numericos `1..5`.
- O script usa fan `3` no `dry`, fan `4` no `cool` e fan `5` no `heat`, sempre com fallback para um nivel abaixo.
- Apos trocar `hvac_mode`, o script espera 10 segundos antes de setpoint/fan para evitar comandos rejeitados durante `POWER_ON`.
Cuidados:

View file

@ -22,10 +22,20 @@ let
haSetFanMode = fan_mode:
haClimateAction "climate.set_fan_mode" { inherit fan_mode; };
haTurnOffClimate = haClimateAction "climate.turn_off" { };
haTurnOffClimateIfOn = {
choose = [{
conditions = [{
condition = "template";
value_template = "{{ not is_state('${haAirConditioner}', 'off') }}";
}];
sequence = [ haTurnOffClimate ];
}];
};
haTurnOffDryingToggle = {
action = "input_boolean.turn_off";
target.entity_id = haLaundryDryingToggle;
};
haWaitForClimateReady = { delay = "00:00:10"; };
haWaitForDryingToggleOff = timeout: {
wait_template = "{{ is_state('${haLaundryDryingToggle}', 'off') }}";
inherit timeout;
@ -53,25 +63,30 @@ let
};
haDryCycle = [
(haSetHvacMode "dry")
haWaitForClimateReady
(haSetFanModeIfAvailable "3" "2")
];
haHeatEvaporationCycle = [
(haSetHvacMode "heat")
haWaitForClimateReady
(haSetTemperature 25)
(haSetFanModeIfAvailable "5" "4")
];
haHeatRecoveryCycle = [
(haSetHvacMode "heat")
haWaitForClimateReady
(haSetTemperature 24)
(haSetFanModeIfAvailable "5" "4")
];
haCoolPulse = [
(haSetHvacMode "cool")
haWaitForClimateReady
(haSetTemperature 22)
(haSetFanModeIfAvailable "4" "3")
];
haHotRoomCoolPulse = [
(haSetHvacMode "cool")
haWaitForClimateReady
(haSetTemperature 23)
(haSetFanModeIfAvailable "4" "3")
];
@ -450,7 +465,7 @@ in {
];
};
}
haTurnOffClimate
haTurnOffClimateIfOn
{
choose = [{
conditions = [{
@ -486,7 +501,7 @@ in {
entity_id = haLaundryDryingToggle;
to = "off";
}];
action = [ haTurnOffClimate ];
action = [ haTurnOffClimateIfOn ];
}
];