Skip to content

Instantly share code, notes, and snippets.

@Didgeridrew
Created February 1, 2024 02:50
Show Gist options
  • Select an option

  • Save Didgeridrew/0b777bb98b65b12b0a1d68a6f1c26f6a to your computer and use it in GitHub Desktop.

Select an option

Save Didgeridrew/0b777bb98b65b12b0a1d68a6f1c26f6a to your computer and use it in GitHub Desktop.
HA - Script Calendar Event to ToDo
alias: Calendar to ToDo
sequence:
- service: calendar.get_events
metadata: {}
data:
start_date_time: "{{ today_at() + timedelta(days=1) }}"
duration:
hours: 36
target:
entity_id: calendar.trash_night
response_variable: Type
- service: todo.add_item
metadata: {}
data:
item: Take out the Garbage
due_date: "{{ as_timestamp(now()) | timestamp_custom(\"%Y-%m-%d\") }}"
description: |
{{ Type['calendar.trash_night']['events']
| selectattr('start', 'eq', (now()+timedelta(days=1)).date() | string)
| first | map(attribute='description') | join}}
target:
entity_id: todo.chores
mode: single
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment