added info about add event script
This commit is contained in:
4
add-caldav-event/README.md
Normal file
4
add-caldav-event/README.md
Normal 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`
|
||||
68
add-caldav-event/add-caldav-event.yaml
Normal file
68
add-caldav-event/add-caldav-event.yaml
Normal 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
|
||||
Reference in New Issue
Block a user