ToDo List Sensor based

Hi everyone,
any ideas on how to create a sensor that has status on when there is at least one item containing a certain word within a to-do list?

Thanks in advance

template:
  - trigger:
      - platform: event
        event_type: event_template_reloaded
      - platform: state
        entity_id: todo.chores
    action:
      - service: todo.get_items
        data:
          status: needs_action
        target:
          entity_id: todo.chores
        response_variable: mylist
    binary_sensor:
      - name: Example in ToDo (exact match)
        state: |
          {{'Example' in mylist['todo.chores']['items'] 
          | map(attribute='summary') | list }}
      - name: Example in ToDo (search, ignore case)
        state: >
          {{ mylist['todo.chores']['items'] | map(attribute='summary') 
          | select('search', 'Example', true) | list | count > 0 }}
2 Likes

thank youuuuuuuuuuu

There are a few significant differences between what I posted above and what you have posted.

  1. Use of a trigger-based Template sensor. Using a trigger-based method allows us to use actions that return a response variable. Without that, the variable mylist doesn’t hold any information about the to-dos.
  2. Use of the modern format. The legacy format used in your example does not support the necessary modern features described in #1, so it is not fit for this purpose.