[Feedback wanted] How should duration-based triggers behave when the state already qualifies at creation? #4168
Replies: 4 comments 4 replies
-
|
In case B I would expect the 3rd option. Why would the trigger act differently compared to the situation without a duration. In case A it's a bit different, because the actual event on which you are setting the trigger (the light being turned on for 30 minutes) didn't happen yet before saving the automation. With my knowledge of how this works with state triggers, I wouldn't expect it to trigger, but that doesn't have to be a limitation to implement it differently. |
Beta Was this translation helpful? Give feedback.
-
|
I would vote for option 2 in both cases (Start the timer at creation, so it fires 30 minutes later) as this is predictable for the user. |
Beta Was this translation helpful? Give feedback.
-
|
This one made me think longer than expected. I checked some automations I already have based on duration and on the most mission critical ones I ended up using timers! Example for this situation: When the light turns on, start the timer for 30 minutes, wait for timer to finish and execute the action. I believe this would make more sense when keeping in line with timers:
Why? Let's say I turned the light on 25 minutes ago and then restarted HA for some update, when it comes back up and reaches the 30 minutes mark I would like it to fire the event.
Why? The event is already gone, I don't expect this event to happen while HA is restarting (same as timers finished). |
Beta Was this translation helpful? Give feedback.
-
|
Two cases are slightly different: For the Usecase1 (trigger creation / modif without HA restart), I would answer: For the Usecase2 (HA restart), I would answer: lets copy the behaviour of the "without time confirmation" trigger there : Saying it differently, for usecase 2, the behaviour should be almost identical for no time confirmation and for a 1s confirmation. If there is a difference, there should be a strong rationale behind. (If I decided to set a confirmation time to "debounce" things, I do not expect triggers to fire when no confirmation time would not have.) If you need to secure HA off transition, you have do your trigger differently (with timers for example) to secure the "HA off" transition. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
We are looking at how duration-based triggers should behave when the watched entity already meets the trigger condition at the moment the trigger is created or reloaded. We want input from the community before settling on a behaviour.
Take a "light turned on" trigger with a duration of 30 minutes. The intent is for the trigger to fire once the light has been on for 30 minutes. Now imagine the light is already on when the trigger is created.
Case A, the light has already been on for 29 minutes:
Case B, the light has already been on for 31 minutes:
What would you expect here, and why? If your answer changes depending on the use case, please describe the use case.
Beta Was this translation helpful? Give feedback.
All reactions