core: Automation action delay not working
The problem
I have a delay that isn’t working sometimes on my automation. It seems to be depending on time of the day.
Environment
- Home Assistant release with the issue: 0.104.3
- Last working Home Assistant release (if known): /
- Operating environment (Hass.io/Docker/Windows/etc.): Hass.io
- Integration causing this issue:
- Link to integration documentation on our website:
Problem-relevant configuration.yaml
---
alias: Switch on lights when coming home
initial_state: true
trigger:
- platform: state
entity_id: person.andrea
to: home
- platform: state
entity_id: person.rina
to: home
condition:
condition: state
entity_id: switch.day_night #off = night
state: 'off'
action:
- service: notify.ios_iphoneadonno
data:
title: Welcome home
message: Welcome
- service: light.turn_on
entity_id: light.hall_entree
- service: light.turn_on
entity_id: light.lum_ext_avant
- delay: '00:05:00'
- service: light.turn_off
entity_id: light.hall_entree
- service: light.turn_off
entity_id: light.lum_ext_avant
#add message just to be sure delay isn't taken in to account if both notifications are within the same minute
- service: notify.ios_iphoneadonno
data:
title: Welcome home
message: lights off
Traceback/Error logs
Additional information
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 15 (11 by maintainers)
Sounds good. I agree that restart makes most sense. A common use case for delay is turn light on, wait 30 minutes, turn light off. That will continue to work.
By starting/stopping scripts that are invoked by automation in order to have it working we create a workaround. If we need a workaround something is not working as expected. I still think this is a bug. Especially if HA has to get more userfriendly, these hurdles should be avoided for “less” experienced users. But that’s just me.
Now if this is an expected behavior then the documentation has to be changed. To " yeah there is a delay but it’s kinda useless" 😂
Jokes aside, The documentation should be adapted if it is not considered a bug
Edit: referring to @pnbruckner,
It’s not because it worked that way that it is right or that it should work that way 😂 . We wouldn’t evolve if we wouldn’t do some disruptive changes sometimes.
@adonno take a look at my thread: https://community.home-assistant.io/t/automation-trigger-for-state-crazy-behaviour-maybe-a-bug/140745/2 I had the exact same problem - I wasn’t aware that triggering the same automation skips the delay. I also think this is a bug. If you want a delay then you should have a delay, automation shouldn’t skip it. If this is a feature, then at least it should be documented correctly (with bold, red text)