Use months as condition in automation

I need to create an automation where I can use months as a condition. I.e. The automation on runs if it’s currently within certain months. I can find days and times but not months. Am I missing something?

{{ now().month}}

so you can set a condition template as something like

{{ now().month == 8 }}

to require it to be august for the automation to run.

It might start with Jan as 0, better check if I’m wrong but I remember that somewhere.

thanks - how do I say NOT equal to august, so it runs every month EXCEPT august? nice one

{{ now().month != 8 }}

2 Likes

@Didgeridrew gotcha with the !=

particularly useful is also

{{ now().month in [2,4,7,10] }}

for super particular cases…

1 Like

marvellous, exactly what I need

great. I’ve used ! as not equal to. nice one

The following checks if the current month is May, June, July, August, or September and won’t proceed:

condition:
  condition: template
  value_template: "{{ now().month not in [5, 6, 7, 8, 9] }}"