added info about add event script

This commit is contained in:
2025-11-30 17:07:05 -05:00
parent 412b35c4c0
commit a1123c7092
2 changed files with 4 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
# Script for CalDAV events
This is what allows you to utilize a self-hosted calendar (in my instance nextcloud).
Add this script to the scripts settings of your HA you can find scripts here `Settings > Automations & scenes > Scripts`

View File

@@ -0,0 +1,68 @@
alias: Add CalDAV Calendar Event
description: Create an event based on All Day or Timed selection
sequence:
- choose:
- conditions:
- condition: state
entity_id: input_boolean.calendar_all_day_event
state: "off"
sequence:
- target:
entity_id: calendar.{{ states('input_select.calendar_select') | lower }}
data:
summary: "{{ states('input_text.calendar_event_title') }}"
description: "{{ states('input_text.calendar_event_description') }}"
start_date_time: "{{ states('input_datetime.calendar_timed_event_start') }}"
end_date_time: "{{ states('input_datetime.calendar_timed_event_end') }}"
action: calendar.create_event
- delay:
hours: 0
minutes: 0
seconds: 3
- action: browser_mod.navigate
data:
path: /our-calendar/calendar
deviceID:
- THIS
- data:
title: Calendar Entry Added
message: >-
Added Calendar Entry for {{
states('input_select.calendar_select') }} ({{
states('input_text.calendar_event_title') }})
action: persistent_notification.create
- conditions:
- condition: state
entity_id: input_boolean.calendar_all_day_event
state: "on"
sequence:
- target:
entity_id: calendar.{{ states('input_select.calendar_select') | lower }}
data:
summary: "{{ states('input_text.calendar_event_title') }}"
description: "{{ states('input_text.calendar_event_description') }}"
start_date: |
{{ states('input_datetime.calendar_day_event_start') }}
end_date: >
{% set end_date =
states('input_datetime.calendar_day_event_end') | as_datetime %}
{% set end_date = end_date + timedelta(days=1) %} {{
end_date.strftime('%Y-%m-%d') }}
action: calendar.create_event
- delay:
hours: 0
minutes: 0
seconds: 3
- action: browser_mod.navigate
data:
path: /our-calendar/calendar
deviceID:
- THIS
- data:
title: All Day Calendar Entry Added
message: >-
Added ALL DAY Calendar Entry for {{
states('input_select.calendar_select') }} ({{
states('input_text.calendar_event_title') }})
action: persistent_notification.create
mode: single