[SOLVED] Where to place the tap_action in auto-entities-card with template filter?

Dear community,
I need your help. Due to problems with the custom:grocy-chores-card, I need a workaround for my chores. I started with the auto-entities-card and got it running. But I need the tap_action. Can anyone tell me, where to put it in the script?

type: custom:auto-entities
name: Hausaufgaben
card:
  type: entities
filter:
  template: |-
    {% set SENSOR = 'sensor.grocy_chores' -%}
    {%- for attr in states[SENSOR].attributes.chores -%}
      {% if attr.next_execution_assigned_to_user_id == 2 -%}
        {{
          {
            'type': 'button',
            'entity': SENSOR,
            'attribute': attr,
            'name': attr.name     
          }
        }},
      {%- endif -%}
    {%- endfor %}
  options:
    tap_action:
      action: call-service
      service: grocy.execute_chore
      data:
        skipped: false
        chore_id: attr.id
        done_by: attr.next_execution_assigned_to_user_id

image

On tap, I get:
image
What am I doing wrong?

I found it by myself. Here is the correct code:

type: custom:auto-entities
card:
  type: entities
  title: Hausaufgaben
filter:
  template: |-
    {% set SENSOR ='sensor.grocy_chores' -%} 
    {%- for attr in states[SENSOR].attributes.chores-%}
      {%- if (attr.next_execution_assigned_to_user_id == 2) -%}
        {{
          {
         'type': 'button',
         'entity': SENSOR,
         'attribute': attr,
         'name': attr.name, 
         'tap_action':
          {
           'action': 'call-service',
           'service': 'grocy.execute_chore',
           'service_data':
             {
             'chore_id': attr.id,
             'done_by': attr.next_execution_assigned_to_user_id,
             }
            }
          }
         }},
     {%- endif -%}
    {%- endfor %}