Hallo,
Ich erhalte beim Abruf meiner To-do Liste folgenden Eintrag
{‘todo.your_to_do’: {‘items’: [{‘summary’: ‘Test’, ‘uid’: ‘15fb614e-affc-11f0-be4d-20f83b01774a’, ‘status’: ‘needs_action’, ‘due’: ‘2025-10-23T12:38:00+02:00’, ‘description’: ‘Testaufgabe’}, {‘summary’: ‘Tes1test’, ‘uid’: ‘d0b38504-afff-11f0-be4d-20f83b01774a’, ‘status’: ‘needs_action’, ‘due’: ‘2025-10-23T13:07:00+02:00’, ‘description’: ‘Test1’}]}}
Ich möchte mir nun über Automation eine Benachrichtigung zusenden lassen wenn der Termin im Rückstand ist. Dazu habe ich folgende Automation geschrieben
> alias: YOUR’s To-Do Notification
> description: To-do Notifications
> triggers:
>
> * at: “08:00:00”
> trigger: time
> * at: “12:00:00”
> trigger: time
> * at: “15:00:00”
> trigger: time
> conditions: [ ]
> actions:
> * metadata: {}
> data:
> status: needs_action
> response_variable: todovar
> action: todo.get_items
> target:
> entity_id: todo.your_to_do
> * action: script.notify_all
> metadata: {}
> data:
> message: “{{ todovar }}”
> enabled: true
> * if:
> * condition: template
> value_template: |-
> {%- for item in todovar\[‘todo.YOUR_to_do’\]\[‘items’\] %}
> {% if ‘due’ in item%}
> {% set timeformat = “%Y-%m-%dT%H:%M:%S%z” if ‘T’ in item\[‘due’\] else “%Y-%m-%d” %}
> {% set delta = as_local(strptime(item\[‘due’\], timeformat)) - today_at(“00:00”) %}
> {% if delta.days == 0 %}
> True
> {% break %}
> {% elif delta.days < 0 %}
> True
> {% break %}
> {% endif %}
> {% endif %}
> {% endfor -%}
> then:
> * action: script.notify_all
> metadata: {}
> data:
> message: “{{ todovar }}”
> * data:
> notification_id: TASK DUE
> title: A task is due today!
> message: A task is due today, check your to-do!!
> enabled: false
> action: persistent_notification.create
> enabled: true
> mode: single
Es müssten eigentlich die beiden Erinnerungen kommen.
Was mache ich falsch
Gruß Georg