Created
February 1, 2024 02:50
-
-
Save Didgeridrew/0b777bb98b65b12b0a1d68a6f1c26f6a to your computer and use it in GitHub Desktop.
HA - Script Calendar Event to ToDo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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