core: Automation trigger time offset not working
The problem
When using offset the automation does not run
What version of Home Assistant Core has the issue?
core-2021.11.0b2
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant Supervised
Integration causing the issue
automation
Link to integration documentation on our website
No response
Example YAML snippet
alias: '[Home Task] Roborock'
trigger:
- platform: time
at: input_datetime.vacuum_time
id: start_time
- platform: time
at:
entity_id: input_datetime.vacuum_time
offset: '-00:01:00'
id: notificare
Anything in the logs that might be useful for us?
No response
Additional information
"start_time" is executed on time but "notificare" is never executed.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 15 (10 by maintainers)
OK, let’s discuss here since https://github.com/home-assistant/core/pull/58947 will be locked soon, or even better in a new PR, @RobertMe.
@hmmbob I agree. A time trigger fires every day the same time, I don’t really see how it’s confusing to let it fire with an offset.
For the DST quirks, a time trigger will:
This means a time trigger based on a time input configured for 01:55 with an offset of 10 minutes would:
I think this is acceptable if documented.
Yes, that’s how I whould expect this to work as a user. And, if you have an
input_datetimewith only a date, I would expect it to trigger “offset” before/after 00:00:00 of that date, would you too?So: an input_datetime set to only date 01-JAN-2022 with an offset of 15 minutes I’d expect to trigger at 01-JAN-2022 00:15:00 for a positive offset, and at 31-DEC-2021 23:45 for a negative offset.
FWIW: I think this would be a valuable addition to HA, and I feel no-one is debating that. It’s just about how we feel this should work - happy to add my thoughts on that here.
@RobertMe bringing discussion from here to this thread:
That is actually exactly how I’d expect this to work.
If I have an input_datetime and ask for a -00:10 offset, I’d expect it to give me 10 mins before whatever the input_datetime is set to - regardless if this input_datetime has only a time, only a date (!), or a combination.
It should just do what I’m setting in yaml: trigger exactly 10mins before whatever the input is set to.
The reason it doesn’t work is indeed that the
input_datetime.vacuum_timehas only a time but no date.input_datetime.vacuum_time: 17:09:00
has_date: false has_time: true editable: true hour: 17 minute: 9 second: 0 timestamp: 61740 friendly_name: Vacuum time icon: mdi:clock-time-four