Help on YAML coding

Hello! I’m trying to create an automation for a reminder on changing a filter on the 15th day every March, June, September, and December.

Coding will look like this in plain English:

================================

At 9 AM
Conditions:

  • Day = 15
    and
    Month = ‘March’ or ‘June’ or ‘September’ or ‘December’
    Action:
    Call service to notify me via email
    ===========================================

Thanks in advance.

You might put a recurring entry into your calendar and use that as a trigger.

1 Like

As @Stiltjack recommended, I would probably just use a calendar event. But for the sake of completeness, you could also use a template condition.

trigger:
  - platform: time
    at: "09:00:00"
condition:
  - condition: template
    value_template: "{{ now().day == 15 and now().month in [3,6,9,12] }}"
action:
  - service: notify.example
    data:
      message: Message
2 Likes

Thank you Didgeridrew! Is there a YAML for Dummies?

1 Like

There are many resources for YAML…

HA Docs - Automation YAML
Thomas Loven’s YAML for Non-programmers
ResinChem Tech video - transcribing an automation from YAML into the UI editor

There are also numerous resources for the Jinja Templating used in HA:

Jinja Templating Docs
HA Docs - Templating

Skalavala’s Jinja for Ninjas
Community Cookbook - Templating - Getting Time and Date (work in progress)

2 Likes