{% if now().strftime('%T') > strptime('09:30:00', '%T') and
now().strftime('%T') < strptime('10:30:00', '%T') %}
Do-Something
{% elif is_state('script.test', 'off') %}
Run Script
{%- else -%}
Stop
{%- endif %}
The issue here is that strftime returns a string and not a number. So testing if current time is inside or outside a certain time interval becomes impossible as the string ‘9’ in this test i greater then the string ‘10’
I have not been able to figure out the correct syntax to accurately perform such a test.
Please help.
I’m no expert in Python Time, I find it excruciatingly complex and always have to relearn it every time I want to do something like this but I’m sure you will get an answer from elsewhere.
In the meantime have you seen this?
And also, I am interested in what you plan to do in here?