Created
February 1, 2024 04:04
-
-
Save Didgeridrew/720cf341022e490bd26a7566cad7f634 to your computer and use it in GitHub Desktop.
HA - Iterate over calendar events and add to Shopping list
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 Events to Shopping List items | |
sequence: | |
- service: calendar.get_events | |
data: | |
duration: | |
hours: 24 | |
minutes: 0 | |
seconds: 0 | |
target: | |
entity_id: calendar.home_assistant_events | |
response_variable: calendartasks | |
- repeat: | |
for_each: "{{ calendartasks[\"calendar.home_assistant_events\"].events }}" | |
sequence: | |
- service: shopping_list.add_item | |
data: | |
name: >- | |
{{ repeat.item.summary }} | |
{{(repeat.item.start|as_datetime).strftime('%H:%M')}} - | |
{{(repeat.item.end|as_datetime).strftime('%H:%M')}} | |
mode: single |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment