I have an automation that triggers Mondays and Tuesdays at 11:35, every two weeks, and I calculated that has to be on an even week.
The thing is that today (01/01/2024) the automation got triggered, and beeing the first week (even) shouldnt have been triggered.
Checking on developer tools {{ now().strftime(‘%U’) }} results in 00 instead of 01.
Why is that? Is it because this year is a leap year, and if so is there any workaround?
This is my trigger:
trigger:
platform: template
value_template: "{{ now().hour == 11 and now().strftime('%M') == '35' and now().isoweekday() in [1, 2] and now().strftime('%U') | int % 2 == 0 }}"
Thanks in advance.