Hi,
Searched and searched for this, but can’t figure it…
I have a script which needs a time before and after condition.
The time which the condition applies needs to be 2 hours before an input_datetime time and after 3 hours after the same input_datetime time.
So I want the after:
to be 2 hours before whatever input_datetime.night_quiet_mode_on_time
is set to (and vice versa for before:
)
I know this doesn’t work because you can’t put templates after after:
(I don’t think), but it does kinda show what I want to do;
- conditions:
condition: time
after: {{(((state_attr('input_datetime.night_quiet_mode_on_time' , 'timestamp')) - 7200) | timestamp_custom('%H:%M', true))}}
before: "11:00:00"
I think I’m getting all muddled up with int’s and str’s and time formats and how to add and subtract from a time (which doesn’t have a date).
Thanks
Amanda