Just started using the tod
platform and tried specifying a time via date/time helpers. Turns out those are not accepted and lead to an invalid configuration.
I would consider that option a worthwhile extension as it allows modification through the UI.
What problem are you trying to solve?
Note I don’t mean using templates in the tod integration. What end use are you trying to accomplish?
I have several automations based on time intervals I define through helpers so I can easily modify the endpoints either manually in the UI or through scripts or other automations.
tod
seems like a more elegant way to do that but, as stated, does not accept a helper as input for either endpoint.
Input datetimes would be the best solution.
You can edit them in the frontend or change them via services in scripts and automations. And time triggers accept them without the need for templates.
There’s also a very good scheduler custom integration:
That is what I meant with “helper” and what I use now.
On a side note: how would I calculate an offset to such a value?
{{ strptime(states('input_datetime.wakeup'), "%H:%M:%S") - timedelta(minutes=5)}}
seems to work fine on the time part but add a date as in
1900-01-01 06:10:00
Like this:
{{ some_datetime_object + timedelta(seconds = as_timestamp('1900-01-01 06:10:00') ) }}
Whatever you’re trying to achieve, you can likely do with triggered template binary sensors:
tod
predates that functionality, and is no really relevant anymore nowadays, imho.
I see - it does handle interval across midnight more easily, though.
As you can see, I already play around with templates, just haven’t arrived at the point yet where I can readily manage to get my ideas into working ones …