Eintrag in To Do Liste finden und auswerten

Ich hole mit offene Einträge aus einer To-Do Liste

data:
status: needs_action
response_variable: todo_items
action: todo.get_items
target:
entity_id: todo.t15_grad

Diese Ergebnis kommt in todo_items zurück.

{'todo.t15_grad': {'items': \[{'summary': 'Bad', 'uid': '5012a4ae-c39e-11f0-a7d3-20f83b01774a', 'status': 'needs_action'},
{'summary': 'Buero', 'uid': '60f33a4a-c39e-11f0-a7d3-20f83b01774a', 'status': 'needs_action'},
{'summary': 'Schlafzimmer', 'uid': '670a5ed6-c39e-11f0-a7d3-20f83b01774a', 'status': 'needs_action'},
{'summary': 'Gaeste', 'uid': '7afc5a20-c39e-11f0-a7d3-20f83b01774a', 'status': 'needs_action'}\]}}

Ich möchte nun das Ergebnis nach bestimmten Wörtern z.Bsp “Schlafzimmer” durchsuchen.

Wenn das Wort im Ergebnis gefunden wird dann z. Bsp eine Nachricht senden.

Gruß Georg

:crayon:by HarryP: Code-/Logzeilen formatiert (bitte immer in </> einbinden)
s.a.: (Neues Update & Features - Hier in der Community 🫶)

Todo

Script Code - schick nur die, die das Wort “Butzemann” enthalten

sequence:
  - action: todo.get_items
    data:
      status: needs_action
    response_variable: myToDo
    target:
      entity_id: todo.fussballsensor
  - action: notify.gmxolaf3
    data:
      title: todo
      message: |
        {% for item in myToDo["todo.fussballsensor"]["items"] if "Butzemann" in
        item.summary -%} 
        - {{ item.summary }}
        {% endfor %}
alias: 1 forum todo
description: ""

Verschickte Mail

-----Ursprüngliche Nachricht-----
Von: Homeassi
Gesendet: Montag, 17. November 2025 16:25
An: Olaf
Betreff: todo

  • 05.11., 08:04 Uhr: Keiner da aber Bewegung in Hütte - Butzemann? (Tag)
  • 05.11., 12:30 Uhr: Keiner da aber Bewegung in Hütte - Butzemann? (Tag)
  • 05.11., 12:30 Uhr: Rasen Butzemann? (Tag und JZH=off)
  • 11.11., 17:38 Uhr: Rasen Butzemann? (Tag und JZH=off)
  • 11.11., 17:39 Uhr: Keiner da aber Bewegung in Hütte - Butzemann? (Tag)
  • 11.11., 17:41 Uhr: Keiner da aber Bewegung in Hütte - Butzemann? (Tag)
  • 11.11., 17:41 Uhr: Keiner da aber Bewegung in Hütte - Butzemann? (Tag)
  • 11.11., 17:42 Uhr: Keiner da aber Bewegung in Hütte - Butzemann? (Tag)

Habe es jetzt so umgesetzt

data:
status: needs_action
response_variable: todo_items
action: todo.get_items
target:
entity_id: todo.t15_grad

if:

- condition: template
  value_template: |-
  {% set items = todo_items\[‘todo.t15_grad’\]\[‘items’\] %}
  {{ items | selectattr(‘summary’, ‘equalto’, ‘Bad’) | list | length > 0 }}
  then:
- action: script.raum_temperatur_einstellen
  metadata: {}
  data:
  task_name: Bad

Gruß Georg