Services

Calendar Services

ms365_calendar.create_calendar_event

Create an event in the specified calendar - All parameters are shown in the available parameter list on the Developer Tools/Services tab.

ms365_calendar.modify_calendar_event

Modify an event in the specified calendar - All parameters are shown in the available parameter list on the Developer Tools/Services tab. Not possible for group calendars.

ms365_calendar.remove_calendar_event

Remove an event in the specified calendar - All parameters are shown in the available parameter list on the Developer Tools/Services tab. Not possible for group calendars.

ms365_calendar.respond_calendar_event

Respond to an event in the specified calendar - All parameters are shown in the available parameter list on the Developer Tools/Services tab. Not possible for group calendars.

ms365_calendar.get_calendar_events

Get the events in a time range, with the same per-event detail as the calendar entity’s data attribute - including attendees (email, type, response status), organizer, categories, sensitivity, show_as, uid, locations, online_meeting and web_link. Use it with response_variable. Unlike the core calendar.get_events action, which only returns summary, start, end, description and location, and unlike the data attribute, which only covers the entity’s start_offset/end_offset window.

Example create event service call

service: ms365_calendar.create_calendar_event
target:
  entity_id:
    - calendar.user_primary
data:
  subject: Clean up the garage
  start: 2023-01-01T12:00:00+0000
  end: 2023-01-01T12:30:00+0000
  body: Remember to also clean out the gutters
  location: 1600 Pennsylvania Ave Nw, Washington, DC 20500
  sensitivity: normal
  show_as: busy
  attendees:
    - email: test@example.com
      type: Required

Response - Note uid is shown as an attribute of the entity_id since multiple entities can potentially be actioned at the same time.

calendar.user_primary:
  uid: >-
    long_guid

Example get events service call

action: ms365_calendar.get_calendar_events
target:
  entity_id: calendar.user_primary
data:
  start_date_time: ""
  end_date_time: ""
response_variable: events

The response is keyed by entity: events['calendar.user_primary'].events is a list of events, each with summary, start, end, all_day, description, location, locations, online_meeting, categories, sensitivity, show_as, reminder, organizer, attendees, uid and web_link. locations and online_meeting are left out when an event has none; they are described under the calendar sensor.

calendar.user_primary:
  events:
    - summary: Project review
      start: "2025-03-01T10:00:00+01:00"
      end: "2025-03-01T11:00:00+01:00"
      all_day: false
      description: ""
      location: Fourth Coffee
      locations:
        - name: Fourth Coffee
          type: localBusiness
          address:
            street: 4567 Main St
            city: Redmond
            state: WA
            postal_code: "98052"
            country: United States
          coordinates:
            latitude: 47.672
            longitude: -122.103
      online_meeting:
        provider: teams_for_business
        join_url: https://teams.microsoft.com/l/meetup-join/19%3ameeting_...
      categories: []
      sensitivity: Normal
      show_as: Busy
      reminder:
        minutes: 15
        is_on: true
      organizer: alex@example.com
      attendees:
        - email: me@example.com
          type: required
          status: accepted
      uid: long_guid
      web_link: https://outlook.office365.com/owa/?itemid=...&exvsurl=1&path=/calendar/item