Automation Help - Calendar notifications based on title

Hi,

Is it possible to have a single automation like the below, but the message needs to include the calendar title? I have two calendar entries for bin night, each fortnight its different bins so i want to include that in the message

The two calendar entries i monitor for are

  • Bin Night - Red / Yellow / Green
  • Bin Night - Red / Green
description: "Bin Night Notification"
mode: single
trigger:
  - platform: calendar
    event: start
    offset: "-0:0:0"
    entity_id: calendar.home
condition:
  - condition: state
    entity_id: calendar.home
    attribute: message
    state: **Bin Night - Red / Yellow / Green**
  - condition: or
    conditions:
      - condition: state
        entity_id: calendar.home
        attribute: message
        state: **Bin Night - Red / Green**
action:
  - service: notify.mobile_app_sm_g998b
    data: {}

Option B is just create two automations and hard code my message to suit

As described in the Calendar docs, triggering off calendar events you should always use the trigger variable for conditions instead of the state of the calendar entity since the state is unreliable any time there may be overlapping events (including all-day events).

description: "Bin Night Notification"
mode: single
trigger:
  - platform: calendar
    event: start
    offset: "-0:0:0"
    entity_id: calendar.home
condition:
  - "{{ trigger.calendar_event.summary in ['Bin Night - Red / Yellow / Green', 'Bin Night - Red / Green'] }}"
action:
  - service: notify.mobile_app_sm_g998b
    data:
      title: Bin Night
      message: "{{ trigger.calendar_event.summary }}"