Actions every first of a months

Hello,
I want to send a notification every first of a month a a reminder for some actions
What is the best way to do it.

Thanks for your help

What other criteria/condition do you need to meet? For example, do you want the notification sent at a certain time or is it ok if is happens at 00:00?

since the notification is in the email. I don’t really care.

You have a few options…

The most basic trigger would fire the automation at 00:00 on the first of the month:

trigger:
  - platform: template
    value_template: "{{ now().day == 1 }}"

A calendar trigger is another option if you already use a calendar like
Google, CalDav, etc. Or, if you can wait until Wednesday for the 2022.12 release, you can use the Local Calendar integration. Almost all calendars have an option to repeat events.

I use this in an automation as trigger and condition. Whatever action can be used

trigger:
  - platform: time
    at: "00:01:00"
condition:
  - condition: template
    value_template: "{{ now().day == 1 }}"
action:

I have define a template like this :

  • platform: template
    sensors:
    dayofmonth: # custom sensor
    value_template: ‘{{now().strftime("%-d")}}’

and I automation like this:

alias: debut de mois
description: “”
trigger:

  • platform: state
    entity_id:
    • sensor.dayofmonth
      attribute: “1”
      condition: []
      action:
  • service: notify.mysm
    data:
    message: message from automation reminder prend photo compteur électrique
    title: "message domotique at {{ now().strftime(’%H:%M %A %d %B %Y’) }} "
    mode: single

just need to test it.
Pierre

For your example you need to leave the attribute: value blank, because you are interested in the state of the sensor, not an attribute. Instead it should look like:

trigger:
  - platform: state
    entity_id:
      - sensor.dayofmonth
    to: "1"
condition: []
action:
  - service: notify.mysm
....

you are so lovely. thanks for help. I will take the [khvej8] solution, so I don’t need a template.

The new local calendar can help with this.