Hi guys,
I am new top Home assistant and to the community here.
I have some struggles with my automation code.
I am trying to add a ToDoItem to my ToDo list as a birthday pops up in my calender.
Here is my code so far:
alias: GeburtstagsgratulationToDo
description: “”
trigger:
- platform: calendar
event: start
offset: “0:0:0”
entity_id: calendar.geburtstage
condition:
action:
- service: todo.add_item
target:
entity_id: todo.today
data:
item: “{{state_attr(‘trigger.calendar_event’,‘summary’)}}”
mode: single
the trigger seems to work, but I dont get the Name of the calender entry as the item of my to do.
I tried some other item expressions, but none worked for me.
Can you help me please?
Thanks in advance.
did also not work with trigger.calendar_event.summary
Please format your configuration correctly. Without correct formatting, we can’t always determine if the issue is just a formatting issue or something wrong with your configuration.
Since you said the trigger is working… your action should be:
...
action:
service: todo.add_item
target:
entity_id: todo.today
data:
item: "{{ trigger.calendar_event.summary }}"
When testing automations based on Calendar event triggers, keep in mind that the Calendar trigger listener only refreshes every quarter hour.
When you modify the calendar, you’ll need to either:
- Schedule your event after the next quarter hour.
- Force the listener to refresh by saving/reloading the automation. This will likely require an edit to the automation to bring up the “Save” button.
If you don’t do one of the above your test calendar event will pass, but not trigger the automation.
1 Like
thanks for your answer!
It worked!
I think it was the Calendar trigger listener that only refreshes every quarter hour who stole me some hours
So can you please tell me how I can insert the code correctly?
Thanks!
I just tried the code with multiple calendar entries at the same time and it only added one task to the to do list.
Do you have an idea why the other to dos don‘t show up?
Without seeing the current automation my first guess would be that you didn’t change to an appropriate automation mode.
1 Like
I just realized, that the calendar entry with time period “all day” didn’t trigger last night?
Do you also have a solution for this case?
Thanks in advance!