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`. - 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`. - 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. - 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: Cuidados:

View file

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