Ok had a look there but no idea how to add all that data to the one automation so might just do it the way you have it.
Question on this (now().weekday() < 5) is that a Monday to Friday thing?
{% if states('binary_sensor.is_dst')|bool(0) %}
{{((now().hour >= 0 and now().minute >=15)) and (now().hour <= 9 and now().minute <= 15 )}}
{% else %}
{{((now().hour >= 23 and now().minute >=15)) and (now().hour <= 8 and now().minute <= 15 )}}
{% endif %}
For 00:15 to 9:15 and then for 11:15 to 8:15 but they both show as false in the template editor, probably due to the minutes, can’t be both less than or greater than 15.
Any ideas?
Found this {{ now() >= today_at("00:15") and now() <= today_at("09:15") }} which of course doesn’t work for {{ now() >= today_at("23:15") and now() <= today_at("08:15") }}
Problem is this again {% set t_off = today_at('00:15') %} same as my code, this is technically tomorrow so it’s not right.
The else works right as both times are within the same day
Summer time peak is 09:00 - 00:00 and winter is 08:00 - 23:00 but I need to add the 15 mins because my meter’s clock is 15 minutes off hence the 15.
The logic above works fine for DST if I do this:
{% if states('binary_sensor.is_dst')|bool(1) %}
{% set t_on = today_at('08:15') %}
{% set t_off = today_at('23:15') %}
{% else %}
{% set t_on = today_at('09:15') %}
{% set t_off = today_at('00:15') %}
{% endif %}
{% set t_now = now() %}
{{ t_on <= t_now <= t_off }}