I have a weird behavior when trying to diagnose why one of my automation doesn’t run as it should. I removed all my condition to rule them out but I am still having issue that seems to be related to a delay in my script.
Basically, here is the automation:
alias: H - Target change - Normal (TEST)
description: ''
trigger:
- platform: state
entity_id: input_number.temperature_cible
condition: []
action:
- service: script.turn_off
data:
entity_id: script.heating_normal
- service: script.heating_normal
mode: single
And here is the script (which is pretty simple):
lias: H - Demarre le chauffage normal
sequence:
- service: climate.set_temperature
data:
temperature: 10
entity_id: climate.thermostat_salon
- service: climate.set_temperature
data_template:
temperature: '{{ states(''input_number.temperature_cible'') | float }}'
entity_id: climate.thermostat_central
- delay: '00:15:00'
- service: climate.set_temperature
data_template:
temperature: '{{ states(''input_number.temperature_cible'') | float - 1.5 }}'
entity_id: climate.thermostat_salon
mode: single
So, basically, the automation stop the script if it is still running from a previous trigger. I am using this with other automation and I never had any problem but on this one, the script.turn_off doesn’t seem to work.
If I manually stop the script, the automation will work and the script will launch. But, if the script is still running, the automation simply doesn’t work. It actually look as if it isn’t being called at all.
Any idea why this isn’t working? It must be something stupid that I just don’t see because I’ve been looking at this for too long.
This is based on this: How to Turn Light on only for 2 minutes?