Hello everyone,
I have the following script:
#------------------------------------------------
# Routine Varie
#------------------------------------------------
script:
- id: AccensioneManuale
mode: restart
then:
- script.execute: AttivaImpianto
- component.update: Display
- delay: !lambda "return (id(TempOn)*60000);"
- script.execute: AttivaImpianto
- component.update: Display
- id: AttivaImpianto
then:
- lambda: |-
if(id(Attivazione)==0){
id(Attivazione) = 1;
id(caldaia).turn_on();
} else {
id(Attivazione) = 0;
id(caldaia).turn_off();
}
and a sensor so configured:
- platform: gpio
id: PulsanteAttivaImpianto
pin:
number: GPIO23
inverted: True
name: "AttivaImpianto"
on_click:
then:
- if:
condition:
lambda: "return id(Attivazione) == 0;"
then:
- script.execute: AccensioneManuale
and global variabile declare:
globals:
- id: TempOn
type: int
restore_value: yes
initial_value: '0'
Contrary to what I thought, I can not get a delay proportionate to the value of the variable id (TempOn)?